0.0.2 • Published 9 years ago

1bit-chart-bars v0.0.2

Weekly downloads
41
License
MIT
Repository
github
Last release
9 years ago

1bit-chart-bars

Simple module for generating 1bit bar charts. Outputs an nd-array of bits.

Build Status

Browser Test Status

example

var chart = require('1bit-chart-bars');
var input = [1, 2, 3, 4, 5];
chart(input, {
    height: 7,
    width: 5,
    padding: 0,
    min: 0,
    max: 7
});

/*
[
    [false, false, false, false, false],
    [false, false, false, false, false],
    [false, false, false, false,  true],
    [false, false, false,  true,  true],
    [false, false,  true,  true,  true],
    [false,  true,  true,  true,  true],
    [ true,  true,  true,  true,  true]
]
*/
░░░░░░░░░▄░░░░░░░░░░░░░░▄ 
░░░░░░░░▌▒█░░░░░░░░░░░▄▀▒▌ 
░░░░░░░░▌▒▒█░░░░░░░░▄▀▒▒▒▐     such chart
░░░░░░░▐▄▀▒▒▀▀▀▀▄▄▄▀▒▒▒▒▒▐ 
░░░░░▄▄▀▒░▒▒▒▒▒▒▒▒▒█▒▒▄█▒▐ 
░░░▄▀▒▒▒░░░▒▒▒░░░▒▒▒▀██▀▒▌     amaze
░░▐▒▒▒▄▄▒▒▒▒░░░▒▒▒▒▒▒▒▀▄▒▒▌ 
░░▌░░▌█▀▒▒▒▒▒▄▀█▄▒▒▒▒▒▒▒█▒▐ 
░▐░░░▒▒▒▒▒▒▒▒▌██▀▒▒░░░▒▒▒▀▄▌ 
░▌░▒▄██▄▒▒▒▒▒▒▒▒▒░░░░░░▒▒▒▒▌ 
▌▒▀▐▄█▄█▌▄░▀▒▒░░░░░░░░░░▒▒▒▐     many bar
▐▒▒▐▀▐▀▒░▄▄▒▄▒▒▒▒▒▒░▒░▒░▒▒▒▒▌ 
▐▒▒▒▀▀▄▄▒▒▒▄▒▒▒▒▒▒▒▒░▒░▒░▒▒▐ 
░▌▒▒▒▒▒▒▀▀▀▒▒▒▒▒▒░▒░▒░▒░▒▒▒▌ 
░▐▒▒▒▒▒▒▒▒▒▒▒▒▒▒░▒░▒░▒▒▄▒▒▐  wow
░░▀▄▒▒▒▒▒▒▒▒▒▒▒░▒░▒░▒▄▒▒▒▒▌ 
░░░░▀▄▒▒▒▒▒▒▒▒▒▒▄▄▄▀▒▒▒▒▄▀ 
░░░░░░▀▄▄▄▄▄▄▀▀▀▒▒▒▒▒▄▄▀ 
░░░░░░░░░▒▒▒▒▒▒▒▒▒▒▀▀
0.0.2

9 years ago