victory-chart
Advanced tools
Comparing version 16.1.1 to 16.1.2
# 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 @@ |
@@ -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
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
1912117
36082
4
1