victory-brush-container 37.3.1 → 37.3.3
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/CHANGELOG.md +8 -0
- package/dist/victory-brush-container.js +137 -96
- package/dist/victory-brush-container.min.js +1 -1
- package/es/brush-helpers.d.ts +0 -1
- package/es/brush-helpers.js +14 -18
- package/es/victory-brush-container.d.ts +41 -41
- package/es/victory-brush-container.js +5 -5
- package/lib/brush-helpers.d.ts +0 -1
- package/lib/brush-helpers.js +14 -18
- package/lib/victory-brush-container.d.ts +41 -41
- package/lib/victory-brush-container.js +5 -5
- package/package.json +6 -38
- package/src/brush-helpers.ts +4 -5
- package/src/victory-brush-container.tsx +1 -1
|
@@ -4,10 +4,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.useVictoryBrushContainer = exports.VictoryBrushContainer = exports.VICTORY_BRUSH_CONTAINER_DEFAULT_PROPS = void 0;
|
|
7
|
-
var _defaults2 = _interopRequireDefault(require("lodash/defaults"));
|
|
8
7
|
var _react = _interopRequireDefault(require("react"));
|
|
9
8
|
var _victoryCore = require("victory-core");
|
|
10
9
|
var _brushHelpers = require("./brush-helpers");
|
|
10
|
+
var _defaults = _interopRequireDefault(require("lodash/defaults"));
|
|
11
11
|
var _reactFastCompare = _interopRequireDefault(require("react-fast-compare"));
|
|
12
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
13
|
const VICTORY_BRUSH_CONTAINER_DEFAULT_PROPS = exports.VICTORY_BRUSH_CONTAINER_DEFAULT_PROPS = {
|
|
@@ -55,7 +55,7 @@ const useVictoryBrushContainer = initialProps => {
|
|
|
55
55
|
x: Math.min(x[0], x[1]),
|
|
56
56
|
y: Math.min(y[0], y[1]),
|
|
57
57
|
cursor,
|
|
58
|
-
style: (0,
|
|
58
|
+
style: (0, _defaults.default)({}, brushComponentStyle, brushStyle)
|
|
59
59
|
}) : null;
|
|
60
60
|
};
|
|
61
61
|
const getCursorPointers = () => {
|
|
@@ -95,7 +95,7 @@ const useVictoryBrushContainer = initialProps => {
|
|
|
95
95
|
const width = Math.abs(x2 - x1) || 1;
|
|
96
96
|
const height = Math.abs(y2 - y1) || 1;
|
|
97
97
|
const handleComponentStyle = handleComponent.props && handleComponent.props.style || {};
|
|
98
|
-
const style = (0,
|
|
98
|
+
const style = (0, _defaults.default)({}, handleComponentStyle, handleStyle);
|
|
99
99
|
const cursors = getCursorPointers();
|
|
100
100
|
const yProps = {
|
|
101
101
|
style,
|
|
@@ -137,8 +137,8 @@ const useVictoryBrushContainer = initialProps => {
|
|
|
137
137
|
currentDomain,
|
|
138
138
|
cachedBrushDomain
|
|
139
139
|
} = props;
|
|
140
|
-
const brushDomain = (0,
|
|
141
|
-
const domain = (0, _reactFastCompare.default)(brushDomain, cachedBrushDomain) ? (0,
|
|
140
|
+
const brushDomain = (0, _defaults.default)({}, props.brushDomain, props.domain);
|
|
141
|
+
const domain = (0, _reactFastCompare.default)(brushDomain, cachedBrushDomain) ? (0, _defaults.default)({}, currentDomain, brushDomain) : brushDomain;
|
|
142
142
|
const coordinates = _victoryCore.Selection.getDomainCoordinates(props, domain);
|
|
143
143
|
const selectBox = getSelectBox(coordinates);
|
|
144
144
|
return selectBox ? [selectBox, getHandles(domain)] : [];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "victory-brush-container",
|
|
3
|
-
"version": "37.3.
|
|
3
|
+
"version": "37.3.3",
|
|
4
4
|
"description": "Interactive Brush Component for Victory",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"data visualization",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"lodash": "^4.17.19",
|
|
24
24
|
"react-fast-compare": "^3.2.0",
|
|
25
|
-
"victory-core": "37.3.
|
|
25
|
+
"victory-core": "37.3.3"
|
|
26
26
|
},
|
|
27
27
|
"peerDependencies": {
|
|
28
28
|
"react": ">=16.6.0"
|
|
@@ -181,38 +181,10 @@
|
|
|
181
181
|
"pnpm-lock.yaml"
|
|
182
182
|
]
|
|
183
183
|
},
|
|
184
|
-
"format": {
|
|
185
|
-
"command": "nps format:pkg",
|
|
186
|
-
"files": [
|
|
187
|
-
"src/**",
|
|
188
|
-
"*.json",
|
|
189
|
-
"../../.prettierignore",
|
|
190
|
-
"../../.prettierrc.json"
|
|
191
|
-
],
|
|
192
|
-
"output": [],
|
|
193
|
-
"packageLocks": [
|
|
194
|
-
"pnpm-lock.yaml"
|
|
195
|
-
]
|
|
196
|
-
},
|
|
197
|
-
"format:fix": {
|
|
198
|
-
"command": "pnpm run format || nps format:pkg:fix",
|
|
199
|
-
"files": [
|
|
200
|
-
"src/**",
|
|
201
|
-
"*.json",
|
|
202
|
-
"../../.prettierignore",
|
|
203
|
-
"../../.prettierrc.json"
|
|
204
|
-
],
|
|
205
|
-
"output": [],
|
|
206
|
-
"packageLocks": [
|
|
207
|
-
"pnpm-lock.yaml"
|
|
208
|
-
]
|
|
209
|
-
},
|
|
210
184
|
"lint": {
|
|
211
|
-
"command": "
|
|
185
|
+
"command": "eslint src",
|
|
212
186
|
"files": [
|
|
213
|
-
"src/**"
|
|
214
|
-
"../../.eslintignore",
|
|
215
|
-
"../../.eslintrc.js"
|
|
187
|
+
"src/**"
|
|
216
188
|
],
|
|
217
189
|
"output": [],
|
|
218
190
|
"dependencies": [
|
|
@@ -225,11 +197,9 @@
|
|
|
225
197
|
]
|
|
226
198
|
},
|
|
227
199
|
"lint:fix": {
|
|
228
|
-
"command": "
|
|
200
|
+
"command": "eslint --fix src",
|
|
229
201
|
"files": [
|
|
230
|
-
"src/**"
|
|
231
|
-
"../../.eslintignore",
|
|
232
|
-
"../../.eslintrc.js"
|
|
202
|
+
"src/**"
|
|
233
203
|
],
|
|
234
204
|
"output": [],
|
|
235
205
|
"dependencies": [
|
|
@@ -273,8 +243,6 @@
|
|
|
273
243
|
"check": "wireit",
|
|
274
244
|
"types:check": "wireit",
|
|
275
245
|
"types:create": "wireit",
|
|
276
|
-
"format": "wireit",
|
|
277
|
-
"format:fix": "wireit",
|
|
278
246
|
"lint": "wireit",
|
|
279
247
|
"lint:fix": "wireit",
|
|
280
248
|
"jest": "wireit"
|
package/src/brush-helpers.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import defaults from "lodash/defaults";
|
|
2
|
+
import throttle from "lodash/throttle";
|
|
3
|
+
|
|
1
4
|
import { Helpers as CoreHelpers, Selection } from "victory-core";
|
|
2
|
-
import { throttle, defaults } from "lodash";
|
|
3
5
|
import isEqual from "react-fast-compare";
|
|
4
6
|
|
|
5
7
|
const Helpers = {
|
|
@@ -222,7 +224,6 @@ const Helpers = {
|
|
|
222
224
|
}
|
|
223
225
|
},
|
|
224
226
|
|
|
225
|
-
// eslint-disable-next-line max-statements, complexity
|
|
226
227
|
onMouseDown(evt, targetProps) {
|
|
227
228
|
evt.preventDefault();
|
|
228
229
|
const {
|
|
@@ -324,7 +325,6 @@ const Helpers = {
|
|
|
324
325
|
: {};
|
|
325
326
|
},
|
|
326
327
|
|
|
327
|
-
// eslint-disable-next-line max-statements, complexity
|
|
328
328
|
onGlobalMouseMove(evt, targetProps) {
|
|
329
329
|
const {
|
|
330
330
|
scale,
|
|
@@ -416,13 +416,12 @@ const Helpers = {
|
|
|
416
416
|
return {};
|
|
417
417
|
},
|
|
418
418
|
|
|
419
|
-
// eslint-disable-next-line complexity
|
|
420
419
|
onGlobalMouseUp(evt, targetProps) {
|
|
421
420
|
// if a panning or selection has not been started, ignore the event
|
|
422
421
|
if (!targetProps.isPanning && !targetProps.isSelecting) {
|
|
423
422
|
return {};
|
|
424
423
|
}
|
|
425
|
-
|
|
424
|
+
|
|
426
425
|
const {
|
|
427
426
|
x1,
|
|
428
427
|
y1,
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
VictoryEventHandler,
|
|
9
9
|
} from "victory-core";
|
|
10
10
|
import { BrushHelpers } from "./brush-helpers";
|
|
11
|
-
import
|
|
11
|
+
import defaults from "lodash/defaults";
|
|
12
12
|
import isEqual from "react-fast-compare";
|
|
13
13
|
|
|
14
14
|
export interface VictoryBrushContainerProps extends VictoryContainerProps {
|