분류 Nodejs

sparkly - 스파크 라인을 생성합니다

컨텐츠 정보

  • 조회 280 (작성일 )

본문

https://github.com/sindresorhus/sparkly 



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 a min max object will change the sparkline range
sparkly([1, 2, 3, 4, 5], {min: 0, max: 10});
//=> '▁▂▃▄▄'

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

screenshot.png