Comparing version 0.0.7 to 0.0.8
@@ -7,3 +7,3 @@ var chalk = require("chalk"); | ||
// fmap() and contrain() are lifted from Rick Waldron's awesome | ||
// fmap() and constrain() are lifted from Rick Waldron's awesome | ||
// Johnny-Five library https://github.com/rwaldron/johnnny-five | ||
@@ -34,2 +34,3 @@ fmap = function(value, fromLow, fromHigh, toLow, toHigh) { | ||
this.label = opts.label || "Input " + String(this.index + 1); | ||
this.constrain = !!opts.constrain || false; | ||
@@ -65,3 +66,7 @@ // So we can left align all the graphs | ||
var raw = data; | ||
// Map and constrain the input values | ||
if (this.constrain) { | ||
raw = constrain(raw, this.inputRange[0], this.inputRange[1]); | ||
} | ||
data = fmap(data, this.inputRange[0], this.inputRange[1], 0, this.width); | ||
@@ -68,0 +73,0 @@ data = constrain(data, 0, this.width); |
{ | ||
"name": "barcli", | ||
"version": "0.0.7", | ||
"version": "0.0.8", | ||
"description": "A simple tool for displaying real time bar graphs in the console", | ||
@@ -21,2 +21,5 @@ "main": "index.js", | ||
"author": "Donovan Buck <donovan@donovan.bz>", | ||
"contributors": [ | ||
{ "name": "David Resseguie", "email": "<david@resseguie.com>" } | ||
], | ||
"license": "MIT", | ||
@@ -23,0 +26,0 @@ "bugs": { |
@@ -49,2 +49,4 @@ # barcli [bahrk-lee] | ||
**constrain** (Boolean) - Constrains displayed input value to given inputRange (Default: false) | ||
**width** (Integer) - The length of the bar in terminal characters (Default: 80) | ||
@@ -51,0 +53,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
8420
73
125