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

sparkline

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sparkline - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

bower.json

22

lib/sparkline.js

@@ -12,16 +12,11 @@ /*

var undefined,
sparkline,
var sparkline,
ticks = ['▁', '▂', '▃', '▄', '▅', '▆', '▇', '█'];
sparkline = function(numbers) {
var i, n, min, max, f,
results = [];
var max = Math.max.apply(null, numbers),
min = Math.min.apply(null, numbers),
results = [],
f, i;
for (i = 0; i < numbers.length; i++) {
n = numbers[i];
if (min === undefined || n < min) { min = n; }
if (max === undefined || n > max) { max = n; }
}
f = ~~(((max - min) << 8) / (ticks.length - 1));

@@ -31,4 +26,3 @@ if (f < 1) { f = 1; }

for (i = 0; i < numbers.length; i++) {
n = numbers[i];
results.push(ticks[~~(((n - min) << 8) / f)]);
results.push(ticks[~~(((numbers[i] - min) << 8) / f)]);
}

@@ -43,3 +37,7 @@

window.sparkline = sparkline;
if (typeof define === 'function' && define.amd) {
define('sparkline', [], function () { return sparkline; });
}
}
})(this);
{
"name": "sparkline",
"description": "JavaScript implementation of 'spark'.",
"version": "0.1.0",
"version": "0.1.1",
"homepage": "https://github.com/shiwano/sparkline",

@@ -6,0 +6,0 @@ "author": {

@@ -42,2 +42,3 @@ # sparkline

## Release History
* 2013-06-01   v0.1.1   Support AMD and bower
* 2013-05-30   v0.1.0   First release.

@@ -44,0 +45,0 @@

Sorry, the diff of this file is not supported yet

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