Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ascii-boxplot

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ascii-boxplot

small configurable boxplot utility for the console

  • 1.0.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
6
increased by20%
Maintainers
1
Weekly downloads
 
Created
Source

ascii-boxplot

ascii, character-only horizontal boxplots

patates        ·      •    [----[==|==]----]    •    ·
frites       ·   •   [---[=|===]--]   •   ·
poutines       ·   •    [----[=|=]----]     •     ·
choucroutte       ·  •    [----[=|=]-----]   •   ·

IntroductionAPIOptionsLicense

var boxplot = require('boxplot')
boxplot({
  label1: arrayOfSamples1,
  label2: arrayOfSamples2,
  label3: arrayOfSamples3,
})

API

boxplot(sourceData[, options])

  • sourceData object or array of samples. The keys are used as labels an array of sorted samples
  • options optionsal 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..9 are the templates for a given quantile size. The even chars are for the actual values, the odd ones are repeated in-between
  • cols the maximum width of the screen in characters
  • padding left and right padding (after the longest label and before the right edge)
  • probs the probabilities to be used when calculating the sample quantiles. Can be 1,2,3,5,7 or 9 chars long.
  • ondone the 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

Keywords

FAQs

Package last updated on 17 Sep 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc