victory-chart
Advanced tools
Comparing version 18.1.3 to 18.1.4
# VictoryChart Changelog | ||
## 18.1.4 (2017-03-21) | ||
- [447](https://github.com/FormidableLabs/victory-chart/pull/447) Improves performance for container components | ||
- Fixes [#511](https://github.com/FormidableLabs/victory/issues/511) | ||
- Fixes [#526](https://github.com/FormidableLabs/victory/issues/526) | ||
## 18.1.3 (2017-03-15) | ||
@@ -4,0 +10,0 @@ |
@@ -1,5 +0,5 @@ | ||
Object.defineProperty(exports,"__esModule",{value:true});var _defaults2=require("lodash/defaults");var _defaults3=_interopRequireDefault(_defaults2);var _isEqual2=require("lodash/isEqual");var _isEqual3=_interopRequireDefault(_isEqual2);var _isFunction2=require("lodash/isFunction");var _isFunction3=_interopRequireDefault(_isFunction2);var _throttle2=require("lodash/throttle");var _throttle3=_interopRequireDefault(_throttle2);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 _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);}} | ||
Object.defineProperty(exports,"__esModule",{value:true});var _defaults2=require("lodash/defaults");var _defaults3=_interopRequireDefault(_defaults2);var _isEqual2=require("lodash/isEqual");var _isEqual3=_interopRequireDefault(_isEqual2);var _isFunction2=require("lodash/isFunction");var _isFunction3=_interopRequireDefault(_isFunction2);var _throttle2=require("lodash/throttle");var _throttle3=_interopRequireDefault(_throttle2);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 _victoryCore=require("victory-core"); | ||
var _eventHandlers=require("../../helpers/event-handlers.js");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);}} | ||
var Helpers={ | ||
@@ -263,2 +263,5 @@ withinBounds:function withinBounds(point,bounds,padding){var | ||
onMouseLeave:Helpers.onMouseLeave.bind(Helpers), | ||
onMouseMove:(0,_throttle3.default)(Helpers.onMouseMove.bind(Helpers),16,{leading:true})}; | ||
onMouseMove:(0,_throttle3.default)( | ||
(0,_eventHandlers.attachId)(Helpers.onMouseMove.bind(Helpers)), | ||
16, | ||
{leading:true,trailing:false})}; |
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 _assign2=require("lodash/assign");var _assign3=_interopRequireDefault(_assign2);var _victoryCore=require("victory-core"); | ||
var _react=require("react");var _react2=_interopRequireDefault(_react);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj};} | ||
var _react=require("react");var _react2=_interopRequireDefault(_react); | ||
var _eventHandlers=require("../../helpers/event-handlers.js");function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj};} | ||
@@ -147,2 +148,5 @@ var SelectionHelpers={ | ||
onMouseUp:SelectionHelpers.onMouseUp.bind(SelectionHelpers), | ||
onMouseMove:(0,_throttle3.default)(SelectionHelpers.onMouseMove.bind(SelectionHelpers),16,{leading:true})}; | ||
onMouseMove:(0,_throttle3.default)( | ||
(0,_eventHandlers.attachId)(SelectionHelpers.onMouseMove.bind(SelectionHelpers)), | ||
16, | ||
{leading:true,trailing:false})}; |
@@ -1,2 +0,2 @@ | ||
Object.defineProperty(exports,"__esModule",{value:true});var _isEqual2=require("lodash/isEqual");var _isEqual3=_interopRequireDefault(_isEqual2);var _defaults2=require("lodash/defaults");var _defaults3=_interopRequireDefault(_defaults2);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); | ||
Object.defineProperty(exports,"__esModule",{value:true});var _isEqual2=require("lodash/isEqual");var _isEqual3=_interopRequireDefault(_isEqual2);var _defaults2=require("lodash/defaults");var _defaults3=_interopRequireDefault(_defaults2);var _assign2=require("lodash/assign");var _assign3=_interopRequireDefault(_assign2);var _this2=this;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); | ||
var _victoryCore=require("victory-core"); | ||
@@ -61,2 +61,3 @@ var _brushHelpers=require("./brush-helpers");var _brushHelpers2=_interopRequireDefault(_brushHelpers);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);}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}function _possibleConstructorReturn(self,call){if(!self){throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}return call&&(typeof call==="object"||typeof call==="function")?call:self;}function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:false,writable:true,configurable:true}});if(superClass)Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass;}var | ||
props,coordinates){var | ||
@@ -125,2 +126,2 @@ x=coordinates.x,y=coordinates.y;var | ||
}); | ||
}}]);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"},handleWidth:8,selectionComponent:_react2.default.createElement("rect",null),handleComponent:_react2.default.createElement("rect",null)});VictoryBrushContainer.defaultEvents=[{target:"parent",eventHandlers:{onMouseDown:function onMouseDown(evt,targetProps){_brushHelpers2.default.onMouseMove.cancel();return _brushHelpers2.default.onMouseDown(evt,targetProps);},onMouseMove:function onMouseMove(evt,targetProps){evt.persist();return _brushHelpers2.default.onMouseMove(evt,targetProps);},onMouseUp:function onMouseUp(evt,targetProps){_brushHelpers2.default.onMouseMove.cancel();return _brushHelpers2.default.onMouseUp(evt,targetProps);},onMouseLeave:function onMouseLeave(evt,targetProps){_brushHelpers2.default.onMouseMove.cancel();return _brushHelpers2.default.onMouseLeave(evt,targetProps);}}}];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"},handleWidth:8,selectionComponent:_react2.default.createElement("rect",null),handleComponent:_react2.default.createElement("rect",null)});VictoryBrushContainer.defaultEvents=[{target:"parent",eventHandlers:{onMouseDown:function onMouseDown(evt,targetProps){return _brushHelpers2.default.onMouseDown(evt,targetProps);},onMouseMove:function onMouseMove(evt,targetProps){var mutations=_brushHelpers2.default.onMouseMove(evt,targetProps);if(mutations.id!==_this2.mouseMoveMutationId){_this2.mouseMoveMutationId=mutations.id;return mutations.mutations;}},onMouseUp:function onMouseUp(evt,targetProps){return _brushHelpers2.default.onMouseUp(evt,targetProps);},onMouseLeave:function onMouseLeave(evt,targetProps){return _brushHelpers2.default.onMouseLeave(evt,targetProps);}}}];exports.default=VictoryBrushContainer; |
@@ -1,2 +0,2 @@ | ||
Object.defineProperty(exports,"__esModule",{value:true});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); | ||
Object.defineProperty(exports,"__esModule",{value:true});var _this2=this;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); | ||
var _victoryCore=require("victory-core"); | ||
@@ -45,2 +45,4 @@ var _selectionHelpers=require("./selection-helpers");var _selectionHelpers2=_interopRequireDefault(_selectionHelpers);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);}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}function _possibleConstructorReturn(self,call){if(!self){throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}return call&&(typeof call==="object"||typeof call==="function")?call:self;}function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:false,writable:true,configurable:true}});if(superClass)Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass;}var | ||
props){var | ||
@@ -62,2 +64,2 @@ x1=props.x1,x2=props.x2,y1=props.y1,y2=props.y2,selectionStyle=props.selectionStyle,selectionComponent=props.selectionComponent; | ||
}); | ||
}}]);return VictorySelectionContainer;}(_victoryCore.VictoryContainer);VictorySelectionContainer.displayName="VictorySelectionContainer";VictorySelectionContainer.propTypes=_extends({},_victoryCore.VictoryContainer.propTypes,{selectionStyle:_react2.default.PropTypes.object,onSelection:_react2.default.PropTypes.func,onSelectionCleared:_react2.default.PropTypes.func,dimension:_react2.default.PropTypes.oneOf(["x","y"]),standalone:_react2.default.PropTypes.bool,selectionComponent:_react2.default.PropTypes.element});VictorySelectionContainer.defaultProps=_extends({},_victoryCore.VictoryContainer.defaultProps,{selectionStyle:{stroke:"transparent",fill:"black",fillOpacity:0.1},standalone:true,selectionComponent:_react2.default.createElement("rect",null)});VictorySelectionContainer.defaultEvents=[{target:"parent",eventHandlers:{onMouseDown:function onMouseDown(evt,targetProps){_selectionHelpers2.default.onMouseMove.cancel();return _selectionHelpers2.default.onMouseDown(evt,targetProps);},onMouseMove:function onMouseMove(evt,targetProps){evt.persist();return _selectionHelpers2.default.onMouseMove(evt,targetProps);},onMouseUp:function onMouseUp(evt,targetProps){_selectionHelpers2.default.onMouseMove.cancel();return _selectionHelpers2.default.onMouseUp(evt,targetProps);}}}];exports.default=VictorySelectionContainer; | ||
}}]);return VictorySelectionContainer;}(_victoryCore.VictoryContainer);VictorySelectionContainer.displayName="VictorySelectionContainer";VictorySelectionContainer.propTypes=_extends({},_victoryCore.VictoryContainer.propTypes,{selectionStyle:_react2.default.PropTypes.object,onSelection:_react2.default.PropTypes.func,onSelectionCleared:_react2.default.PropTypes.func,dimension:_react2.default.PropTypes.oneOf(["x","y"]),standalone:_react2.default.PropTypes.bool,selectionComponent:_react2.default.PropTypes.element});VictorySelectionContainer.defaultProps=_extends({},_victoryCore.VictoryContainer.defaultProps,{selectionStyle:{stroke:"transparent",fill:"black",fillOpacity:0.1},standalone:true,selectionComponent:_react2.default.createElement("rect",null)});VictorySelectionContainer.defaultEvents=[{target:"parent",eventHandlers:{onMouseDown:function onMouseDown(evt,targetProps){return _selectionHelpers2.default.onMouseDown(evt,targetProps);},onMouseMove:function onMouseMove(evt,targetProps){var mutations=_selectionHelpers2.default.onMouseMove(evt,targetProps);if(mutations.id!==_this2.mouseMoveMutationId){_this2.mouseMoveMutationId=mutations.id;return mutations.mutations;}},onMouseUp:function onMouseUp(evt,targetProps){return _selectionHelpers2.default.onMouseUp(evt,targetProps);}}}];exports.default=VictorySelectionContainer; |
@@ -1,2 +0,2 @@ | ||
Object.defineProperty(exports,"__esModule",{value:true});var _defaults2=require("lodash/defaults");var _defaults3=_interopRequireDefault(_defaults2);var _omit2=require("lodash/omit");var _omit3=_interopRequireDefault(_omit2);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); | ||
Object.defineProperty(exports,"__esModule",{value:true});var _defaults2=require("lodash/defaults");var _defaults3=_interopRequireDefault(_defaults2);var _omit2=require("lodash/omit");var _omit3=_interopRequireDefault(_omit2);var _this2=this;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); | ||
var _victoryCore=require("victory-core"); | ||
@@ -50,2 +50,3 @@ var _voronoiHelpers=require("./voronoi-helpers");var _voronoiHelpers2=_interopRequireDefault(_voronoiHelpers);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);}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}function _possibleConstructorReturn(self,call){if(!self){throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}return call&&(typeof call==="object"||typeof call==="function")?call:self;}function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:false,writable:true,configurable:true}});if(superClass)Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass;}var | ||
style){ | ||
@@ -174,2 +175,2 @@ if(!style){ | ||
}); | ||
}}]);return VictoryVoronoiContainer;}(_victoryCore.VictoryContainer);VictoryVoronoiContainer.displayName="VictoryVoronoiContainer";VictoryVoronoiContainer.propTypes=_extends({},_victoryCore.VictoryContainer.propTypes,{onActivated:_react2.default.PropTypes.func,onDeactivated:_react2.default.PropTypes.func,standalone:_react2.default.PropTypes.bool,radius:_react2.default.PropTypes.number,voronoiPadding:_react2.default.PropTypes.number,labelComponent:_react2.default.PropTypes.element,labels:_react2.default.PropTypes.func,dimension:_react2.default.PropTypes.oneOf(["x","y"])});VictoryVoronoiContainer.defaultProps=_extends({},_victoryCore.VictoryContainer.defaultProps,{standalone:true,labelComponent:_react2.default.createElement(_victoryCore.VictoryTooltip,null),voronoiPadding:5});VictoryVoronoiContainer.role="voronoi";VictoryVoronoiContainer.defaultEvents=[{target:"parent",eventHandlers:{onMouseLeave:function onMouseLeave(evt,targetProps){_voronoiHelpers2.default.onMouseMove.cancel();return _voronoiHelpers2.default.onMouseLeave(evt,targetProps);},onMouseMove:function onMouseMove(evt,targetProps){evt.persist();return _voronoiHelpers2.default.onMouseMove(evt,targetProps);}}},{target:"data",eventHandlers:{onMouseOver:function onMouseOver(){return null;},onMouseOut:function onMouseOut(){return null;},onMouseMove:function onMouseMove(){return null;}}}];exports.default=VictoryVoronoiContainer; | ||
}}]);return VictoryVoronoiContainer;}(_victoryCore.VictoryContainer);VictoryVoronoiContainer.displayName="VictoryVoronoiContainer";VictoryVoronoiContainer.propTypes=_extends({},_victoryCore.VictoryContainer.propTypes,{onActivated:_react2.default.PropTypes.func,onDeactivated:_react2.default.PropTypes.func,standalone:_react2.default.PropTypes.bool,radius:_react2.default.PropTypes.number,voronoiPadding:_react2.default.PropTypes.number,labelComponent:_react2.default.PropTypes.element,labels:_react2.default.PropTypes.func,dimension:_react2.default.PropTypes.oneOf(["x","y"])});VictoryVoronoiContainer.defaultProps=_extends({},_victoryCore.VictoryContainer.defaultProps,{standalone:true,labelComponent:_react2.default.createElement(_victoryCore.VictoryTooltip,null),voronoiPadding:5});VictoryVoronoiContainer.defaultEvents=[{target:"parent",eventHandlers:{onMouseLeave:function onMouseLeave(evt,targetProps){return _voronoiHelpers2.default.onMouseLeave(evt,targetProps);},onMouseMove:function onMouseMove(evt,targetProps){var mutations=_voronoiHelpers2.default.onMouseMove(evt,targetProps);if(mutations.id!==_this2.mouseMoveMutationId){_this2.mouseMoveMutationId=mutations.id;return mutations.mutations;}}}},{target:"data",eventHandlers:{onMouseOver:function onMouseOver(){return null;},onMouseOut:function onMouseOut(){return null;},onMouseMove:function onMouseMove(){return null;}}}];exports.default=VictoryVoronoiContainer; |
@@ -1,2 +0,2 @@ | ||
Object.defineProperty(exports,"__esModule",{value:true});var _isEqual2=require("lodash/isEqual");var _isEqual3=_interopRequireDefault(_isEqual2);var _defaults2=require("lodash/defaults");var _defaults3=_interopRequireDefault(_defaults2);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); | ||
Object.defineProperty(exports,"__esModule",{value:true});var _isEqual2=require("lodash/isEqual");var _isEqual3=_interopRequireDefault(_isEqual2);var _defaults2=require("lodash/defaults");var _defaults3=_interopRequireDefault(_defaults2);var _this2=this;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); | ||
@@ -129,2 +129,2 @@ var _zoomHelpers=require("./zoom-helpers");var _zoomHelpers2=_interopRequireDefault(_zoomHelpers); | ||
return this.clipDataComponents(children,props); | ||
}}]);return VictoryZoomContainer;}(_victoryCore.VictoryContainer);VictoryZoomContainer.displayName="VictoryZoomContainer";VictoryZoomContainer.propTypes=_extends({},_victoryCore.VictoryContainer.propTypes,{zoomDomain:_react.PropTypes.shape({x:_victoryCore.PropTypes.domain,y:_victoryCore.PropTypes.domain}),minimumZoom:_react.PropTypes.shape({x:_react.PropTypes.number,y:_react.PropTypes.number}),onDomainChange:_react.PropTypes.func,clipContainerComponent:_react.PropTypes.element.isRequired,allowZoom:_react.PropTypes.bool,dimension:_react.PropTypes.oneOf(["x","y"])});VictoryZoomContainer.defaultProps=_extends({},_victoryCore.VictoryContainer.defaultProps,{clipContainerComponent:_react2.default.createElement(_victoryCore.VictoryClipContainer,null),allowZoom:true});VictoryZoomContainer.defaultEvents=[{target:"parent",eventHandlers:{onMouseDown:function onMouseDown(evt,targetProps){_zoomHelpers2.default.onMouseMove.cancel();_zoomHelpers2.default.onWheel.cancel();return _zoomHelpers2.default.onMouseDown(evt,targetProps);},onMouseUp:function onMouseUp(evt,targetProps){_zoomHelpers2.default.onMouseMove.cancel();_zoomHelpers2.default.onWheel.cancel();return _zoomHelpers2.default.onMouseUp(evt,targetProps);},onMouseLeave:function onMouseLeave(evt,targetProps){_zoomHelpers2.default.onMouseMove.cancel();_zoomHelpers2.default.onWheel.cancel();return _zoomHelpers2.default.onMouseLeave(evt,targetProps);},onMouseMove:function onMouseMove(evt,targetProps,eventKey,ctx){evt.preventDefault();evt.persist();_zoomHelpers2.default.onWheel.cancel();return _zoomHelpers2.default.onMouseMove(evt,targetProps,eventKey,ctx);},onWheel:function onWheel(evt,targetProps,eventKey,ctx){evt.preventDefault();evt.persist();_zoomHelpers2.default.onMouseMove.cancel();return _zoomHelpers2.default.onWheel(evt,targetProps,eventKey,ctx);}}}];exports.default=VictoryZoomContainer; | ||
}}]);return VictoryZoomContainer;}(_victoryCore.VictoryContainer);VictoryZoomContainer.displayName="VictoryZoomContainer";VictoryZoomContainer.propTypes=_extends({},_victoryCore.VictoryContainer.propTypes,{zoomDomain:_react.PropTypes.shape({x:_victoryCore.PropTypes.domain,y:_victoryCore.PropTypes.domain}),minimumZoom:_react.PropTypes.shape({x:_react.PropTypes.number,y:_react.PropTypes.number}),onDomainChange:_react.PropTypes.func,clipContainerComponent:_react.PropTypes.element.isRequired,allowZoom:_react.PropTypes.bool,dimension:_react.PropTypes.oneOf(["x","y"])});VictoryZoomContainer.defaultProps=_extends({},_victoryCore.VictoryContainer.defaultProps,{clipContainerComponent:_react2.default.createElement(_victoryCore.VictoryClipContainer,null),allowZoom:true});VictoryZoomContainer.defaultEvents=[{target:"parent",eventHandlers:{onMouseDown:function onMouseDown(evt,targetProps){return _zoomHelpers2.default.onMouseDown(evt,targetProps);},onMouseUp:function onMouseUp(evt,targetProps){return _zoomHelpers2.default.onMouseUp(evt,targetProps);},onMouseLeave:function onMouseLeave(evt,targetProps){return _zoomHelpers2.default.onMouseLeave(evt,targetProps);},onMouseMove:function onMouseMove(evt,targetProps,eventKey,ctx){evt.preventDefault();var mutations=_zoomHelpers2.default.onMouseMove(evt,targetProps,eventKey,ctx);if(mutations.id!==_this2.mouseMoveMutationId){_this2.mouseMoveMutationId=mutations.id;return mutations.mutations;}},onWheel:function onWheel(evt,targetProps,eventKey,ctx){evt.preventDefault();var mutations=_zoomHelpers2.default.onWheel(evt,targetProps,eventKey,ctx);if(mutations.id!==_this2.wheelMutationId){_this2.wheelMutationId=mutations.id;return mutations.mutations;}}}}];exports.default=VictoryZoomContainer; |
Object.defineProperty(exports,"__esModule",{value:true});var _isEqual2=require("lodash/isEqual");var _isEqual3=_interopRequireDefault(_isEqual2);var _keys2=require("lodash/keys");var _keys3=_interopRequireDefault(_keys2);var _groupBy2=require("lodash/groupBy");var _groupBy3=_interopRequireDefault(_groupBy2);var _isFunction2=require("lodash/isFunction");var _isFunction3=_interopRequireDefault(_isFunction2);var _throttle2=require("lodash/throttle");var _throttle3=_interopRequireDefault(_throttle2);var _assign2=require("lodash/assign");var _assign3=_interopRequireDefault(_assign2);var _victoryCore=require("victory-core"); | ||
var _d3Voronoi=require("d3-voronoi"); | ||
var _react=require("react");var _react2=_interopRequireDefault(_react);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);}} | ||
var _react=require("react");var _react2=_interopRequireDefault(_react); | ||
var _eventHandlers=require("../../helpers/event-handlers.js");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);}} | ||
@@ -163,2 +164,5 @@ var VoronoiHelpers={ | ||
onMouseLeave:VoronoiHelpers.onMouseLeave.bind(VoronoiHelpers), | ||
onMouseMove:(0,_throttle3.default)(VoronoiHelpers.onMouseMove.bind(VoronoiHelpers),16,{leading:true})}; | ||
onMouseMove:(0,_throttle3.default)( | ||
(0,_eventHandlers.attachId)(VoronoiHelpers.onMouseMove.bind(VoronoiHelpers)), | ||
32, | ||
{leading:true,trailing:false})}; |
@@ -1,3 +0,4 @@ | ||
Object.defineProperty(exports,"__esModule",{value:true});var _defaults2=require("lodash/defaults");var _defaults3=_interopRequireDefault(_defaults2);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};} | ||
Object.defineProperty(exports,"__esModule",{value:true});var _defaults2=require("lodash/defaults");var _defaults3=_interopRequireDefault(_defaults2);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"); | ||
var _eventHandlers=require("../../helpers/event-handlers.js");function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj};} | ||
@@ -238,3 +239,10 @@ var Helpers={ | ||
onMouseLeave:Helpers.onMouseLeave.bind(Helpers), | ||
onMouseMove:(0,_throttle3.default)(Helpers.onMouseMove.bind(Helpers),16,{leading:true}), | ||
onWheel:(0,_throttle3.default)(Helpers.onWheel.bind(Helpers),16,{leading:true})}; | ||
onMouseMove:(0,_throttle3.default)( | ||
(0,_eventHandlers.attachId)(Helpers.onMouseMove.bind(Helpers)), | ||
16, | ||
{leading:true,trailing:false}), | ||
onWheel:(0,_throttle3.default)( | ||
(0,_eventHandlers.attachId)(Helpers.onWheel.bind(Helpers)), | ||
16, | ||
{leading:true,trailing:false})}; |
@@ -141,7 +141,8 @@ Object.defineProperty(exports,"__esModule",{value:true});var _without2=require("lodash/without");var _without3=_interopRequireDefault(_without2);var _partialRight2=require("lodash/partialRight");var _partialRight3=_interopRequireDefault(_partialRight2);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 children=[_react2.default.cloneElement(dataComponent,dataProps)].concat(_toConsumableArray(labelComponents)); | ||
return this.renderContainer(groupComponent,children,{}); | ||
return this.renderContainer(groupComponent,children); | ||
}},{key:"renderContainer",value:function renderContainer( | ||
component,children,props){ | ||
var parentProps=props||this.getComponentProps(component,"parent","parent"); | ||
component,children){ | ||
var isContainer=component.type&&component.type.role==="container"; | ||
var parentProps=isContainer?this.getComponentProps(component,"parent","parent"):{}; | ||
return _react2.default.cloneElement(component,parentProps,children); | ||
@@ -148,0 +149,0 @@ }},{key:"shouldAnimate",value:function shouldAnimate() |
@@ -156,3 +156,3 @@ Object.defineProperty(exports,"__esModule",{value:true});var _partialRight2=require("lodash/partialRight");var _partialRight3=_interopRequireDefault(_partialRight2);var _assign2=require("lodash/assign");var _assign3=_interopRequireDefault(_assign2);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); | ||
var size=isVertical?props.height:props.width; | ||
var isVictoryLabel=function isVictoryLabel(child){return child.type.name==="VictoryLabel";}; | ||
var isVictoryLabel=function isVictoryLabel(child){return child.type&&child.type.role==="label";}; | ||
var labels=gridAndTicks.map(function(gridAndTick){return gridAndTick.props.children;}). | ||
@@ -190,4 +190,5 @@ reduce(function(accumulator,childArr){return accumulator.concat(childArr);}). | ||
component,children,props){ | ||
var parentProps=props||this.getComponentProps(component,"parent","parent"); | ||
component,children){ | ||
var isContainer=component.type&&component.type.role==="container"; | ||
var parentProps=isContainer?this.getComponentProps(component,"parent","parent"):{}; | ||
return _react2.default.cloneElement(component,parentProps,children); | ||
@@ -194,0 +195,0 @@ }},{key:"shouldAnimate",value:function shouldAnimate() |
@@ -164,3 +164,3 @@ Object.defineProperty(exports,"__esModule",{value:true});var _partialRight2=require("lodash/partialRight");var _partialRight3=_interopRequireDefault(_partialRight2);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); | ||
var children=[].concat(_toConsumableArray(dataComponents),_toConsumableArray(labelComponents)); | ||
return this.renderContainer(groupComponent,children,{}); | ||
return this.renderContainer(groupComponent,children); | ||
@@ -173,4 +173,5 @@ }},{key:"shouldAnimate",value:function shouldAnimate() | ||
component,children,props){ | ||
var parentProps=props||this.getComponentProps(component,"parent","parent"); | ||
component,children){ | ||
var isContainer=component.type&&component.type.role==="container"; | ||
var parentProps=isContainer?this.getComponentProps(component,"parent","parent"):{}; | ||
return _react2.default.cloneElement(component,parentProps,children); | ||
@@ -177,0 +178,0 @@ }},{key:"render",value:function render() |
@@ -182,3 +182,3 @@ Object.defineProperty(exports,"__esModule",{value:true});var _partialRight2=require("lodash/partialRight");var _partialRight3=_interopRequireDefault(_partialRight2);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); | ||
var children=[].concat(_toConsumableArray(dataComponents),_toConsumableArray(labelComponents)); | ||
return this.renderContainer(groupComponent,children,{}); | ||
return this.renderContainer(groupComponent,children); | ||
}},{key:"shouldAnimate",value:function shouldAnimate() | ||
@@ -190,4 +190,5 @@ | ||
component,children,props){ | ||
var parentProps=props||this.getComponentProps(component,"parent","parent"); | ||
component,children){ | ||
var isContainer=component.type&&component.type.role==="container"; | ||
var parentProps=isContainer?this.getComponentProps(component,"parent","parent"):{}; | ||
return _react2.default.cloneElement(component,parentProps,children); | ||
@@ -194,0 +195,0 @@ }},{key:"render",value:function render() |
@@ -165,3 +165,3 @@ Object.defineProperty(exports,"__esModule",{value:true});var _partialRight2=require("lodash/partialRight");var _partialRight3=_interopRequireDefault(_partialRight2);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); | ||
var children=[].concat(_toConsumableArray(dataComponents),_toConsumableArray(labelComponents)); | ||
return this.renderContainer(groupComponent,children,{}); | ||
return this.renderContainer(groupComponent,children); | ||
}},{key:"shouldAnimate",value:function shouldAnimate() | ||
@@ -173,4 +173,5 @@ | ||
component,children,props){ | ||
var parentProps=props||this.getComponentProps(component,"parent","parent"); | ||
component,children){ | ||
var isContainer=component.type&&component.type.role==="container"; | ||
var parentProps=isContainer?this.getComponentProps(component,"parent","parent"):{}; | ||
return _react2.default.cloneElement(component,parentProps,children); | ||
@@ -177,0 +178,0 @@ }},{key:"render",value:function render() |
@@ -143,3 +143,3 @@ Object.defineProperty(exports,"__esModule",{value:true});var _without2=require("lodash/without");var _without3=_interopRequireDefault(_without2);var _partialRight2=require("lodash/partialRight");var _partialRight3=_interopRequireDefault(_partialRight2);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 children=[_react2.default.cloneElement(dataComponent,dataProps)].concat(_toConsumableArray(labelComponents)); | ||
return this.renderContainer(groupComponent,children,{}); | ||
return this.renderContainer(groupComponent,children); | ||
}},{key:"shouldAnimate",value:function shouldAnimate() | ||
@@ -151,4 +151,5 @@ | ||
component,children,props){ | ||
var parentProps=props||this.getComponentProps(component,"parent","parent"); | ||
component,children){ | ||
var isContainer=component.type&&component.type.role==="container"; | ||
var parentProps=isContainer?this.getComponentProps(component,"parent","parent"):{}; | ||
return _react2.default.cloneElement(component,parentProps,children); | ||
@@ -155,0 +156,0 @@ }},{key:"render",value:function render() |
@@ -152,3 +152,3 @@ Object.defineProperty(exports,"__esModule",{value:true});var _partialRight2=require("lodash/partialRight");var _partialRight3=_interopRequireDefault(_partialRight2);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); | ||
var children=[].concat(_toConsumableArray(dataComponents),_toConsumableArray(labelComponents)); | ||
return this.renderContainer(groupComponent,children,{}); | ||
return this.renderContainer(groupComponent,children); | ||
}},{key:"shouldAnimate",value:function shouldAnimate() | ||
@@ -160,4 +160,5 @@ | ||
component,children,props){ | ||
var parentProps=props||this.getComponentProps(component,"parent","parent"); | ||
component,children){ | ||
var isContainer=component.type&&component.type.role==="container"; | ||
var parentProps=isContainer?this.getComponentProps(component,"parent","parent"):{}; | ||
return _react2.default.cloneElement(component,parentProps,children); | ||
@@ -164,0 +165,0 @@ }},{key:"render",value:function render() |
@@ -148,5 +148,4 @@ Object.defineProperty(exports,"__esModule",{value:true});var _partialRight2=require("lodash/partialRight");var _partialRight3=_interopRequireDefault(_partialRight2);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 labelComponents.length>0? | ||
_react2.default.cloneElement.apply(_react2.default,[groupComponent,{}].concat(_toConsumableArray(dataComponents),_toConsumableArray(labelComponents))): | ||
dataComponents; | ||
var children=[].concat(_toConsumableArray(dataComponents),_toConsumableArray(labelComponents)); | ||
return this.renderContainer(groupComponent,children); | ||
}},{key:"shouldAnimate",value:function shouldAnimate() | ||
@@ -158,6 +157,6 @@ | ||
props,children){var | ||
containerComponent=props.containerComponent; | ||
var parentProps=this.getComponentProps(containerComponent,"parent","parent"); | ||
return _react2.default.cloneElement(containerComponent,parentProps,children); | ||
component,children){ | ||
var isContainer=component.type&&component.type.role==="container"; | ||
var parentProps=isContainer?this.getComponentProps(component,"parent","parent"):{}; | ||
return _react2.default.cloneElement(component,parentProps,children); | ||
}},{key:"render",value:function render() | ||
@@ -176,3 +175,3 @@ | ||
var children=this.renderData(props); | ||
return this.renderContainer(props,children); | ||
return this.renderContainer(props.containerComponent,children); | ||
}}]);return VictoryVoronoi;}(_react2.default.Component);VictoryVoronoi.displayName="VictoryVoronoi";VictoryVoronoi.role="voronoi";VictoryVoronoi.defaultTransitions=_victoryCore.DefaultTransitions.discreteTransitions();VictoryVoronoi.propTypes={animate:_react.PropTypes.object,categories:_react.PropTypes.oneOfType([_react.PropTypes.arrayOf(_react.PropTypes.string),_react.PropTypes.shape({x:_react.PropTypes.arrayOf(_react.PropTypes.string),y:_react.PropTypes.arrayOf(_react.PropTypes.string)})]),containerComponent:_react.PropTypes.element,data:_react.PropTypes.array,domainPadding:_react.PropTypes.oneOfType([_react.PropTypes.shape({x:_react.PropTypes.oneOfType([_react.PropTypes.number,_victoryCore.PropTypes.domain]),y:_react.PropTypes.oneOfType([_react.PropTypes.number,_victoryCore.PropTypes.domain])}),_react.PropTypes.number]),dataComponent:_react.PropTypes.element,domain:_react.PropTypes.oneOfType([_victoryCore.PropTypes.domain,_react.PropTypes.shape({x:_victoryCore.PropTypes.domain,y:_victoryCore.PropTypes.domain})]),events:_react.PropTypes.arrayOf(_react.PropTypes.shape({target:_react.PropTypes.oneOf(["data","labels","parent"]),eventKey:_react.PropTypes.oneOfType([_react.PropTypes.array,_victoryCore.PropTypes.allOfType([_victoryCore.PropTypes.integer,_victoryCore.PropTypes.nonNegative]),_react.PropTypes.string]),eventHandlers:_react.PropTypes.object})),eventKey:_react.PropTypes.oneOfType([_react.PropTypes.func,_victoryCore.PropTypes.allOfType([_victoryCore.PropTypes.integer,_victoryCore.PropTypes.nonNegative]),_react.PropTypes.string]),groupComponent:_react.PropTypes.element,height:_victoryCore.PropTypes.nonNegative,labels:_react.PropTypes.oneOfType([_react.PropTypes.func,_react.PropTypes.array]),labelComponent:_react.PropTypes.element,name:_react.PropTypes.string,padding:_react.PropTypes.oneOfType([_react.PropTypes.number,_react.PropTypes.shape({top:_react.PropTypes.number,bottom:_react.PropTypes.number,left:_react.PropTypes.number,right:_react.PropTypes.number})]),samples:_victoryCore.PropTypes.nonNegative,scale:_react.PropTypes.oneOfType([_victoryCore.PropTypes.scale,_react.PropTypes.shape({x:_victoryCore.PropTypes.scale,y:_victoryCore.PropTypes.scale})]),sharedEvents:_react.PropTypes.shape({events:_react.PropTypes.array,getEventState:_react.PropTypes.func}),sortKey:_react.PropTypes.oneOfType([_react.PropTypes.func,_victoryCore.PropTypes.allOfType([_victoryCore.PropTypes.integer,_victoryCore.PropTypes.nonNegative]),_react.PropTypes.string,_react.PropTypes.arrayOf(_react.PropTypes.string)]),size:_victoryCore.PropTypes.nonNegative,standalone:_react.PropTypes.bool,style:_react.PropTypes.shape({parent:_react.PropTypes.object,data:_react.PropTypes.object,labels:_react.PropTypes.object}),theme:_react.PropTypes.object,width:_victoryCore.PropTypes.nonNegative,x:_react.PropTypes.oneOfType([_react.PropTypes.func,_victoryCore.PropTypes.allOfType([_victoryCore.PropTypes.integer,_victoryCore.PropTypes.nonNegative]),_react.PropTypes.string,_react.PropTypes.arrayOf(_react.PropTypes.string)]),y:_react.PropTypes.oneOfType([_react.PropTypes.func,_victoryCore.PropTypes.allOfType([_victoryCore.PropTypes.integer,_victoryCore.PropTypes.nonNegative]),_react.PropTypes.string,_react.PropTypes.arrayOf(_react.PropTypes.string)])};VictoryVoronoi.defaultProps={samples:50,scale:"linear",standalone:true,dataComponent:_react2.default.createElement(_victoryCore.Voronoi,null),labelComponent:_react2.default.createElement(_victoryCore.VictoryLabel,null),containerComponent:_react2.default.createElement(_victoryCore.VictoryContainer,null),groupComponent:_react2.default.createElement("g",{role:"presentation"}),theme:_victoryCore.VictoryTheme.grayscale};VictoryVoronoi.getDomain=_victoryCore.Domain.getDomain.bind(_victoryCore.Domain);VictoryVoronoi.getData=_victoryCore.Data.getData.bind(_victoryCore.Data);VictoryVoronoi.getBaseProps=(0,_partialRight3.default)(_helperMethods2.default.getBaseProps.bind(_helperMethods2.default),fallbackProps);VictoryVoronoi.expectedComponents=["dataComponent","labelComponent","groupComponent","containerComponent"];exports.default= | ||
@@ -179,0 +178,0 @@ |
{ | ||
"name": "victory-chart", | ||
"version": "18.1.3", | ||
"version": "18.1.4", | ||
"description": "Chart Component for Victory", | ||
@@ -30,5 +30,5 @@ "main": "lib/index.js", | ||
"dependencies": { | ||
"d3-voronoi": "^1.0.0", | ||
"d3-voronoi": "^1.1.2", | ||
"lodash": "^4.12.0", | ||
"victory-core": "^14.0.3" | ||
"victory-core": "^14.0.7" | ||
}, | ||
@@ -35,0 +35,0 @@ "devDependencies": { |
import { Selection} from "victory-core"; | ||
import { assign, throttle, isFunction, isEqual, defaults } from "lodash"; | ||
import { attachId } from "../../helpers/event-handlers.js"; | ||
const Helpers = { | ||
@@ -263,3 +263,7 @@ withinBounds(point, bounds, padding) { | ||
onMouseLeave: Helpers.onMouseLeave.bind(Helpers), | ||
onMouseMove: throttle(Helpers.onMouseMove.bind(Helpers), 16, {leading: true}) | ||
onMouseMove: throttle( | ||
attachId(Helpers.onMouseMove.bind(Helpers)), | ||
16, | ||
{leading: true, trailing: false} | ||
) | ||
}; |
import { Selection, Data, Helpers } from "victory-core"; | ||
import { assign, throttle, isFunction } from "lodash"; | ||
import React from "react"; | ||
import { attachId } from "../../helpers/event-handlers.js"; | ||
@@ -147,3 +148,6 @@ const SelectionHelpers = { | ||
onMouseUp: SelectionHelpers.onMouseUp.bind(SelectionHelpers), | ||
onMouseMove: throttle(SelectionHelpers.onMouseMove.bind(SelectionHelpers), 16, {leading: true}) | ||
onMouseMove: throttle( | ||
attachId(SelectionHelpers.onMouseMove.bind(SelectionHelpers)), | ||
16, | ||
{leading: true, trailing: false}) | ||
}; |
@@ -43,15 +43,16 @@ import React from "react"; | ||
onMouseDown: (evt, targetProps) => { | ||
BrushHelpers.onMouseMove.cancel(); | ||
return BrushHelpers.onMouseDown(evt, targetProps); | ||
}, | ||
onMouseMove: (evt, targetProps) => { | ||
evt.persist(); | ||
return BrushHelpers.onMouseMove(evt, targetProps); | ||
const mutations = BrushHelpers.onMouseMove(evt, targetProps); | ||
if (mutations.id !== this.mouseMoveMutationId) { // eslint-disable-line | ||
this.mouseMoveMutationId = mutations.id; // eslint-disable-line | ||
return mutations.mutations; | ||
} | ||
}, | ||
onMouseUp: (evt, targetProps) => { | ||
BrushHelpers.onMouseMove.cancel(); | ||
return BrushHelpers.onMouseUp(evt, targetProps); | ||
}, | ||
onMouseLeave: (evt, targetProps) => { | ||
BrushHelpers.onMouseMove.cancel(); | ||
return BrushHelpers.onMouseLeave(evt, targetProps); | ||
@@ -58,0 +59,0 @@ } |
@@ -31,11 +31,13 @@ import React from "react"; | ||
onMouseDown: (evt, targetProps) => { | ||
SelectionHelpers.onMouseMove.cancel(); | ||
return SelectionHelpers.onMouseDown(evt, targetProps); | ||
}, | ||
onMouseMove: (evt, targetProps) => { | ||
evt.persist(); | ||
return SelectionHelpers.onMouseMove(evt, targetProps); | ||
const mutations = SelectionHelpers.onMouseMove(evt, targetProps); | ||
if (mutations.id !== this.mouseMoveMutationId) { // eslint-disable-line | ||
this.mouseMoveMutationId = mutations.id; // eslint-disable-line | ||
return mutations.mutations; | ||
} | ||
}, | ||
onMouseUp: (evt, targetProps) => { | ||
SelectionHelpers.onMouseMove.cancel(); | ||
return SelectionHelpers.onMouseUp(evt, targetProps); | ||
@@ -42,0 +44,0 @@ } |
@@ -27,4 +27,2 @@ import React from "react"; | ||
static role = "voronoi"; | ||
static defaultEvents = [{ | ||
@@ -34,8 +32,11 @@ target: "parent", | ||
onMouseLeave: (evt, targetProps) => { | ||
VoronoiHelpers.onMouseMove.cancel(); | ||
return VoronoiHelpers.onMouseLeave(evt, targetProps); | ||
}, | ||
onMouseMove: (evt, targetProps) => { | ||
evt.persist(); | ||
return VoronoiHelpers.onMouseMove(evt, targetProps); | ||
const mutations = VoronoiHelpers.onMouseMove(evt, targetProps); | ||
if (mutations.id !== this.mouseMoveMutationId) { // eslint-disable-line | ||
this.mouseMoveMutationId = mutations.id; // eslint-disable-line | ||
return mutations.mutations; | ||
} | ||
} | ||
@@ -42,0 +43,0 @@ } |
@@ -33,14 +33,8 @@ import React, {PropTypes} from "react"; | ||
onMouseDown: (evt, targetProps) => { | ||
ZoomHelpers.onMouseMove.cancel(); | ||
ZoomHelpers.onWheel.cancel(); | ||
return ZoomHelpers.onMouseDown(evt, targetProps); | ||
}, | ||
onMouseUp: (evt, targetProps) => { | ||
ZoomHelpers.onMouseMove.cancel(); | ||
ZoomHelpers.onWheel.cancel(); | ||
return ZoomHelpers.onMouseUp(evt, targetProps); | ||
}, | ||
onMouseLeave: (evt, targetProps) => { | ||
ZoomHelpers.onMouseMove.cancel(); | ||
ZoomHelpers.onWheel.cancel(); | ||
return ZoomHelpers.onMouseLeave(evt, targetProps); | ||
@@ -50,11 +44,17 @@ }, | ||
evt.preventDefault(); | ||
evt.persist(); | ||
ZoomHelpers.onWheel.cancel(); | ||
return ZoomHelpers.onMouseMove(evt, targetProps, eventKey, ctx); | ||
const mutations = ZoomHelpers.onMouseMove(evt, targetProps, eventKey, ctx); | ||
if (mutations.id !== this.mouseMoveMutationId) { // eslint-disable-line | ||
this.mouseMoveMutationId = mutations.id; // eslint-disable-line | ||
return mutations.mutations; | ||
} | ||
}, | ||
onWheel: (evt, targetProps, eventKey, ctx) => { // eslint-disable-line max-params | ||
evt.preventDefault(); | ||
evt.persist(); | ||
ZoomHelpers.onMouseMove.cancel(); | ||
return ZoomHelpers.onWheel(evt, targetProps, eventKey, ctx); | ||
const mutations = ZoomHelpers.onWheel(evt, targetProps, eventKey, ctx); | ||
if (mutations.id !== this.wheelMutationId) { // eslint-disable-line | ||
this.wheelMutationId = mutations.id; // eslint-disable-line | ||
return mutations.mutations; | ||
} | ||
} | ||
@@ -61,0 +61,0 @@ } |
@@ -5,2 +5,3 @@ import { Selection, Data, Helpers } from "victory-core"; | ||
import React from "react"; | ||
import { attachId } from "../../helpers/event-handlers.js"; | ||
@@ -164,3 +165,6 @@ const VoronoiHelpers = { | ||
onMouseLeave: VoronoiHelpers.onMouseLeave.bind(VoronoiHelpers), | ||
onMouseMove: throttle(VoronoiHelpers.onMouseMove.bind(VoronoiHelpers), 16, {leading: true}) | ||
onMouseMove: throttle( | ||
attachId(VoronoiHelpers.onMouseMove.bind(VoronoiHelpers)), | ||
32, | ||
{leading: true, trailing: false}) | ||
}; |
import { Selection, Collection } from "victory-core"; | ||
import { throttle, isFunction, defaults } from "lodash"; | ||
import { attachId } from "../../helpers/event-handlers.js"; | ||
@@ -238,4 +239,12 @@ const Helpers = { | ||
onMouseLeave: Helpers.onMouseLeave.bind(Helpers), | ||
onMouseMove: throttle(Helpers.onMouseMove.bind(Helpers), 16, {leading: true}), | ||
onWheel: throttle(Helpers.onWheel.bind(Helpers), 16, {leading: true}) | ||
onMouseMove: throttle( | ||
attachId(Helpers.onMouseMove.bind(Helpers)), | ||
16, | ||
{leading: true, trailing: false} | ||
), | ||
onWheel: throttle( | ||
attachId(Helpers.onWheel.bind(Helpers)), | ||
16, | ||
{leading: true, trailing: false} | ||
) | ||
}; |
@@ -141,7 +141,8 @@ import { partialRight, without } from "lodash"; | ||
const children = [React.cloneElement(dataComponent, dataProps), ...labelComponents]; | ||
return this.renderContainer(groupComponent, children, {}); | ||
return this.renderContainer(groupComponent, children); | ||
} | ||
renderContainer(component, children, props) { | ||
const parentProps = props || this.getComponentProps(component, "parent", "parent"); | ||
renderContainer(component, children) { | ||
const isContainer = component.type && component.type.role === "container"; | ||
const parentProps = isContainer ? this.getComponentProps(component, "parent", "parent") : {}; | ||
return React.cloneElement(component, parentProps, children); | ||
@@ -148,0 +149,0 @@ } |
@@ -156,3 +156,3 @@ import React, { PropTypes } from "react"; | ||
const size = isVertical ? props.height : props.width; | ||
const isVictoryLabel = (child) => child.type.name === "VictoryLabel"; | ||
const isVictoryLabel = (child) => child.type && child.type.role === "label"; | ||
const labels = gridAndTicks.map((gridAndTick) => gridAndTick.props.children) | ||
@@ -190,4 +190,5 @@ .reduce((accumulator, childArr) => accumulator.concat(childArr)) | ||
renderContainer(component, children, props) { | ||
const parentProps = props || this.getComponentProps(component, "parent", "parent"); | ||
renderContainer(component, children) { | ||
const isContainer = component.type && component.type.role === "container"; | ||
const parentProps = isContainer ? this.getComponentProps(component, "parent", "parent") : {}; | ||
return React.cloneElement(component, parentProps, children); | ||
@@ -194,0 +195,0 @@ } |
@@ -164,3 +164,3 @@ import React, { PropTypes } from "react"; | ||
const children = [...dataComponents, ...labelComponents]; | ||
return this.renderContainer(groupComponent, children, {}); | ||
return this.renderContainer(groupComponent, children); | ||
@@ -173,4 +173,5 @@ } | ||
renderContainer(component, children, props) { | ||
const parentProps = props || this.getComponentProps(component, "parent", "parent"); | ||
renderContainer(component, children) { | ||
const isContainer = component.type && component.type.role === "container"; | ||
const parentProps = isContainer ? this.getComponentProps(component, "parent", "parent") : {}; | ||
return React.cloneElement(component, parentProps, children); | ||
@@ -177,0 +178,0 @@ } |
@@ -182,3 +182,3 @@ import React, { PropTypes } from "react"; | ||
const children = [...dataComponents, ...labelComponents]; | ||
return this.renderContainer(groupComponent, children, {}); | ||
return this.renderContainer(groupComponent, children); | ||
} | ||
@@ -190,4 +190,5 @@ | ||
renderContainer(component, children, props) { | ||
const parentProps = props || this.getComponentProps(component, "parent", "parent"); | ||
renderContainer(component, children) { | ||
const isContainer = component.type && component.type.role === "container"; | ||
const parentProps = isContainer ? this.getComponentProps(component, "parent", "parent") : {}; | ||
return React.cloneElement(component, parentProps, children); | ||
@@ -194,0 +195,0 @@ } |
@@ -165,3 +165,3 @@ import React, { PropTypes } from "react"; | ||
const children = [...dataComponents, ...labelComponents]; | ||
return this.renderContainer(groupComponent, children, {}); | ||
return this.renderContainer(groupComponent, children); | ||
} | ||
@@ -173,4 +173,5 @@ | ||
renderContainer(component, children, props) { | ||
const parentProps = props || this.getComponentProps(component, "parent", "parent"); | ||
renderContainer(component, children) { | ||
const isContainer = component.type && component.type.role === "container"; | ||
const parentProps = isContainer ? this.getComponentProps(component, "parent", "parent") : {}; | ||
return React.cloneElement(component, parentProps, children); | ||
@@ -177,0 +178,0 @@ } |
@@ -143,3 +143,3 @@ import { partialRight, without } from "lodash"; | ||
const children = [React.cloneElement(dataComponent, dataProps), ...labelComponents]; | ||
return this.renderContainer(groupComponent, children, {}); | ||
return this.renderContainer(groupComponent, children); | ||
} | ||
@@ -151,4 +151,5 @@ | ||
renderContainer(component, children, props) { | ||
const parentProps = props || this.getComponentProps(component, "parent", "parent"); | ||
renderContainer(component, children) { | ||
const isContainer = component.type && component.type.role === "container"; | ||
const parentProps = isContainer ? this.getComponentProps(component, "parent", "parent") : {}; | ||
return React.cloneElement(component, parentProps, children); | ||
@@ -155,0 +156,0 @@ } |
@@ -152,3 +152,3 @@ import React, { PropTypes } from "react"; | ||
const children = [...dataComponents, ...labelComponents]; | ||
return this.renderContainer(groupComponent, children, {}); | ||
return this.renderContainer(groupComponent, children); | ||
} | ||
@@ -160,4 +160,5 @@ | ||
renderContainer(component, children, props) { | ||
const parentProps = props || this.getComponentProps(component, "parent", "parent"); | ||
renderContainer(component, children) { | ||
const isContainer = component.type && component.type.role === "container"; | ||
const parentProps = isContainer ? this.getComponentProps(component, "parent", "parent") : {}; | ||
return React.cloneElement(component, parentProps, children); | ||
@@ -164,0 +165,0 @@ } |
@@ -148,5 +148,4 @@ import React, { PropTypes } from "react"; | ||
return labelComponents.length > 0 ? | ||
React.cloneElement(groupComponent, {}, ...dataComponents, ...labelComponents) : | ||
dataComponents; | ||
const children = [...dataComponents, ...labelComponents]; | ||
return this.renderContainer(groupComponent, children); | ||
} | ||
@@ -158,6 +157,6 @@ | ||
renderContainer(props, children) { | ||
const {containerComponent} = props; | ||
const parentProps = this.getComponentProps(containerComponent, "parent", "parent"); | ||
return React.cloneElement(containerComponent, parentProps, children); | ||
renderContainer(component, children) { | ||
const isContainer = component.type && component.type.role === "container"; | ||
const parentProps = isContainer ? this.getComponentProps(component, "parent", "parent") : {}; | ||
return React.cloneElement(component, parentProps, children); | ||
} | ||
@@ -176,3 +175,3 @@ | ||
const children = this.renderData(props); | ||
return this.renderContainer(props, children); | ||
return this.renderContainer(props.containerComponent, children); | ||
} | ||
@@ -179,0 +178,0 @@ } |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
1860725
76
32671
Updatedd3-voronoi@^1.1.2
Updatedvictory-core@^14.0.7