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

canvas-curve

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

canvas-curve - npm Package Compare versions

Comparing version 0.1.6 to 0.1.7

42

lib/canvas-curve.js

@@ -1043,14 +1043,12 @@ /**

// before the first point (if not at the left of the canvas)
if(xSeries[0] > this._controlPointRadius) {
for(var x=0; x<Math.ceil(xSeries[0]); x++){
var y = ySeries[0];
// copying the inteprolated values in a buffer
this._xSeriesInterpolated[x] = x / w;
this._ySeriesInterpolated[x] = y / h;
// adjusting y for visual purpose
y = y < 0 ? 0.5 : y > h ? h - 0.5 : y;
this._ctx.lineTo(x/this._screenRatio, (h - y)/this._screenRatio);
}
for(var x=0; x<Math.ceil(xSeries[0]); x++){
var y = ySeries[0];
// copying the inteprolated values in a buffer
this._xSeriesInterpolated[x] = x / w;
this._ySeriesInterpolated[x] = y / h;
// adjusting y for visual purpose
y = y < 0 ? 0.5 : y > h ? h - 0.5 : y;
this._ctx.lineTo(x/this._screenRatio, (h - y)/this._screenRatio);
}

@@ -1071,15 +1069,13 @@

if(this._width - this._controlPointRadius > Math.ceil(xSeries[xSeries.length - 1])) {
// after the last point (if not at the right of the canvas)
for(var x=Math.ceil(xSeries[xSeries.length - 1]); x<w; x++){
var y = ySeries[ySeries.length - 1];
// after the last point (if not at the right of the canvas)
for(var x=Math.ceil(xSeries[xSeries.length - 1]); x<w; x++){
var y = ySeries[ySeries.length - 1];
// copying the inteprolated values in a buffer
this._xSeriesInterpolated[x] = x / w;
this._ySeriesInterpolated[x] = y / h;
// copying the inteprolated values in a buffer
this._xSeriesInterpolated[x] = x / w;
this._ySeriesInterpolated[x] = y / h;
// adjusting y for visual purpose
y = y < 0 ? 0.5 : y > h ? h - 0.5 : y;
this._ctx.lineTo(x/this._screenRatio, (h - y)/this._screenRatio);
}
// adjusting y for visual purpose
y = y < 0 ? 0.5 : y > h ? h - 0.5 : y;
this._ctx.lineTo(x/this._screenRatio, (h - y)/this._screenRatio);
}

@@ -1086,0 +1082,0 @@

{
"name": "canvas-curve",
"version": "0.1.6",
"version": "0.1.7",
"description": "A spline widget",

@@ -5,0 +5,0 @@ "author": "moocher",

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