Package Exports
- ascii-boxplot
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (ascii-boxplot) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
ascii-boxplot
ascii, character-only horizontal boxplots
patates · • [---[==|==]---] • ·
frites · • [----[=|===]--] • ·
poutines · • [----[=|=]----] • ·
choucroutte · • [----[=|=]-----] • ·• Introduction • API • Options • License •
var boxplot = require('boxplot')
boxplot({
label1: arrayOfSamples1,
label2: arrayOfSamples2,
label3: arrayOfSamples3,
})API
boxplot(sourceData[, options])
sourceDataobject or array of samples. The keys are used as labels an array of sorted samplesoptionsoptionsal configuration object
Options
The optional options object can override any or all of the internal defaults
var defaults = {
1: ' • ',
2: ' [=] ',
3: ' [=|=] ',
5: ' [-[=|=]-] ',
7: ' • [-[=|=]-] • ',
9: ' · • [-[=|=]-] • · ',
cols: 0, // will attempt to autodetect if cols is falsy, defaulting to 80
padding: [4, 4],
probs: [0, .02, .09, .25, .50, .75, .91, .98, 1],
ondone: function(str) { console.log(str) }
}1..9are the templates for a given quantile size. The even chars are for the actual values, the odd ones are repeated in-betweencolsthe maximum width of the screen in characterspaddingleft and right padding (after the longest label and before the right edge)probsthe probabilities to be used when calculating the sample quantiles. Can be 1,2,3,5,7 or 9 chars long.ondonethe action to do with the completed string
If the sample size is less or equal to probs.length the sample values are used as-is.
This means that precomputed quantile values can also be used
License
Released under the MIT License