victory-brush-line
Advanced tools
Comparing version 31.2.0 to 32.0.0
@@ -49,2 +49,14 @@ import _pick from "lodash/pick"; | ||
var getDimension = function (props) { | ||
var horizontal = props.horizontal, | ||
_props$dimension2 = props.dimension, | ||
dimension = _props$dimension2 === void 0 ? "x" : _props$dimension2; | ||
if (!horizontal) { | ||
return dimension; | ||
} | ||
return dimension === "x" ? "y" : "x"; | ||
}; | ||
var toRange = function (props, domain) { | ||
@@ -92,3 +104,3 @@ var scale = getScale(props); | ||
var width = props.handleWidth / 2; | ||
var dimension = props.dimension; | ||
var dimension = getDimension(props); | ||
@@ -169,4 +181,4 @@ var getHandle = function (type) { | ||
value: function getRectDimensions(props, brushWidth, domain) { | ||
var dimension = props.dimension, | ||
brushDomain = props.brushDomain; | ||
var brushDomain = props.brushDomain; | ||
var dimension = getDimension(props); | ||
domain = domain || getBrushDomain(brushDomain, getFullDomain(props)); | ||
@@ -207,4 +219,3 @@ var range = toRange(props, domain); | ||
value: function getHandleDimensions(props) { | ||
var dimension = props.dimension, | ||
handleWidth = props.handleWidth, | ||
var handleWidth = props.handleWidth, | ||
x1 = props.x1, | ||
@@ -215,2 +226,3 @@ x2 = props.x2, | ||
brushDomain = props.brushDomain; | ||
var dimension = getDimension(props); | ||
var brushWidth = props.brushWidth || props.width; | ||
@@ -249,5 +261,5 @@ var domain = getBrushDomain(brushDomain, getFullDomain(props)); | ||
value: function getCursor(props) { | ||
var dimension = props.dimension, | ||
_props$activeBrushes = props.activeBrushes, | ||
var _props$activeBrushes = props.activeBrushes, | ||
activeBrushes = _props$activeBrushes === void 0 ? {} : _props$activeBrushes; | ||
var dimension = getDimension(props); | ||
@@ -433,5 +445,5 @@ if (activeBrushes.minHandle || activeBrushes.maxHandle) { | ||
evt.preventDefault(); | ||
var dimension = targetProps.dimension, | ||
allowResize = targetProps.allowResize, | ||
var allowResize = targetProps.allowResize, | ||
brushDomain = targetProps.brushDomain; | ||
var dimension = getDimension(targetProps); | ||
var parentSVG = targetProps.parentSVG || Selection.getParentSVG(evt); | ||
@@ -464,5 +476,5 @@ var position = Selection.getSVGEventCoordinates(evt, parentSVG)[dimension]; | ||
allowDraw = targetProps.allowDraw, | ||
dimension = targetProps.dimension, | ||
activeBrushes = targetProps.activeBrushes, | ||
brushDomain = targetProps.brushDomain; // Don't trigger events for static brushes | ||
brushDomain = targetProps.brushDomain; | ||
var dimension = getDimension(targetProps); // Don't trigger events for static brushes | ||
@@ -529,5 +541,5 @@ if (!allowResize && !allowDrag) { | ||
allowDrag = targetProps.allowDrag, | ||
dimension = targetProps.dimension, | ||
onBrushDomainChange = targetProps.onBrushDomainChange, | ||
brushDomain = targetProps.brushDomain; | ||
var dimension = getDimension(targetProps); | ||
@@ -534,0 +546,0 @@ if (isPanning || isSelecting) { |
@@ -67,2 +67,14 @@ "use strict"; | ||
var getDimension = function (props) { | ||
var horizontal = props.horizontal, | ||
_props$dimension2 = props.dimension, | ||
dimension = _props$dimension2 === void 0 ? "x" : _props$dimension2; | ||
if (!horizontal) { | ||
return dimension; | ||
} | ||
return dimension === "x" ? "y" : "x"; | ||
}; | ||
var toRange = function (props, domain) { | ||
@@ -114,3 +126,3 @@ var scale = getScale(props); | ||
var width = props.handleWidth / 2; | ||
var dimension = props.dimension; | ||
var dimension = getDimension(props); | ||
@@ -191,4 +203,4 @@ var getHandle = function (type) { | ||
value: function getRectDimensions(props, brushWidth, domain) { | ||
var dimension = props.dimension, | ||
brushDomain = props.brushDomain; | ||
var brushDomain = props.brushDomain; | ||
var dimension = getDimension(props); | ||
domain = domain || getBrushDomain(brushDomain, getFullDomain(props)); | ||
@@ -229,4 +241,3 @@ var range = toRange(props, domain); | ||
value: function getHandleDimensions(props) { | ||
var dimension = props.dimension, | ||
handleWidth = props.handleWidth, | ||
var handleWidth = props.handleWidth, | ||
x1 = props.x1, | ||
@@ -237,2 +248,3 @@ x2 = props.x2, | ||
brushDomain = props.brushDomain; | ||
var dimension = getDimension(props); | ||
var brushWidth = props.brushWidth || props.width; | ||
@@ -271,5 +283,5 @@ var domain = getBrushDomain(brushDomain, getFullDomain(props)); | ||
value: function getCursor(props) { | ||
var dimension = props.dimension, | ||
_props$activeBrushes = props.activeBrushes, | ||
var _props$activeBrushes = props.activeBrushes, | ||
activeBrushes = _props$activeBrushes === void 0 ? {} : _props$activeBrushes; | ||
var dimension = getDimension(props); | ||
@@ -445,5 +457,5 @@ if (activeBrushes.minHandle || activeBrushes.maxHandle) { | ||
evt.preventDefault(); | ||
var dimension = targetProps.dimension, | ||
allowResize = targetProps.allowResize, | ||
var allowResize = targetProps.allowResize, | ||
brushDomain = targetProps.brushDomain; | ||
var dimension = getDimension(targetProps); | ||
@@ -479,5 +491,5 @@ var parentSVG = targetProps.parentSVG || _victoryCore.Selection.getParentSVG(evt); | ||
allowDraw = targetProps.allowDraw, | ||
dimension = targetProps.dimension, | ||
activeBrushes = targetProps.activeBrushes, | ||
brushDomain = targetProps.brushDomain; // Don't trigger events for static brushes | ||
brushDomain = targetProps.brushDomain; | ||
var dimension = getDimension(targetProps); // Don't trigger events for static brushes | ||
@@ -547,5 +559,5 @@ if (!allowResize && !allowDrag) { | ||
allowDrag = targetProps.allowDrag, | ||
dimension = targetProps.dimension, | ||
onBrushDomainChange = targetProps.onBrushDomainChange, | ||
brushDomain = targetProps.brushDomain; | ||
var dimension = getDimension(targetProps); | ||
@@ -552,0 +564,0 @@ if (isPanning || isSelecting) { |
{ | ||
"name": "victory-brush-line", | ||
"version": "31.2.0", | ||
"version": "32.0.0", | ||
"description": "Interactive Brush Line Component for Victory", | ||
@@ -24,3 +24,3 @@ "keywords": [ | ||
"prop-types": "^15.5.8", | ||
"victory-core": "^31.2.0" | ||
"victory-core": "^32.0.0" | ||
}, | ||
@@ -27,0 +27,0 @@ "scripts": { |
@@ -10,2 +10,3 @@ import React from "react"; | ||
const { scale = {}, dimension = "x" } = props; | ||
if (scale[dimension]) { | ||
@@ -21,2 +22,10 @@ return scale[dimension]; | ||
const getDimension = (props) => { | ||
const { horizontal, dimension = "x" } = props; | ||
if (!horizontal) { | ||
return dimension; | ||
} | ||
return dimension === "x" ? "y" : "x"; | ||
}; | ||
const toRange = (props, domain) => { | ||
@@ -63,3 +72,3 @@ const scale = getScale(props); | ||
const width = props.handleWidth / 2; | ||
const { dimension } = props; | ||
const dimension = getDimension(props); | ||
const getHandle = (type) => { | ||
@@ -170,3 +179,4 @@ const base = { | ||
evt.preventDefault(); | ||
const { dimension, allowResize, brushDomain } = targetProps; | ||
const { allowResize, brushDomain } = targetProps; | ||
const dimension = getDimension(targetProps); | ||
const parentSVG = targetProps.parentSVG || Selection.getParentSVG(evt); | ||
@@ -200,6 +210,6 @@ const position = Selection.getSVGEventCoordinates(evt, parentSVG)[dimension]; | ||
allowDraw, | ||
dimension, | ||
activeBrushes, | ||
brushDomain | ||
} = targetProps; | ||
const dimension = getDimension(targetProps); | ||
@@ -272,6 +282,7 @@ // Don't trigger events for static brushes | ||
allowDrag, | ||
dimension, | ||
onBrushDomainChange, | ||
brushDomain | ||
} = targetProps; | ||
const dimension = getDimension(targetProps); | ||
if (isPanning || isSelecting) { | ||
@@ -416,3 +427,4 @@ evt.preventDefault(); | ||
getRectDimensions(props, brushWidth, domain) { | ||
const { dimension, brushDomain } = props; | ||
const { brushDomain } = props; | ||
const dimension = getDimension(props); | ||
domain = domain || getBrushDomain(brushDomain, getFullDomain(props)); | ||
@@ -448,3 +460,4 @@ const range = toRange(props, domain); | ||
getHandleDimensions(props) { | ||
const { dimension, handleWidth, x1, x2, y1, y2, brushDomain } = props; | ||
const { handleWidth, x1, x2, y1, y2, brushDomain } = props; | ||
const dimension = getDimension(props); | ||
const brushWidth = props.brushWidth || props.width; | ||
@@ -473,3 +486,4 @@ const domain = getBrushDomain(brushDomain, getFullDomain(props)); | ||
getCursor(props) { | ||
const { dimension, activeBrushes = {} } = props; | ||
const { activeBrushes = {} } = props; | ||
const dimension = getDimension(props); | ||
if (activeBrushes.minHandle || activeBrushes.maxHandle) { | ||
@@ -476,0 +490,0 @@ return dimension === "x" ? "ew-resize" : "ns-resize"; |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1219597
22372
+ Addedvictory-core@32.3.7(transitive)
- Removedvictory-core@31.2.0(transitive)
Updatedvictory-core@^32.0.0