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?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?