victory-brush-container
Advanced tools
Comparing version 30.3.1 to 30.4.0
@@ -398,2 +398,3 @@ import _mapValues from "lodash/mapValues"; | ||
onBrushDomainChange = targetProps.onBrushDomainChange, | ||
onBrushDomainChangeEnd = targetProps.onBrushDomainChangeEnd, | ||
onBrushCleared = targetProps.onBrushCleared, | ||
@@ -419,2 +420,6 @@ domain = targetProps.domain, | ||
if (_isFunction(onBrushDomainChangeEnd)) { | ||
onBrushDomainChangeEnd(currentDomain, _defaults({}, mutatedProps, targetProps)); | ||
} | ||
if (_isFunction(onBrushCleared)) { | ||
@@ -421,0 +426,0 @@ onBrushCleared(currentDomain, _defaults({}, mutatedProps, targetProps)); |
@@ -168,3 +168,4 @@ import _defaults from "lodash/defaults"; | ||
onBrushCleared: PropTypes.func, | ||
onBrushDomainChange: PropTypes.func | ||
onBrushDomainChange: PropTypes.func, | ||
onBrushDomainChangeEnd: PropTypes.func | ||
}) | ||
@@ -171,0 +172,0 @@ }), Object.defineProperty(_class, "defaultProps", { |
@@ -416,2 +416,3 @@ "use strict"; | ||
onBrushDomainChange = targetProps.onBrushDomainChange, | ||
onBrushDomainChangeEnd = targetProps.onBrushDomainChangeEnd, | ||
onBrushCleared = targetProps.onBrushCleared, | ||
@@ -437,2 +438,6 @@ domain = targetProps.domain, | ||
if ((0, _isFunction2.default)(onBrushDomainChangeEnd)) { | ||
onBrushDomainChangeEnd(currentDomain, (0, _defaults2.default)({}, mutatedProps, targetProps)); | ||
} | ||
if ((0, _isFunction2.default)(onBrushCleared)) { | ||
@@ -439,0 +444,0 @@ onBrushCleared(currentDomain, (0, _defaults2.default)({}, mutatedProps, targetProps)); |
@@ -181,3 +181,4 @@ "use strict"; | ||
onBrushCleared: _propTypes.default.func, | ||
onBrushDomainChange: _propTypes.default.func | ||
onBrushDomainChange: _propTypes.default.func, | ||
onBrushDomainChangeEnd: _propTypes.default.func | ||
}) | ||
@@ -184,0 +185,0 @@ }), Object.defineProperty(_class, "defaultProps", { |
{ | ||
"name": "victory-brush-container", | ||
"version": "30.3.1", | ||
"version": "30.4.0", | ||
"description": "Interactive Brush Component for Victory", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -152,8 +152,16 @@ | ||
The optional `onBrushDomainChange` prop accepts an function to be called on each update to the highlighted domain. The function accepts the parameters of `domain` (the updated domain), and `props` (the props used by `VictoryBrushContainer`). | ||
The optional `onBrushDomainChange` prop accepts a function to be called on each update to the highlighted domain. The function accepts the parameters of `domain` (the updated domain), and `props` (the props used by `VictoryBrushContainer`). | ||
*example:* `onBrushDomainChange={(domain, props) => handleDomainChange(domain, props)}` | ||
## onBrushDomainChangeEnd | ||
`type: function` | ||
The optional `onBrushDomainChangeEnd` prop accepts a function to be called on the last update to the highlighted domain. The function accepts the parameters of `domain` (the updated domain), and `props` (the props used by `VictoryBrushContainer`). | ||
*example:* `onBrushDomainChangeEnd={(domain, props) => handleDomainChangeEnd(domain, props)}` | ||
[brush and zoom guide]: https://formidable.com/open-source/victory/guides/brush-and-zoom | ||
[VictoryContainer]: https://formidable.com/open-source/victory/docs/victory-container |
@@ -247,3 +247,4 @@ import { Selection } from "victory-core"; | ||
const { | ||
x1, y1, x2, y2, onBrushDomainChange, onBrushCleared, domain, allowResize, defaultBrushArea | ||
x1, y1, x2, y2, onBrushDomainChange, onBrushDomainChangeEnd, onBrushCleared, domain, | ||
allowResize, defaultBrushArea | ||
} = targetProps; | ||
@@ -259,2 +260,5 @@ // if the mouse hasn't moved since a mouseDown event, select the default brush area | ||
} | ||
if (isFunction(onBrushDomainChangeEnd)) { | ||
onBrushDomainChangeEnd(currentDomain, defaults({}, mutatedProps, targetProps)); | ||
} | ||
if (isFunction(onBrushCleared)) { | ||
@@ -261,0 +265,0 @@ onBrushCleared(currentDomain, defaults({}, mutatedProps, targetProps)); |
@@ -28,3 +28,4 @@ import PropTypes from "prop-types"; | ||
onBrushCleared: PropTypes.func, | ||
onBrushDomainChange: PropTypes.func | ||
onBrushDomainChange: PropTypes.func, | ||
onBrushDomainChangeEnd: PropTypes.func | ||
}; | ||
@@ -31,0 +32,0 @@ static defaultProps = { |
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
1217392
22439
167