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.0.0 to 16.0.1

5

CHANGELOG.md
# VictoryChart Changelog
## 16.0.1 (2017-02-01)
- [428](https://github.com/FormidableLabs/victory-chart/pull/428)
- Fixes a bug in `VictoryBrushContainer`
## 16.0.0 (2017-01-30)

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

2

lib/components/containers/helper-methods.js

@@ -80,3 +80,3 @@ Object.defineProperty(exports,"__esModule",{value:true});var _assign2=require("lodash/assign");var _assign3=_interopRequireDefault(_assign2);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};}function _toConsumableArray(arr){if(Array.isArray(arr)){for(var i=0,arr2=Array(arr.length);i<arr.length;i++){arr2[i]=arr[i];}return arr2;}else{return Array.from(arr);}}exports.default=

fullDomain=fullDomain||domain||this.getOriginalDomain(props);
selectedDomain=selectedDomain||props.selectedDomain||fullDomain;
selectedDomain=selectedDomain||fullDomain;
var fullCoordinates=_victoryCore.Selection.getDomainCoordinates(scale,fullDomain);

@@ -83,0 +83,0 @@ var selectedCoordinates=_victoryCore.Selection.getDomainCoordinates(scale,selectedDomain);

@@ -247,2 +247,2 @@ Object.defineProperty(exports,"__esModule",{value:true});var _isFunction2=require("lodash/isFunction");var _isFunction3=_interopRequireDefault(_isFunction2);var _isEqual2=require("lodash/isEqual");var _isEqual3=_interopRequireDefault(_isEqual2);var _assign2=require("lodash/assign");var _assign3=_interopRequireDefault(_assign2);var _extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,descriptor.key,descriptor);}}return function(Constructor,protoProps,staticProps){if(protoProps)defineProperties(Constructor.prototype,protoProps);if(staticProps)defineProperties(Constructor,staticProps);return Constructor;};}();var _react=require("react");var _react2=_interopRequireDefault(_react);

});
}}]);return VictoryBrushContainer;}(_victoryCore.VictoryContainer);VictoryBrushContainer.displayName="VictoryBrushContainer";VictoryBrushContainer.propTypes=_extends({},_victoryCore.VictoryContainer.propTypes,{selectionStyle:_react2.default.PropTypes.object,handleStyle:_react2.default.PropTypes.object,dimension:_react2.default.PropTypes.oneOf(["x","y"]),selectedDomain:_react2.default.PropTypes.shape({x:_react2.default.PropTypes.array,y:_react2.default.PropTypes.array}),onDomainChange:_react2.default.PropTypes.func,handleWidth:_react2.default.PropTypes.number,selectionComponent:_react2.default.PropTypes.element,handleComponent:_react2.default.PropTypes.element});VictoryBrushContainer.defaultProps=_extends({},_victoryCore.VictoryContainer.defaultProps,{selectionStyle:{stroke:"transparent",fill:"black",fillOpacity:0.1},handleStyle:{stroke:"transparent",fill:"transparent"},dimension:"x",handleWidth:8,selectionComponent:_react2.default.createElement("rect",null),handleComponent:_react2.default.createElement("rect",null)});VictoryBrushContainer.defaultEvents=[{target:"parent",eventHandlers:{onMouseDown:function onMouseDown(evt,targetProps){evt.preventDefault();var dimension=targetProps.dimension,selectedDomain=targetProps.selectedDomain,domain=targetProps.domain,handleWidth=targetProps.handleWidth,onDomainChange=targetProps.onDomainChange,cachedSelectedDomain=targetProps.cachedSelectedDomain;var fullDomainBox=targetProps.fullDomainBox||_helperMethods2.default.getDomainBox(targetProps,domain);var currentDomain=(0,_isEqual3.default)(selectedDomain,cachedSelectedDomain)?targetProps.currentDomain||selectedDomain||domain:selectedDomain||domain;var _Selection$getSVGEven=_victoryCore.Selection.getSVGEventCoordinates(evt),x=_Selection$getSVGEven.x,y=_Selection$getSVGEven.y;if(!_helperMethods2.default.withinBounds({x:x,y:y},fullDomainBox,handleWidth)){return{};}var domainBox=_helperMethods2.default.getDomainBox(targetProps,domain,currentDomain);var activeHandles=_helperMethods2.default.getActiveHandles({x:x,y:y},targetProps,domainBox);if(activeHandles){return[{target:"parent",mutation:function mutation(){return _extends({isSelecting:true,domainBox:domainBox,fullDomainBox:fullDomainBox,cachedSelectedDomain:selectedDomain,currentDomain:currentDomain},_helperMethods2.default.getResizeMutation(domainBox,activeHandles));}}];}else if(_helperMethods2.default.withinBounds({x:x,y:y},domainBox)&&!(0,_isEqual3.default)(domain,currentDomain)){return[{target:"parent",mutation:function mutation(){return{isPanning:true,startX:x,startY:y,domainBox:domainBox,fullDomainBox:fullDomainBox,currentDomain:currentDomain,cachedSelectedDomain:selectedDomain};}}];}else{var minimumDomain=_helperMethods2.default.getMinimumDomain();if((0,_isFunction3.default)(onDomainChange)){onDomainChange(minimumDomain);}return[{target:"parent",mutation:function mutation(){return _extends({isSelecting:true,domainBox:domainBox,fullDomainBox:fullDomainBox,cachedSelectedDomain:selectedDomain,currentDomain:_helperMethods2.default.getMinimumDomain()},_helperMethods2.default.getSelectionMutation({x:x,y:y},domainBox,dimension));}}];}},onMouseMove:function onMouseMove(evt,targetProps){if(!targetProps.isPanning&&!targetProps.isSelecting){return{};}var dimension=targetProps.dimension,scale=targetProps.scale,isPanning=targetProps.isPanning,isSelecting=targetProps.isSelecting,fullDomainBox=targetProps.fullDomainBox,onDomainChange=targetProps.onDomainChange;var _Selection$getSVGEven2=_victoryCore.Selection.getSVGEventCoordinates(evt),x=_Selection$getSVGEven2.x,y=_Selection$getSVGEven2.y;if(!_helperMethods2.default.withinBounds({x:x,y:y},fullDomainBox)){return{};}if(isPanning){var _ret=function(){var startX=targetProps.startX,startY=targetProps.startY;var pannedBox=_helperMethods2.default.panBox(targetProps,{x:x,y:y});var constrainedBox=_helperMethods2.default.constrainBox(pannedBox,fullDomainBox);var currentDomain=_victoryCore.Selection.getBounds(_extends({},constrainedBox,{scale:scale}));if((0,_isFunction3.default)(onDomainChange)){onDomainChange(currentDomain);}return{v:[{target:"parent",mutation:function mutation(){return _extends({currentDomain:currentDomain,startX:pannedBox.x2>=fullDomainBox.x2||pannedBox.x1<=fullDomainBox.x1?startX:x,startY:pannedBox.y2>=fullDomainBox.y2||pannedBox.y1<=fullDomainBox.y1?startY:y},constrainedBox);}}]};}();if(typeof _ret==="object")return _ret.v;}else if(isSelecting){var _ret2=function(){var x2=dimension!=="y"?x:targetProps.x2;var y2=dimension!=="x"?y:targetProps.y2;var currentDomain=_victoryCore.Selection.getBounds({x2:x2,y2:y2,x1:targetProps.x1,y1:targetProps.y1,scale:scale});if((0,_isFunction3.default)(onDomainChange)){onDomainChange(currentDomain);}return{v:[{target:"parent",mutation:function mutation(){return{x2:x2,y2:y2,currentDomain:currentDomain};}}]};}();if(typeof _ret2==="object")return _ret2.v;}},onMouseUp:function onMouseUp(evt,targetProps){var x1=targetProps.x1,y1=targetProps.y1,x2=targetProps.x2,y2=targetProps.y2,domain=targetProps.domain,onDomainChange=targetProps.onDomainChange;if(x1===x2||y1===y2){if((0,_isFunction3.default)(onDomainChange)){onDomainChange(domain);}return[{target:"parent",mutation:function mutation(){return{isPanning:false,isSelecting:false,selectedDomain:domain};}}];}return[{target:"parent",mutation:function mutation(){return{isPanning:false,isSelecting:false};}}];},onMouseLeave:function onMouseLeave(){return[{target:"parent",mutation:function mutation(){return{isPanning:false,isSelecting:false};}}];}}}];exports.default=VictoryBrushContainer;
}}]);return VictoryBrushContainer;}(_victoryCore.VictoryContainer);VictoryBrushContainer.displayName="VictoryBrushContainer";VictoryBrushContainer.propTypes=_extends({},_victoryCore.VictoryContainer.propTypes,{selectionStyle:_react2.default.PropTypes.object,handleStyle:_react2.default.PropTypes.object,dimension:_react2.default.PropTypes.oneOf(["x","y"]),selectedDomain:_react2.default.PropTypes.shape({x:_react2.default.PropTypes.array,y:_react2.default.PropTypes.array}),onDomainChange:_react2.default.PropTypes.func,handleWidth:_react2.default.PropTypes.number,selectionComponent:_react2.default.PropTypes.element,handleComponent:_react2.default.PropTypes.element});VictoryBrushContainer.defaultProps=_extends({},_victoryCore.VictoryContainer.defaultProps,{selectionStyle:{stroke:"transparent",fill:"black",fillOpacity:0.1},handleStyle:{stroke:"transparent",fill:"transparent"},dimension:"x",handleWidth:8,selectionComponent:_react2.default.createElement("rect",null),handleComponent:_react2.default.createElement("rect",null)});VictoryBrushContainer.defaultEvents=[{target:"parent",eventHandlers:{onMouseDown:function onMouseDown(evt,targetProps){evt.preventDefault();var dimension=targetProps.dimension,selectedDomain=targetProps.selectedDomain,domain=targetProps.domain,handleWidth=targetProps.handleWidth,onDomainChange=targetProps.onDomainChange,cachedSelectedDomain=targetProps.cachedSelectedDomain;var fullDomainBox=targetProps.fullDomainBox||_helperMethods2.default.getDomainBox(targetProps,domain);var currentDomain=(0,_isEqual3.default)(selectedDomain,cachedSelectedDomain)?targetProps.currentDomain||selectedDomain||domain:selectedDomain||domain;var _Selection$getSVGEven=_victoryCore.Selection.getSVGEventCoordinates(evt),x=_Selection$getSVGEven.x,y=_Selection$getSVGEven.y;if(!_helperMethods2.default.withinBounds({x:x,y:y},fullDomainBox,handleWidth)){return{};}var domainBox=_helperMethods2.default.getDomainBox(targetProps,domain,currentDomain);var activeHandles=_helperMethods2.default.getActiveHandles({x:x,y:y},targetProps,domainBox);if(activeHandles){return[{target:"parent",mutation:function mutation(){return _extends({isSelecting:true,domainBox:domainBox,fullDomainBox:fullDomainBox,cachedSelectedDomain:selectedDomain,currentDomain:currentDomain},_helperMethods2.default.getResizeMutation(domainBox,activeHandles));}}];}else if(_helperMethods2.default.withinBounds({x:x,y:y},domainBox)&&!(0,_isEqual3.default)(domain,currentDomain)){return[{target:"parent",mutation:function mutation(){return{isPanning:true,startX:x,startY:y,domainBox:domainBox,fullDomainBox:fullDomainBox,currentDomain:currentDomain,cachedSelectedDomain:selectedDomain};}}];}else{var minimumDomain=_helperMethods2.default.getMinimumDomain();if((0,_isFunction3.default)(onDomainChange)){onDomainChange(minimumDomain);}return[{target:"parent",mutation:function mutation(){return _extends({isSelecting:true,domainBox:domainBox,fullDomainBox:fullDomainBox,cachedSelectedDomain:selectedDomain,currentDomain:_helperMethods2.default.getMinimumDomain()},_helperMethods2.default.getSelectionMutation({x:x,y:y},domainBox,dimension));}}];}},onMouseMove:function onMouseMove(evt,targetProps){if(!targetProps.isPanning&&!targetProps.isSelecting){return{};}var dimension=targetProps.dimension,scale=targetProps.scale,isPanning=targetProps.isPanning,isSelecting=targetProps.isSelecting,fullDomainBox=targetProps.fullDomainBox,onDomainChange=targetProps.onDomainChange;var _Selection$getSVGEven2=_victoryCore.Selection.getSVGEventCoordinates(evt),x=_Selection$getSVGEven2.x,y=_Selection$getSVGEven2.y;if(!_helperMethods2.default.withinBounds({x:x,y:y},fullDomainBox)){return{};}if(isPanning){var _ret=function(){var startX=targetProps.startX,startY=targetProps.startY;var pannedBox=_helperMethods2.default.panBox(targetProps,{x:x,y:y});var constrainedBox=_helperMethods2.default.constrainBox(pannedBox,fullDomainBox);var currentDomain=_victoryCore.Selection.getBounds(_extends({},constrainedBox,{scale:scale}));if((0,_isFunction3.default)(onDomainChange)){onDomainChange(currentDomain);}return{v:[{target:"parent",mutation:function mutation(){return _extends({currentDomain:currentDomain,startX:pannedBox.x2>=fullDomainBox.x2||pannedBox.x1<=fullDomainBox.x1?startX:x,startY:pannedBox.y2>=fullDomainBox.y2||pannedBox.y1<=fullDomainBox.y1?startY:y},constrainedBox);}}]};}();if(typeof _ret==="object")return _ret.v;}else if(isSelecting){var _ret2=function(){var x2=dimension!=="y"?x:targetProps.x2;var y2=dimension!=="x"?y:targetProps.y2;var currentDomain=_victoryCore.Selection.getBounds({x2:x2,y2:y2,x1:targetProps.x1,y1:targetProps.y1,scale:scale});if((0,_isFunction3.default)(onDomainChange)){onDomainChange(currentDomain);}return{v:[{target:"parent",mutation:function mutation(){return{x2:x2,y2:y2,currentDomain:currentDomain};}}]};}();if(typeof _ret2==="object")return _ret2.v;}},onMouseUp:function onMouseUp(evt,targetProps){var x1=targetProps.x1,y1=targetProps.y1,x2=targetProps.x2,y2=targetProps.y2,domain=targetProps.domain,onDomainChange=targetProps.onDomainChange;if(x1===x2||y1===y2){if((0,_isFunction3.default)(onDomainChange)){onDomainChange(domain);}return[{target:"parent",mutation:function mutation(){return{isPanning:false,isSelecting:false,currentDomain:domain};}}];}return[{target:"parent",mutation:function mutation(){return{isPanning:false,isSelecting:false};}}];},onMouseLeave:function onMouseLeave(){return[{target:"parent",mutation:function mutation(){return{isPanning:false,isSelecting:false};}}];}}}];exports.default=VictoryBrushContainer;
{
"name": "victory-chart",
"version": "16.0.0",
"version": "16.0.1",
"description": "Chart Component for Victory",

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

@@ -80,3 +80,3 @@ import { Selection, Collection } from "victory-core";

fullDomain = fullDomain || domain || this.getOriginalDomain(props);
selectedDomain = selectedDomain || props.selectedDomain || fullDomain;
selectedDomain = selectedDomain || fullDomain;
const fullCoordinates = Selection.getDomainCoordinates(scale, fullDomain);

@@ -83,0 +83,0 @@ const selectedCoordinates = Selection.getDomainCoordinates(scale, selectedDomain);

@@ -167,3 +167,3 @@ import React from "react";

return {
isPanning: false, isSelecting: false, selectedDomain: domain
isPanning: false, isSelecting: false, currentDomain: domain
};

@@ -170,0 +170,0 @@ }

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