victory-brush-container 36.2.2 → 36.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/victory-brush-container.js +508 -383
- package/dist/victory-brush-container.min.js +1 -1
- package/es/brush-helpers.js +19 -13
- package/es/victory-brush-container.js +94 -100
- package/lib/brush-helpers.js +19 -13
- package/lib/index.js +7 -5
- package/lib/victory-brush-container.js +94 -100
- package/package.json +3 -3
package/lib/brush-helpers.js
CHANGED
|
@@ -21,17 +21,23 @@ var _reactFastCompare = _interopRequireDefault(require("react-fast-compare"));
|
|
|
21
21
|
|
|
22
22
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
23
23
|
|
|
24
|
-
function
|
|
24
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
25
|
+
|
|
26
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
25
27
|
|
|
26
28
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
27
29
|
|
|
28
|
-
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); }
|
|
30
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
31
|
+
|
|
32
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
33
|
+
|
|
34
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
29
35
|
|
|
30
|
-
function
|
|
36
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
31
37
|
|
|
32
|
-
function
|
|
38
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
33
39
|
|
|
34
|
-
function
|
|
40
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
35
41
|
|
|
36
42
|
var Helpers = {
|
|
37
43
|
getDimension: function (props) {
|
|
@@ -180,14 +186,14 @@ var Helpers = {
|
|
|
180
186
|
|
|
181
187
|
var parentSVG = targetProps.parentSVG || _victoryCore.Selection.getParentSVG(evt);
|
|
182
188
|
|
|
183
|
-
var pannedBox = this.panBox(_objectSpread({}, targetProps, brushBox, {
|
|
189
|
+
var pannedBox = this.panBox(_objectSpread(_objectSpread(_objectSpread({}, targetProps), brushBox), {}, {
|
|
184
190
|
brushDomain: cachedDomain,
|
|
185
191
|
startX: (brushBox.x1 + brushBox.x2) / 2,
|
|
186
192
|
startY: (brushBox.y1 + brushBox.y2) / 2
|
|
187
193
|
}), _victoryCore.Selection.getSVGEventCoordinates(evt, parentSVG));
|
|
188
194
|
var fullDomainBox = targetProps.fullDomainBox || this.getDomainBox(targetProps, fullDomain);
|
|
189
195
|
var constrainedBox = this.constrainBox(pannedBox, fullDomainBox);
|
|
190
|
-
return _victoryCore.Selection.getBounds(_objectSpread({}, constrainedBox, {
|
|
196
|
+
return _victoryCore.Selection.getBounds(_objectSpread(_objectSpread({}, constrainedBox), {}, {
|
|
191
197
|
scale: scale,
|
|
192
198
|
horizontal: horizontal
|
|
193
199
|
}));
|
|
@@ -400,7 +406,7 @@ var Helpers = {
|
|
|
400
406
|
x = _Selection$getSVGEven2.x,
|
|
401
407
|
y = _Selection$getSVGEven2.y;
|
|
402
408
|
|
|
403
|
-
if (!allowResize && !allowDrag || mouseMoveThreshold > 0 && !this.hasMoved(_objectSpread({}, targetProps, {
|
|
409
|
+
if (!allowResize && !allowDrag || mouseMoveThreshold > 0 && !this.hasMoved(_objectSpread(_objectSpread({}, targetProps), {}, {
|
|
404
410
|
x2: x,
|
|
405
411
|
y2: y
|
|
406
412
|
}))) {
|
|
@@ -416,7 +422,7 @@ var Helpers = {
|
|
|
416
422
|
});
|
|
417
423
|
var constrainedBox = this.constrainBox(pannedBox, fullDomainBox);
|
|
418
424
|
|
|
419
|
-
var currentDomain = _victoryCore.Selection.getBounds(_objectSpread({}, constrainedBox, {
|
|
425
|
+
var currentDomain = _victoryCore.Selection.getBounds(_objectSpread(_objectSpread({}, constrainedBox), {}, {
|
|
420
426
|
scale: scale,
|
|
421
427
|
horizontal: horizontal
|
|
422
428
|
}));
|
|
@@ -439,12 +445,12 @@ var Helpers = {
|
|
|
439
445
|
}
|
|
440
446
|
}];
|
|
441
447
|
} else if (allowResize && isSelecting) {
|
|
442
|
-
var
|
|
448
|
+
var _this$constrainPoint = this.constrainPoint({
|
|
443
449
|
x: brushDimension !== "y" ? x : targetProps.x2,
|
|
444
450
|
y: brushDimension !== "x" ? y : targetProps.y2
|
|
445
451
|
}, fullDomainBox),
|
|
446
|
-
x2 =
|
|
447
|
-
y2 =
|
|
452
|
+
x2 = _this$constrainPoint.x,
|
|
453
|
+
y2 = _this$constrainPoint.y;
|
|
448
454
|
|
|
449
455
|
var _currentDomain = _victoryCore.Selection.getBounds({
|
|
450
456
|
x2: x2,
|
|
@@ -534,7 +540,7 @@ var Helpers = {
|
|
|
534
540
|
}
|
|
535
541
|
};
|
|
536
542
|
|
|
537
|
-
var _default = _objectSpread({}, Helpers, {
|
|
543
|
+
var _default = _objectSpread(_objectSpread({}, Helpers), {}, {
|
|
538
544
|
onMouseDown: Helpers.onMouseDown.bind(Helpers),
|
|
539
545
|
onGlobalMouseUp: Helpers.onGlobalMouseUp.bind(Helpers),
|
|
540
546
|
onGlobalMouseMove: (0, _throttle2.default)(Helpers.onGlobalMouseMove.bind(Helpers), 16, // eslint-disable-line no-magic-numbers
|
package/lib/index.js
CHANGED
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
Object.defineProperty(exports, "
|
|
6
|
+
Object.defineProperty(exports, "BrushHelpers", {
|
|
7
7
|
enumerable: true,
|
|
8
8
|
get: function () {
|
|
9
|
-
return
|
|
9
|
+
return _brushHelpers.default;
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
12
|
Object.defineProperty(exports, "VictoryBrushContainer", {
|
|
@@ -15,10 +15,10 @@ Object.defineProperty(exports, "VictoryBrushContainer", {
|
|
|
15
15
|
return _victoryBrushContainer.default;
|
|
16
16
|
}
|
|
17
17
|
});
|
|
18
|
-
Object.defineProperty(exports, "
|
|
18
|
+
Object.defineProperty(exports, "brushContainerMixin", {
|
|
19
19
|
enumerable: true,
|
|
20
20
|
get: function () {
|
|
21
|
-
return
|
|
21
|
+
return _victoryBrushContainer.brushContainerMixin;
|
|
22
22
|
}
|
|
23
23
|
});
|
|
24
24
|
|
|
@@ -28,4 +28,6 @@ var _brushHelpers = _interopRequireDefault(require("./brush-helpers"));
|
|
|
28
28
|
|
|
29
29
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
30
30
|
|
|
31
|
-
function
|
|
31
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
32
|
+
|
|
33
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
@@ -21,42 +21,56 @@ var _reactFastCompare = _interopRequireDefault(require("react-fast-compare"));
|
|
|
21
21
|
|
|
22
22
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
23
23
|
|
|
24
|
-
function
|
|
24
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
25
25
|
|
|
26
|
-
function
|
|
26
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
27
|
+
|
|
28
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
29
|
+
|
|
30
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
27
31
|
|
|
28
|
-
function
|
|
32
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
29
33
|
|
|
30
|
-
function
|
|
34
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
31
35
|
|
|
32
|
-
function
|
|
36
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
33
37
|
|
|
34
|
-
function
|
|
38
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
35
39
|
|
|
36
40
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
37
41
|
|
|
38
42
|
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); } }
|
|
39
43
|
|
|
40
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
44
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
45
|
+
|
|
46
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
47
|
+
|
|
48
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
49
|
+
|
|
50
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
41
51
|
|
|
42
|
-
function _possibleConstructorReturn(self, call) { if (call && (typeof call === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
52
|
+
function _possibleConstructorReturn(self, call) { if (call && (typeof call === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
43
53
|
|
|
44
54
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
45
55
|
|
|
46
|
-
function
|
|
56
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
57
|
+
|
|
58
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
59
|
+
|
|
60
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
47
61
|
|
|
48
62
|
var brushContainerMixin = function (base) {
|
|
49
|
-
var _class
|
|
63
|
+
var _class;
|
|
50
64
|
|
|
51
|
-
return
|
|
52
|
-
/*#__PURE__*/
|
|
53
|
-
function (_base) {
|
|
65
|
+
return _class = /*#__PURE__*/function (_base) {
|
|
54
66
|
_inherits(VictoryBrushContainer, _base);
|
|
55
67
|
|
|
68
|
+
var _super = _createSuper(VictoryBrushContainer);
|
|
69
|
+
|
|
56
70
|
function VictoryBrushContainer() {
|
|
57
71
|
_classCallCheck(this, VictoryBrushContainer);
|
|
58
72
|
|
|
59
|
-
return
|
|
73
|
+
return _super.apply(this, arguments);
|
|
60
74
|
}
|
|
61
75
|
|
|
62
76
|
_createClass(VictoryBrushContainer, [{
|
|
@@ -69,7 +83,7 @@ var brushContainerMixin = function (base) {
|
|
|
69
83
|
name = props.name;
|
|
70
84
|
var brushComponentStyle = brushComponent.props && brushComponent.props.style;
|
|
71
85
|
var cursor = !props.allowDrag && !props.allowResize ? "auto" : "move";
|
|
72
|
-
return x[0] !== x[1] && y[0] !== y[1] ? _react.default.cloneElement(brushComponent, {
|
|
86
|
+
return x[0] !== x[1] && y[0] !== y[1] ? /*#__PURE__*/_react.default.cloneElement(brushComponent, {
|
|
73
87
|
key: "".concat(name, "-brush"),
|
|
74
88
|
width: Math.abs(x[1] - x[0]) || 1,
|
|
75
89
|
height: Math.abs(y[1] - y[0]) || 1,
|
|
@@ -154,7 +168,7 @@ var brushContainerMixin = function (base) {
|
|
|
154
168
|
}, xProps)
|
|
155
169
|
};
|
|
156
170
|
var handles = ["top", "bottom", "left", "right"].reduce(function (memo, curr) {
|
|
157
|
-
memo = handleProps[curr] ? memo.concat(_react.default.cloneElement(handleComponent, (0, _assign2.default)({
|
|
171
|
+
memo = handleProps[curr] ? memo.concat( /*#__PURE__*/_react.default.cloneElement(handleComponent, (0, _assign2.default)({
|
|
158
172
|
key: "".concat(name, "-handle-").concat(curr)
|
|
159
173
|
}, handleProps[curr]))) : memo;
|
|
160
174
|
return memo;
|
|
@@ -178,95 +192,75 @@ var brushContainerMixin = function (base) {
|
|
|
178
192
|
}, {
|
|
179
193
|
key: "getChildren",
|
|
180
194
|
value: function getChildren(props) {
|
|
181
|
-
return _toConsumableArray(_react.default.Children.toArray(props.children))
|
|
195
|
+
return [].concat(_toConsumableArray(_react.default.Children.toArray(props.children)), _toConsumableArray(this.getRect(props)));
|
|
182
196
|
}
|
|
183
197
|
}]);
|
|
184
198
|
|
|
185
199
|
return VictoryBrushContainer;
|
|
186
|
-
}(base),
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
return props.disable ? {} : _brushHelpers.default.onMouseDown(evt, targetProps);
|
|
247
|
-
},
|
|
248
|
-
onTouchStart: function (evt, targetProps) {
|
|
249
|
-
return props.disable ? {} : _brushHelpers.default.onMouseDown(evt, targetProps);
|
|
250
|
-
},
|
|
251
|
-
onGlobalMouseMove: function (evt, targetProps) {
|
|
252
|
-
return props.disable || !targetProps.isPanning && !targetProps.isSelecting ? {} : _brushHelpers.default.onGlobalMouseMove(evt, targetProps);
|
|
253
|
-
},
|
|
254
|
-
onGlobalTouchMove: function (evt, targetProps) {
|
|
255
|
-
return props.disable || !targetProps.isPanning && !targetProps.isSelecting ? {} : _brushHelpers.default.onGlobalMouseMove(evt, targetProps);
|
|
256
|
-
},
|
|
257
|
-
onGlobalMouseUp: function (evt, targetProps) {
|
|
258
|
-
return props.disable ? {} : _brushHelpers.default.onGlobalMouseUp(evt, targetProps);
|
|
259
|
-
},
|
|
260
|
-
onGlobalTouchEnd: function (evt, targetProps) {
|
|
261
|
-
return props.disable ? {} : _brushHelpers.default.onGlobalMouseUp(evt, targetProps);
|
|
262
|
-
},
|
|
263
|
-
onGlobalTouchCancel: function (evt, targetProps) {
|
|
264
|
-
return props.disable ? {} : _brushHelpers.default.onGlobalMouseUp(evt, targetProps);
|
|
265
|
-
}
|
|
200
|
+
}(base), _defineProperty(_class, "displayName", "VictoryBrushContainer"), _defineProperty(_class, "propTypes", _objectSpread(_objectSpread({}, _victoryCore.VictoryContainer.propTypes), {}, {
|
|
201
|
+
allowDrag: _propTypes.default.bool,
|
|
202
|
+
allowDraw: _propTypes.default.bool,
|
|
203
|
+
allowResize: _propTypes.default.bool,
|
|
204
|
+
brushComponent: _propTypes.default.element,
|
|
205
|
+
brushDimension: _propTypes.default.oneOf(["x", "y"]),
|
|
206
|
+
brushDomain: _propTypes.default.shape({
|
|
207
|
+
x: _propTypes.default.array,
|
|
208
|
+
y: _propTypes.default.array
|
|
209
|
+
}),
|
|
210
|
+
brushStyle: _propTypes.default.object,
|
|
211
|
+
defaultBrushArea: _propTypes.default.oneOf(["all", "disable", "none", "move"]),
|
|
212
|
+
disable: _propTypes.default.bool,
|
|
213
|
+
handleComponent: _propTypes.default.element,
|
|
214
|
+
handleStyle: _propTypes.default.object,
|
|
215
|
+
handleWidth: _propTypes.default.number,
|
|
216
|
+
onBrushCleared: _propTypes.default.func,
|
|
217
|
+
onBrushDomainChange: _propTypes.default.func,
|
|
218
|
+
onBrushDomainChangeEnd: _propTypes.default.func
|
|
219
|
+
})), _defineProperty(_class, "defaultProps", _objectSpread(_objectSpread({}, _victoryCore.VictoryContainer.defaultProps), {}, {
|
|
220
|
+
allowDrag: true,
|
|
221
|
+
allowDraw: true,
|
|
222
|
+
allowResize: true,
|
|
223
|
+
brushComponent: /*#__PURE__*/_react.default.createElement(_victoryCore.Rect, null),
|
|
224
|
+
brushStyle: {
|
|
225
|
+
stroke: "transparent",
|
|
226
|
+
fill: "black",
|
|
227
|
+
fillOpacity: 0.1
|
|
228
|
+
},
|
|
229
|
+
handleComponent: /*#__PURE__*/_react.default.createElement(_victoryCore.Rect, null),
|
|
230
|
+
handleStyle: {
|
|
231
|
+
stroke: "transparent",
|
|
232
|
+
fill: "transparent"
|
|
233
|
+
},
|
|
234
|
+
handleWidth: 8,
|
|
235
|
+
mouseMoveThreshold: 0
|
|
236
|
+
})), _defineProperty(_class, "defaultEvents", function (props) {
|
|
237
|
+
return [{
|
|
238
|
+
target: "parent",
|
|
239
|
+
eventHandlers: {
|
|
240
|
+
onMouseDown: function (evt, targetProps) {
|
|
241
|
+
return props.disable ? {} : _brushHelpers.default.onMouseDown(evt, targetProps);
|
|
242
|
+
},
|
|
243
|
+
onTouchStart: function (evt, targetProps) {
|
|
244
|
+
return props.disable ? {} : _brushHelpers.default.onMouseDown(evt, targetProps);
|
|
245
|
+
},
|
|
246
|
+
onGlobalMouseMove: function (evt, targetProps) {
|
|
247
|
+
return props.disable || !targetProps.isPanning && !targetProps.isSelecting ? {} : _brushHelpers.default.onGlobalMouseMove(evt, targetProps);
|
|
248
|
+
},
|
|
249
|
+
onGlobalTouchMove: function (evt, targetProps) {
|
|
250
|
+
return props.disable || !targetProps.isPanning && !targetProps.isSelecting ? {} : _brushHelpers.default.onGlobalMouseMove(evt, targetProps);
|
|
251
|
+
},
|
|
252
|
+
onGlobalMouseUp: function (evt, targetProps) {
|
|
253
|
+
return props.disable ? {} : _brushHelpers.default.onGlobalMouseUp(evt, targetProps);
|
|
254
|
+
},
|
|
255
|
+
onGlobalTouchEnd: function (evt, targetProps) {
|
|
256
|
+
return props.disable ? {} : _brushHelpers.default.onGlobalMouseUp(evt, targetProps);
|
|
257
|
+
},
|
|
258
|
+
onGlobalTouchCancel: function (evt, targetProps) {
|
|
259
|
+
return props.disable ? {} : _brushHelpers.default.onGlobalMouseUp(evt, targetProps);
|
|
266
260
|
}
|
|
267
|
-
}
|
|
268
|
-
}
|
|
269
|
-
}),
|
|
261
|
+
}
|
|
262
|
+
}];
|
|
263
|
+
}), _class;
|
|
270
264
|
};
|
|
271
265
|
|
|
272
266
|
exports.brushContainerMixin = brushContainerMixin;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "victory-brush-container",
|
|
3
|
-
"version": "36.
|
|
3
|
+
"version": "36.4.0",
|
|
4
4
|
"description": "Interactive Brush Component for Victory",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"data visualization",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"lodash": "^4.17.19",
|
|
23
23
|
"prop-types": "^15.5.8",
|
|
24
24
|
"react-fast-compare": "^2.0.0",
|
|
25
|
-
"victory-core": "^36.
|
|
25
|
+
"victory-core": "^36.4.0"
|
|
26
26
|
},
|
|
27
27
|
"peerDependencies": {
|
|
28
28
|
"react": "^16.6.0 || ^17.0.0"
|
|
@@ -31,5 +31,5 @@
|
|
|
31
31
|
"version": "yarn run nps build-libs && nps build-dists"
|
|
32
32
|
},
|
|
33
33
|
"sideEffects": false,
|
|
34
|
-
"gitHead": "
|
|
34
|
+
"gitHead": "2e05481eeb34f9801a90023a131a21aa7deff082"
|
|
35
35
|
}
|