Coder Social home page Coder Social logo

trendingtechnology / vue-histogram-slider Goto Github PK

View Code? Open in Web Editor NEW

This project forked from oguzhaninan/vue-histogram-slider

0.0 1.0 0.0 946 KB

Range slider with histogram for Vue.js

Home Page: https://www.npmjs.com/package/vue-histogram-slider

License: GNU General Public License v3.0

JavaScript 85.57% HTML 0.65% Vue 13.78%

vue-histogram-slider's Introduction

Range slider with histogram for Vue

npm GitHub issues npm


๐Ÿš€ Quick Start

If you are a try and learn developer, you can start trying the vue-histogram-slider now using codesandbox.io.

Edit Vue Histogram Slider

๐Ÿ“ฆ Installation

yarn

yarn add vue-histogram-slider

npm

npm i vue-histogram-slider

๐Ÿ”ง Usage

import Vue from 'vue';
import HistogramSlider from 'vue-histogram-slider';
import 'vue-histogram-slider/dist/histogram-slider.css';

Vue.component(HistogramSlider.name, HistogramSlider);
<HistogramSlider
    :width="600"
    :bar-height="100"
    :data="data"
/>

๐Ÿ“‹ Props

Property Type Default Description
min number 1 Set slider minimum value
max number 100 Set slider maximum value
data array - Data for histogram
block boolean false Locks slider and makes it inactive
grid boolean true Enables grid of values.
gridNum number 4 Number of grid units.
step number 1 Set sliders step. Always > 0. Could be fractional.
hideMinMax boolean true Hides min and max labels
hideFromTo boolean false Hides from and to labels
toFixed boolean false Fix position of right handle.
fromFixed boolean false Fix position of left (or single) handle.
forceEdges boolean false Slider will be always inside it's container.
dragInterval boolean false Allow user to drag whole range. Only in double type
keyboard boolean true Activates keyboard controls. Move left: โ†, โ†“, A, S. Move right: โ†’, โ†‘, W, D.
type string double Choose slider type, could be single - for one handle, or double for two handles
width number 600 width of dialog
barHeight number 100 Set max histogram bar height
barWidth number 6 Set histogram bar width
barGap number 5 Set histogram bar gap
barRadius number 4 Set histogram bar radius
prettify function null Set up your own prettify function. Can be anything. For example, you can set up unix time as slider values and than transform them to cool looking dates.
lineHeight number 6 Set slider line height
transitionDuration number 100 Set duration to histogram bars
primaryColor string #0091ff Primary color
labelColor string #0091ff Label color
holderColor string #dee4ec Holder color
handleColor string #ffffff Slider handle color
gridTextColor string silver Primary color
fontFamily string 'Arial, sans-serif' Set text font family
fontSize number 12 Set text font size
histSliderGap number 6 Set gap between slider and histogram
updateColorOnChange boolean true Update histogram bar color on change (recommended false for performance)

Event

Name Description
start Triggers when slider start.
change Triggers when each values change.
update Triggers when slider is modified by external methods update or reset.
finish Triggers when user releases handle.

vue-histogram-slider's People

Contributors

dependabot[bot] avatar oguzhaninan avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.