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

victory-chart

Package Overview
Dependencies
Maintainers
8
Versions
290
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

victory-chart - npm Package Compare versions

Comparing version 16.1.1 to 16.1.2

5

CHANGELOG.md
# VictoryChart Changelog
## 16.1.2 (2017-03-05)
- [431](https://github.com/FormidableLabs/victory-chart/pull/431)
- Sets a maximum amount of scale per zoom event for smoother interaction with fast onWheel events
## 16.1.1 (2017-02-03)

@@ -4,0 +9,0 @@

14

lib/components/containers/zoom-helpers.js

@@ -18,7 +18,12 @@ Object.defineProperty(exports,"__esModule",{value:true});var _isFunction2=require("lodash/isFunction");var _isFunction3=_interopRequireDefault(_isFunction2);var _throttle2=require("lodash/throttle");var _throttle3=_interopRequireDefault(_throttle2);var _slicedToArray=function(){function sliceIterator(arr,i){var _arr=[];var _n=true;var _d=false;var _e=undefined;try{for(var _i=arr[typeof Symbol==="function"?Symbol.iterator:"@@iterator"](),_s;!(_n=(_s=_i.next()).done);_n=true){_arr.push(_s.value);if(i&&_arr.length===i)break;}}catch(err){_d=true;_e=err;}finally{try{if(!_n&&_i["return"])_i["return"]();}finally{if(_d)throw _e;}}return _arr;}return function(arr,i){if(Array.isArray(arr)){return arr;}else if((typeof Symbol==="function"?Symbol.iterator:"@@iterator")in Object(arr)){return sliceIterator(arr,i);}else{throw new TypeError("Invalid attempt to destructure non-iterable instance");}};}();var _victoryCore=require("victory-core");function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj};}

var midpoint=+from+range/2;
var newRange=range*factor/2;
return[
var newRange=range*Math.abs(factor)/2;
var minDomain=_victoryCore.Collection.containsDates(originalDomain)?
[new Date(midpoint-4),new Date(midpoint)]:
[midpoint-1/Number.MAX_SAFE_INTEGER,midpoint];
var newDomain=[
_victoryCore.Collection.getMaxValue([midpoint-newRange,fromBound]),
_victoryCore.Collection.getMinValue([midpoint+newRange,toBound])];
return Math.abs(minDomain[1]-minDomain[0])>Math.abs(newDomain[1]-newDomain[0])?
minDomain:newDomain;
},

@@ -140,4 +145,5 @@

var xBounds=originalDomain.x;
var nextXDomain=this.scale(x,xBounds,1+evt.deltaY/300);
var sign=evt.deltaY>0?1:-1;
var delta=Math.min(Math.abs(evt.deltaY/300),0.75);
var nextXDomain=this.scale(x,xBounds,1+sign*delta);
var currentDomain={x:nextXDomain,y:originalDomain.y};

@@ -144,0 +150,0 @@ var resumeAnimation=this.handleAnimation(ctx);

{
"name": "victory-chart",
"version": "16.1.1",
"version": "16.1.2",
"description": "Chart Component for Victory",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

@@ -18,7 +18,12 @@ import { Selection, Collection } from "victory-core";

const midpoint = +from + (range / 2);
const newRange = (range * factor) / 2;
return [
const newRange = (range * Math.abs(factor)) / 2;
const minDomain = Collection.containsDates(originalDomain) ?
[ new Date(midpoint - 4), new Date(midpoint) ] : // 4ms is standard browser date precision
[ midpoint - 1 / Number.MAX_SAFE_INTEGER, midpoint ];
const newDomain = [
Collection.getMaxValue([midpoint - newRange, fromBound]),
Collection.getMinValue([midpoint + newRange, toBound])
];
return Math.abs(minDomain[1] - minDomain[0]) > Math.abs(newDomain[1] - newDomain[0]) ?
minDomain : newDomain;
},

@@ -140,4 +145,5 @@

const xBounds = originalDomain.x;
// TODO: Check scale factor
const nextXDomain = this.scale(x, xBounds, 1 + (evt.deltaY / 300));
const sign = evt.deltaY > 0 ? 1 : -1;
const delta = Math.min(Math.abs(evt.deltaY / 300), 0.75); // TODO: Check scale factor
const nextXDomain = this.scale(x, xBounds, 1 + sign * delta);
const currentDomain = { x: nextXDomain, y: originalDomain.y };

@@ -144,0 +150,0 @@ const resumeAnimation = this.handleAnimation(ctx);

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

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