sparkly

Generate sparklines ▁▂▃▅▂▇

  • 所有者: sindresorhus/sparkly
  • 平台:
  • 许可证: MIT License
  • 分类:
  • 主题:
  • 喜欢:
    0
      比较:

Github星跟踪图

sparkly Build Status

Generate sparklines ▁▂▃▅▂▇

JavaScript port of spark.sh.

Some cool use-cases.

Install

$ npm install sparkly

Usage

const sparkly = require('sparkly');

sparkly([0, 3, 5, 8, 4, 3, 4, 10]);
//=> '▁▃▄▇▄▃▄█'

// Specifying anything other than finite numbers will cause holes
sparkly([0, 3, 5, '', 4, 3, 4, 10]);
//=> '▁▃▄ ▄▃▄█'

// Specifying an object with minimum and maximum options will change the sparkline range
sparkly([1, 2, 3, 4, 5], {minimum: 0, maximum: 10});
//=> '▁▂▃▄▄'

// Specifying a style option will change the sparkline color
sparkly([1, 2, 3, 4, 5, 6, 7, 8], {style: 'fire'});
// ↓

API

sparkly(numbers, [options])

numbers

Type: number[]

Numbers to create the sparkline from.

options

Type: object

minimum

Type: number

Minimum range.

maximum

Type: number

Maximum range.

style

Type: string
Values: 'fire'

Style for the sparklines.

License

MIT © Sindre Sorhus

主要指标

概览
名称与所有者sindresorhus/sparkly
主编程语言JavaScript
编程语言JavaScript (语言数: 2)
平台
许可证MIT License
所有者活动
创建于2014-08-27 21:25:19
推送于2021-11-21 08:01:52
最后一次提交
发布数10
最新版本名称v6.0.0 (发布于 2021-11-21 14:54:27)
第一版名称v1.0.0 (发布于 2014-08-27 23:29:18)
用户参与
星数424
关注者数11
派生数12
提交数35
已启用问题?
问题数8
打开的问题数1
拉请求数5
打开的拉请求数0
关闭的拉请求数3
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?