0.3.9 • Published 4 years ago

vue-graph-slider v0.3.9

Weekly downloads
1
License
GPL-3.0
Repository
-
Last release
4 years ago

📦 Installation

yarn

yarn add vue-graph-slider

npm

npm i vue-graph-slider

🔧 Usage

import Vue from 'vue';
import GraphSlider from 'vue-graph-slider';
import 'vue-graph-slider/dist/graph-slider.css';

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

📋 Props

PropertyTypeDefaultDescription
minnumber1Set slider minimum value
maxnumber100Set slider maximum value
dataarray-Data for graph
blockbooleanfalseLocks slider and makes it inactive
gridbooleantrueEnables grid of values.
gridNumnumber4Number of grid units.
stepnumber1Set sliders step. Always > 0. Could be fractional.
hideMinMaxbooleantrueHides min and max labels
hideFromTobooleanfalseHides from and to labels
toFixedbooleanfalseFix position of right handle.
fromFixedbooleanfalseFix position of left (or single) handle.
forceEdgesbooleanfalseSlider will be always inside it's container.
dragIntervalbooleanfalseAllow user to drag whole range. Only in double type
keyboardbooleantrueActivates keyboard controls. Move left: ←, ↓, A, S. Move right: →, ↑, W, D.
typestringdoubleChoose slider type, could be single - for one handle, or double for two handles
widthnumber600width of dialog
barHeightnumber100Set max graph bar height
barWidthnumber6Set graph bar width
barGapnumber5Set graph bar gap
barRadiusnumber4Set graph bar radius
prettifyfunctionnullSet 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.
lineHeightnumber6Set slider line height
transitionDurationnumber100Set duration to graph bars
primaryColorstring#0091ffPrimary color
labelColorstring#0091ffLabel color
holderColorstring#dee4ecHolder color
handleColorstring#ffffffSlider handle color
gridTextColorstringsilverPrimary color
fontFamilystring'Arial, sans-serif'Set text font family
fontSizenumber12Set text font size
handleSizenumber26Slider handle size
histSliderGapnumber6Set gap between slider and graph
updateColorOnChangebooleantrueUpdate graph bar color on change (recommended false for performance)

🔧 Event

NameDescription
startTriggers when slider start.
changeTriggers when each values change.
updateTriggers when slider is modified by external methods update or reset.
finishTriggers when user releases handle.