• Stars
    star
    1,191
  • Rank 39,271 (Top 0.8 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created over 7 years ago
  • Updated almost 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

๐ŸŒˆ Simple, elegant spark lines for Vue.js

๐Ÿ”ฅ๐Ÿ”ฅ๐Ÿ”ฅ

More powerful, more flexible chart library for Vue.js ๐Ÿ‘‰ https://github.com/QingWei-Li/laue

๐Ÿ”ฅ๐Ÿ”ฅ๐Ÿ”ฅ


Vue Trend

Vue Trend

๐ŸŒˆ Simple, elegant spark lines for Vue.js


npm vue

Installation

npm i vuetrend -S

Usage

import Vue from "vue"
import Trend from "vuetrend"

Vue.use(Trend)

vue template

<trend
  :data="[0, 2, 5, 9, 5, 10, 3, 5, 0, 0, 1, 8, 2, 9, 0]"
  :gradient="['#6fa8dc', '#42b983', '#2c3e50']"
  auto-draw
  smooth
>
</trend>

Live Demo

Inspired

unsplash/react-trend - ๐Ÿ“ˆ Simple, elegant spark lines

Props

Name Type Default Description Example
data Number|Object undefined The data accepted by Vue Trend is incredibly simple: An array of y-axis values to graph. [120, 149, 193.4, 200, 92] or [{ value: 4 }, { value: 6 }, { value: 8 }]
gradient String ['#000'] Colour can be specified as any SVG-supported format (named, rgb, hex, etc). ['#0FF', '#F0F', '#FF0']
gradientDirection String top Top, Bottom, Left or Right.
width Number auto Set an explicit width for your SVG. -
height Number auto Set an explicit height for your SVG. -
padding Number 8 If you set a very large strokeWidth on your line, you may notice that it gets "cropped" towards the edges. -
smooth Boolean false Smooth allows the peaks to be 'rounded' out so that the line has no jagged edges. -
radius Number 10 When using smoothing, you may wish to control the amount of curve around each point. This prop has no effect if smooth isn't set to true. -
autoDraw Boolean false Allow the line to draw itself on mount. Set to true to enable, and customize using autoDrawDuration and autoDrawEasing. -
autoDrawDuration Number 2000 The amount of time, in milliseconds, that the autoDraw animation should span. This prop has no effect if autoDraw isn't set to true. -
autoDrawEasing String ease The easing function to use for the autoDraw animation. Accepts any transition timing function within the CSS spec (eg. linear, ease, ease-in, cubic-bezier...). -
max Number -Infinity Specify max value -
min Number Infinity Specify min value, This is useful if you have multiple lines. See #8 -

SVG Props

By default, all properties not recognized by Vue Trend will be delegated to the SVG. The line inherits these properties if none of its own override them.

This means that, among other properties, you can use:

  • stroke to set a solid colour,
  • strokeWidth to change the default line thickness,
  • strokeOpacity to create a transparent line,
  • strokeLinecap/strokeLinejoin to control the edges of your line,
  • strokeDasharray to create a dashed line, and
  • strokeDashoffset to control where the dashes start.

Development

yarn
yarn dev
# open localhost:4000

TODO

  • Unit test

License

MIT

More Repositories

1

vuep

๐ŸŽก A component for rendering Vue components with live editor and preview.
JavaScript
886
star
2

vue-markdown-loader

๐Ÿ“‡ Convert Markdown file to Vue2.0 component.
JavaScript
702
star
3

laue

๐Ÿ––๐Ÿ“ˆ Modern charts for Vue 2.0
JavaScript
263
star
4

vuerify

๐ŸšฉValidation plugin for Vue.js
JavaScript
191
star
5

vue-region-picker

[DEPRECATED]
JavaScript
158
star
6

vuep.run

๐Ÿƒ An online playground for Vue2.0
Vue
140
star
7

npmarket

๐Ÿ›’ More efficient search for node packages.
Vue
93
star
8

jsdoc-vue

[โžก๏ธ https://github.com/Kocal/jsdoc-vuejs] A jsdoc plugin that parses *.vue files.
Vue
69
star
9

vue-tricks

Vue
47
star
10

donate

โค๏ธ Donate to @QingWei-Li
24
star
11

pue-loader

๐Ÿ A more pythonic javascript for Vue component file. (Pug + CoffeeScript + Stylus)
JavaScript
20
star
12

vue-delay

๐ŸŒ Delay rendering component for Vue.js
JavaScript
17
star
13

typer

โœ๏ธ A simplified publishing tool
TypeScript
12
star
14

vueo

๐ŸŸ Easy to get value from vue instance via object paths.
JavaScript
10
star
15

hostext

๐Ÿ”ก Text hosting service
JavaScript
9
star
16

vuetch

๐Ÿ‘ป [WIP]A Vue 2.0 component that fetches data from a http request.
JavaScript
8
star
17

theme-color

Material theme color generator.
JavaScript
7
star
18

2webpack2

๐Ÿ•ณ๏ธ Turn configuration of webpack 1 to 2
JavaScript
5
star
19

buble-jest

Jest plugin to use buble and babel(handle ES Modules) for transformation
JavaScript
5
star
20

highlightext

๐Ÿ’ก Highlight text service
JavaScript
4
star
21

noop-webpack-plugin

๐Ÿคทโ€โ™€๏ธ Webpack plugin that does nothing.
JavaScript
4
star
22

nft-swag

TypeScript
3
star
23

pue-syntax-highlight

Sublime Text syntax highlighting for single-file Vue components
3
star
24

htpl

A JavaScript templating engine uses Vue syntax.
TypeScript
3
star
25

vuea

๐Ÿ” Easy to drop or replace specified key in an array.
JavaScript
2
star
26

AutoBackupFolder

ๅฎšๆ—ถๆ‰“ๅŒ…ๅค‡ไปฝๆŒ‡ๅฎšๆ–‡ไปถๅคน็š„็จ‹ๅบ
C#
2
star
27

MagicCubeReduction-CFOP

็”จcfop่ฟ˜ๅŽŸ้ญ”ๆ–น๏ผŒ ็ฌฌไธ€ไธชc#ๅผ€ๅ‘็š„็จ‹ๅบ๏ผŒ็•™ไธชๅฟตๆƒณ
C#
2
star
28

Aha

[DEPRECATED] ้ญ”ๅ…ฝไธ–็•Œๆ‹ๅ–่กŒ่พ…ๅŠฉๅทฅๅ…ท๏ผˆๅฎขๆˆท็ซฏ๏ผ‰
JavaScript
2
star
29

ablog

A homework orz
TypeScript
2
star
30

qingwei-li.github.io

HTML
1
star
31

sort

ไธ€ไบ›sort็ฎ—ๆณ•็ปƒไน 
JavaScript
1
star
32

parsedate

Converts a value to a Date
JavaScript
1
star
33

Polish

[DEPRECATED]
JavaScript
1
star
34

global-bin-path

DEPRECATED
JavaScript
1
star
35

site

1
star