victory-create-container 37.0.2 → 37.1.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/CHANGELOG.md +8 -0
- package/dist/victory-create-container.js +1156 -1700
- package/dist/victory-create-container.min.js +1 -1
- package/es/create-container.d.ts +389 -34
- package/es/create-container.js +59 -69
- package/lib/create-container.d.ts +389 -34
- package/lib/create-container.js +58 -69
- package/package.json +7 -7
- package/src/create-container.tsx +169 -0
- package/src/create-container.ts +0 -173
|
@@ -11,37 +11,34 @@
|
|
|
11
11
|
return /******/ (function() { // webpackBootstrap
|
|
12
12
|
/******/ var __webpack_modules__ = ({
|
|
13
13
|
|
|
14
|
-
/***/ "./create-container.
|
|
15
|
-
|
|
16
|
-
!*** ./create-container.
|
|
17
|
-
|
|
14
|
+
/***/ "./create-container.tsx":
|
|
15
|
+
/*!******************************!*\
|
|
16
|
+
!*** ./create-container.tsx ***!
|
|
17
|
+
\******************************/
|
|
18
18
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
19
19
|
|
|
20
20
|
"use strict";
|
|
21
21
|
__webpack_require__.r(__webpack_exports__);
|
|
22
22
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
23
|
-
/* harmony export */ "combineContainerMixins": function() { return /* binding */ combineContainerMixins; },
|
|
24
23
|
/* harmony export */ "createContainer": function() { return /* binding */ createContainer; },
|
|
25
24
|
/* harmony export */ "makeCreateContainerFunction": function() { return /* binding */ makeCreateContainerFunction; }
|
|
26
25
|
/* harmony export */ });
|
|
27
|
-
/* harmony import */ var
|
|
28
|
-
/* harmony import */ var
|
|
29
|
-
/* harmony import */ var
|
|
30
|
-
/* harmony import */ var
|
|
31
|
-
/* harmony import */ var
|
|
32
|
-
/* harmony import */ var
|
|
33
|
-
/* harmony import */ var
|
|
34
|
-
/* harmony import */ var
|
|
35
|
-
/* harmony import */ var
|
|
36
|
-
/* harmony import */ var
|
|
37
|
-
/* harmony import */ var
|
|
38
|
-
/* harmony import */ var
|
|
39
|
-
/* harmony import */ var
|
|
40
|
-
/* harmony import */ var
|
|
41
|
-
/* harmony import */ var
|
|
42
|
-
/* harmony import */ var
|
|
43
|
-
/* harmony import */ var victory_brush_container__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! victory-brush-container */ "../../victory-brush-container/es/victory-brush-container.js");
|
|
44
|
-
/* harmony import */ var victory_cursor_container__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! victory-cursor-container */ "../../victory-cursor-container/es/victory-cursor-container.js");
|
|
26
|
+
/* harmony import */ var lodash_toPairs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash/toPairs */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/toPairs.js");
|
|
27
|
+
/* harmony import */ var lodash_toPairs__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_toPairs__WEBPACK_IMPORTED_MODULE_0__);
|
|
28
|
+
/* harmony import */ var lodash_isEmpty__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash/isEmpty */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isEmpty.js");
|
|
29
|
+
/* harmony import */ var lodash_isEmpty__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_isEmpty__WEBPACK_IMPORTED_MODULE_1__);
|
|
30
|
+
/* harmony import */ var lodash_groupBy__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lodash/groupBy */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/groupBy.js");
|
|
31
|
+
/* harmony import */ var lodash_groupBy__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash_groupBy__WEBPACK_IMPORTED_MODULE_2__);
|
|
32
|
+
/* harmony import */ var lodash_forOwn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! lodash/forOwn */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/forOwn.js");
|
|
33
|
+
/* harmony import */ var lodash_forOwn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(lodash_forOwn__WEBPACK_IMPORTED_MODULE_3__);
|
|
34
|
+
/* harmony import */ var victory_zoom_container__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! victory-zoom-container */ "../../victory-zoom-container/es/victory-zoom-container.js");
|
|
35
|
+
/* harmony import */ var victory_selection_container__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! victory-selection-container */ "../../victory-selection-container/es/victory-selection-container.js");
|
|
36
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react */ "react");
|
|
37
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_4__);
|
|
38
|
+
/* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-container/victory-container.js");
|
|
39
|
+
/* harmony import */ var victory_voronoi_container__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! victory-voronoi-container */ "../../victory-voronoi-container/es/victory-voronoi-container.js");
|
|
40
|
+
/* harmony import */ var victory_cursor_container__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! victory-cursor-container */ "../../victory-cursor-container/es/victory-cursor-container.js");
|
|
41
|
+
/* harmony import */ var victory_brush_container__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! victory-brush-container */ "../../victory-brush-container/es/victory-brush-container.js");
|
|
45
42
|
|
|
46
43
|
|
|
47
44
|
|
|
@@ -65,7 +62,7 @@ const combineEventHandlers = eventHandlersArray => {
|
|
|
65
62
|
// takes an array of event handler objects and produces one eventHandlers object
|
|
66
63
|
// creates a custom combinedHandler() for events with multiple conflicting handlers
|
|
67
64
|
return eventHandlersArray.reduce((localHandlers, finalHandlers) => {
|
|
68
|
-
|
|
65
|
+
lodash_forOwn__WEBPACK_IMPORTED_MODULE_3___default()(localHandlers, (localHandler, eventName) => {
|
|
69
66
|
const existingHandler = finalHandlers[eventName];
|
|
70
67
|
if (existingHandler) {
|
|
71
68
|
// create new handler for event that concats the existing handler's mutations with new ones
|
|
@@ -86,11 +83,11 @@ const combineEventHandlers = eventHandlersArray => {
|
|
|
86
83
|
const combineDefaultEvents = defaultEvents => {
|
|
87
84
|
// takes a defaultEvents array and returns one equal or lesser length,
|
|
88
85
|
// by combining any events that have the same target
|
|
89
|
-
const eventsByTarget =
|
|
90
|
-
const events =
|
|
86
|
+
const eventsByTarget = lodash_groupBy__WEBPACK_IMPORTED_MODULE_2___default()(defaultEvents, "target");
|
|
87
|
+
const events = lodash_toPairs__WEBPACK_IMPORTED_MODULE_0___default()(eventsByTarget).map(_ref => {
|
|
91
88
|
let [target, eventsArray] = _ref;
|
|
92
89
|
const newEventsArray = eventsArray.filter(Boolean);
|
|
93
|
-
return
|
|
90
|
+
return lodash_isEmpty__WEBPACK_IMPORTED_MODULE_1___default()(newEventsArray) ? null : {
|
|
94
91
|
target,
|
|
95
92
|
eventHandlers: combineEventHandlers(eventsArray.map(event => event.eventHandlers))
|
|
96
93
|
// note: does not currently handle eventKey or childName
|
|
@@ -98,68 +95,58 @@ const combineDefaultEvents = defaultEvents => {
|
|
|
98
95
|
});
|
|
99
96
|
return events.filter(Boolean);
|
|
100
97
|
};
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
}).join("");
|
|
113
|
-
return class VictoryCombinedContainer extends NaiveCombinedContainer {
|
|
114
|
-
static displayName = `Victory${displayType}Container`;
|
|
115
|
-
static propTypes = Classes.reduce((propTypes, Class) => ({
|
|
116
|
-
...propTypes,
|
|
117
|
-
...Class.propTypes
|
|
118
|
-
}), {});
|
|
119
|
-
static defaultProps = Classes.reduce((defaultProps, Class) => ({
|
|
120
|
-
...defaultProps,
|
|
121
|
-
...Class.defaultProps
|
|
122
|
-
}), {});
|
|
123
|
-
static defaultEvents(props) {
|
|
124
|
-
return combineDefaultEvents(Classes.reduce((defaultEvents, Class) => {
|
|
125
|
-
const events = victory_core__WEBPACK_IMPORTED_MODULE_5__.isFunction(Class.defaultEvents) ? Class.defaultEvents(props) : Class.defaultEvents;
|
|
126
|
-
return [...defaultEvents, ...events];
|
|
127
|
-
}, []));
|
|
128
|
-
}
|
|
129
|
-
getChildren(props) {
|
|
130
|
-
return instances.reduce((children, instance) => instance.getChildren({
|
|
131
|
-
...props,
|
|
132
|
-
children
|
|
133
|
-
}), props.children);
|
|
134
|
-
}
|
|
135
|
-
};
|
|
136
|
-
};
|
|
137
|
-
const checkBehaviorName = (behavior, behaviors) => {
|
|
138
|
-
if (behavior && !behaviors.includes(behavior)) {
|
|
139
|
-
victory_core__WEBPACK_IMPORTED_MODULE_6__.warn(`"${behavior}" is not a valid behavior. Choose from [${behaviors.join(", ")}].`);
|
|
140
|
-
}
|
|
98
|
+
/**
|
|
99
|
+
* Container hooks are used to provide the container logic to the container components through props and a modified children object
|
|
100
|
+
* - These hooks contain shared logic for both web and Victory Native containers.
|
|
101
|
+
* - In this utility, we call multiple of these hooks with the props returned by the previous to combine the container logic.
|
|
102
|
+
*/
|
|
103
|
+
const CONTAINER_HOOKS = {
|
|
104
|
+
zoom: victory_zoom_container__WEBPACK_IMPORTED_MODULE_5__.useVictoryZoomContainer,
|
|
105
|
+
selection: victory_selection_container__WEBPACK_IMPORTED_MODULE_6__.useVictorySelectionContainer,
|
|
106
|
+
brush: victory_brush_container__WEBPACK_IMPORTED_MODULE_7__.useVictoryBrushContainer,
|
|
107
|
+
cursor: victory_cursor_container__WEBPACK_IMPORTED_MODULE_8__.useVictoryCursorContainer,
|
|
108
|
+
voronoi: victory_voronoi_container__WEBPACK_IMPORTED_MODULE_9__.useVictoryVoronoiContainer
|
|
141
109
|
};
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
return combineContainerMixins([...firstMixins, ...secondMixins], Container);
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* Container hooks are wrappers that return a VictoryContainer with the props provided by their respective hooks, and the modified children.
|
|
113
|
+
* - These containers are specific to the web. Victory Native has its own container components.
|
|
114
|
+
* - For this utility, we only need the container components to extract the defaultEvents.
|
|
115
|
+
*/
|
|
116
|
+
const CONTAINER_COMPONENTS_WEB = {
|
|
117
|
+
zoom: victory_zoom_container__WEBPACK_IMPORTED_MODULE_5__.VictoryZoomContainer,
|
|
118
|
+
selection: victory_selection_container__WEBPACK_IMPORTED_MODULE_6__.VictorySelectionContainer,
|
|
119
|
+
brush: victory_brush_container__WEBPACK_IMPORTED_MODULE_7__.VictoryBrushContainer,
|
|
120
|
+
cursor: victory_cursor_container__WEBPACK_IMPORTED_MODULE_8__.VictoryCursorContainer,
|
|
121
|
+
voronoi: victory_voronoi_container__WEBPACK_IMPORTED_MODULE_9__.VictoryVoronoiContainer
|
|
155
122
|
};
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
123
|
+
function makeCreateContainerFunction(containerComponents, VictoryContainerBase) {
|
|
124
|
+
return function combineContainers(containerA, containerB) {
|
|
125
|
+
const ContainerA = containerComponents[containerA];
|
|
126
|
+
const ContainerB = containerComponents[containerB];
|
|
127
|
+
const useContainerA = CONTAINER_HOOKS[containerA];
|
|
128
|
+
const useContainerB = CONTAINER_HOOKS[containerB];
|
|
129
|
+
const CombinedContainer = props => {
|
|
130
|
+
const {
|
|
131
|
+
children: childrenA,
|
|
132
|
+
props: propsA
|
|
133
|
+
} = useContainerA(props);
|
|
134
|
+
const {
|
|
135
|
+
children: combinedChildren,
|
|
136
|
+
props: combinedProps
|
|
137
|
+
} = useContainerB({
|
|
138
|
+
...propsA,
|
|
139
|
+
children: childrenA
|
|
140
|
+
});
|
|
141
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(VictoryContainerBase, combinedProps, combinedChildren);
|
|
142
|
+
};
|
|
143
|
+
CombinedContainer.displayName = `Victory${containerA}${containerB}Container`;
|
|
144
|
+
CombinedContainer.role = "container";
|
|
145
|
+
CombinedContainer.defaultEvents = props => combineDefaultEvents([...ContainerA.defaultEvents(props), ...ContainerB.defaultEvents(props)]);
|
|
146
|
+
return CombinedContainer;
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
const createContainer = makeCreateContainerFunction(CONTAINER_COMPONENTS_WEB, victory_core__WEBPACK_IMPORTED_MODULE_10__.VictoryContainer);
|
|
163
150
|
|
|
164
151
|
/***/ }),
|
|
165
152
|
|
|
@@ -919,33 +906,6 @@ Delaunay.from = function (points, fx, fy, that) {
|
|
|
919
906
|
return new Delaunay(flatArray(points, fx, fy, that));
|
|
920
907
|
}; // only public methods will be .from and .find
|
|
921
908
|
|
|
922
|
-
/***/ }),
|
|
923
|
-
|
|
924
|
-
/***/ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_LodashWrapper.js":
|
|
925
|
-
/*!****************************************************************************************!*\
|
|
926
|
-
!*** ../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_LodashWrapper.js ***!
|
|
927
|
-
\****************************************************************************************/
|
|
928
|
-
/***/ (function(module) {
|
|
929
|
-
|
|
930
|
-
/**
|
|
931
|
-
* This method returns `undefined`.
|
|
932
|
-
*
|
|
933
|
-
* @static
|
|
934
|
-
* @memberOf _
|
|
935
|
-
* @since 2.3.0
|
|
936
|
-
* @category Util
|
|
937
|
-
* @example
|
|
938
|
-
*
|
|
939
|
-
* _.times(2, _.noop);
|
|
940
|
-
* // => [undefined, undefined]
|
|
941
|
-
*/
|
|
942
|
-
function noop() {
|
|
943
|
-
// No operation performed.
|
|
944
|
-
}
|
|
945
|
-
|
|
946
|
-
module.exports = noop;
|
|
947
|
-
|
|
948
|
-
|
|
949
909
|
/***/ }),
|
|
950
910
|
|
|
951
911
|
/***/ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_MapCache.js":
|
|
@@ -2936,94 +2896,6 @@ function createBaseFor(fromRight) {
|
|
|
2936
2896
|
module.exports = createBaseFor;
|
|
2937
2897
|
|
|
2938
2898
|
|
|
2939
|
-
/***/ }),
|
|
2940
|
-
|
|
2941
|
-
/***/ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_createFlow.js":
|
|
2942
|
-
/*!*************************************************************************************!*\
|
|
2943
|
-
!*** ../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_createFlow.js ***!
|
|
2944
|
-
\*************************************************************************************/
|
|
2945
|
-
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|
2946
|
-
|
|
2947
|
-
var LodashWrapper = __webpack_require__(/*! ./_LodashWrapper */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_LodashWrapper.js"),
|
|
2948
|
-
flatRest = __webpack_require__(/*! ./_flatRest */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_flatRest.js"),
|
|
2949
|
-
getData = __webpack_require__(/*! ./_getData */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_getData.js"),
|
|
2950
|
-
getFuncName = __webpack_require__(/*! ./_getFuncName */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_getFuncName.js"),
|
|
2951
|
-
isArray = __webpack_require__(/*! ./isArray */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isArray.js"),
|
|
2952
|
-
isLaziable = __webpack_require__(/*! ./_isLaziable */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_isLaziable.js");
|
|
2953
|
-
|
|
2954
|
-
/** Error message constants. */
|
|
2955
|
-
var FUNC_ERROR_TEXT = 'Expected a function';
|
|
2956
|
-
|
|
2957
|
-
/** Used to compose bitmasks for function metadata. */
|
|
2958
|
-
var WRAP_CURRY_FLAG = 8,
|
|
2959
|
-
WRAP_PARTIAL_FLAG = 32,
|
|
2960
|
-
WRAP_ARY_FLAG = 128,
|
|
2961
|
-
WRAP_REARG_FLAG = 256;
|
|
2962
|
-
|
|
2963
|
-
/**
|
|
2964
|
-
* Creates a `_.flow` or `_.flowRight` function.
|
|
2965
|
-
*
|
|
2966
|
-
* @private
|
|
2967
|
-
* @param {boolean} [fromRight] Specify iterating from right to left.
|
|
2968
|
-
* @returns {Function} Returns the new flow function.
|
|
2969
|
-
*/
|
|
2970
|
-
function createFlow(fromRight) {
|
|
2971
|
-
return flatRest(function(funcs) {
|
|
2972
|
-
var length = funcs.length,
|
|
2973
|
-
index = length,
|
|
2974
|
-
prereq = LodashWrapper.prototype.thru;
|
|
2975
|
-
|
|
2976
|
-
if (fromRight) {
|
|
2977
|
-
funcs.reverse();
|
|
2978
|
-
}
|
|
2979
|
-
while (index--) {
|
|
2980
|
-
var func = funcs[index];
|
|
2981
|
-
if (typeof func != 'function') {
|
|
2982
|
-
throw new TypeError(FUNC_ERROR_TEXT);
|
|
2983
|
-
}
|
|
2984
|
-
if (prereq && !wrapper && getFuncName(func) == 'wrapper') {
|
|
2985
|
-
var wrapper = new LodashWrapper([], true);
|
|
2986
|
-
}
|
|
2987
|
-
}
|
|
2988
|
-
index = wrapper ? index : length;
|
|
2989
|
-
while (++index < length) {
|
|
2990
|
-
func = funcs[index];
|
|
2991
|
-
|
|
2992
|
-
var funcName = getFuncName(func),
|
|
2993
|
-
data = funcName == 'wrapper' ? getData(func) : undefined;
|
|
2994
|
-
|
|
2995
|
-
if (data && isLaziable(data[0]) &&
|
|
2996
|
-
data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) &&
|
|
2997
|
-
!data[4].length && data[9] == 1
|
|
2998
|
-
) {
|
|
2999
|
-
wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]);
|
|
3000
|
-
} else {
|
|
3001
|
-
wrapper = (func.length == 1 && isLaziable(func))
|
|
3002
|
-
? wrapper[funcName]()
|
|
3003
|
-
: wrapper.thru(func);
|
|
3004
|
-
}
|
|
3005
|
-
}
|
|
3006
|
-
return function() {
|
|
3007
|
-
var args = arguments,
|
|
3008
|
-
value = args[0];
|
|
3009
|
-
|
|
3010
|
-
if (wrapper && args.length == 1 && isArray(value)) {
|
|
3011
|
-
return wrapper.plant(value).value();
|
|
3012
|
-
}
|
|
3013
|
-
var index = 0,
|
|
3014
|
-
result = length ? funcs[index].apply(this, args) : value;
|
|
3015
|
-
|
|
3016
|
-
while (++index < length) {
|
|
3017
|
-
result = funcs[index].call(this, result);
|
|
3018
|
-
}
|
|
3019
|
-
return result;
|
|
3020
|
-
};
|
|
3021
|
-
});
|
|
3022
|
-
}
|
|
3023
|
-
|
|
3024
|
-
module.exports = createFlow;
|
|
3025
|
-
|
|
3026
|
-
|
|
3027
2899
|
/***/ }),
|
|
3028
2900
|
|
|
3029
2901
|
/***/ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_createSet.js":
|
|
@@ -3439,61 +3311,6 @@ function nativeKeysIn(object) {
|
|
|
3439
3311
|
module.exports = nativeKeysIn;
|
|
3440
3312
|
|
|
3441
3313
|
|
|
3442
|
-
/***/ }),
|
|
3443
|
-
|
|
3444
|
-
/***/ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_getData.js":
|
|
3445
|
-
/*!**********************************************************************************!*\
|
|
3446
|
-
!*** ../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_getData.js ***!
|
|
3447
|
-
\**********************************************************************************/
|
|
3448
|
-
/***/ (function(module) {
|
|
3449
|
-
|
|
3450
|
-
/**
|
|
3451
|
-
* This method returns `undefined`.
|
|
3452
|
-
*
|
|
3453
|
-
* @static
|
|
3454
|
-
* @memberOf _
|
|
3455
|
-
* @since 2.3.0
|
|
3456
|
-
* @category Util
|
|
3457
|
-
* @example
|
|
3458
|
-
*
|
|
3459
|
-
* _.times(2, _.noop);
|
|
3460
|
-
* // => [undefined, undefined]
|
|
3461
|
-
*/
|
|
3462
|
-
function noop() {
|
|
3463
|
-
// No operation performed.
|
|
3464
|
-
}
|
|
3465
|
-
|
|
3466
|
-
module.exports = noop;
|
|
3467
|
-
|
|
3468
|
-
|
|
3469
|
-
/***/ }),
|
|
3470
|
-
|
|
3471
|
-
/***/ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_getFuncName.js":
|
|
3472
|
-
/*!**************************************************************************************!*\
|
|
3473
|
-
!*** ../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_getFuncName.js ***!
|
|
3474
|
-
\**************************************************************************************/
|
|
3475
|
-
/***/ (function(module) {
|
|
3476
|
-
|
|
3477
|
-
/**
|
|
3478
|
-
* This method returns an empty string.
|
|
3479
|
-
*
|
|
3480
|
-
* @static
|
|
3481
|
-
* @memberOf _
|
|
3482
|
-
* @since 4.13.0
|
|
3483
|
-
* @category Util
|
|
3484
|
-
* @returns {string} Returns the empty string.
|
|
3485
|
-
* @example
|
|
3486
|
-
*
|
|
3487
|
-
* _.times(2, _.stubString);
|
|
3488
|
-
* // => ['', '']
|
|
3489
|
-
*/
|
|
3490
|
-
function stubString() {
|
|
3491
|
-
return '';
|
|
3492
|
-
}
|
|
3493
|
-
|
|
3494
|
-
module.exports = stubString;
|
|
3495
|
-
|
|
3496
|
-
|
|
3497
3314
|
/***/ }),
|
|
3498
3315
|
|
|
3499
3316
|
/***/ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_getMatchData.js":
|
|
@@ -3780,34 +3597,6 @@ function isKey(value, object) {
|
|
|
3780
3597
|
module.exports = isKey;
|
|
3781
3598
|
|
|
3782
3599
|
|
|
3783
|
-
/***/ }),
|
|
3784
|
-
|
|
3785
|
-
/***/ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_isLaziable.js":
|
|
3786
|
-
/*!*************************************************************************************!*\
|
|
3787
|
-
!*** ../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_isLaziable.js ***!
|
|
3788
|
-
\*************************************************************************************/
|
|
3789
|
-
/***/ (function(module) {
|
|
3790
|
-
|
|
3791
|
-
/**
|
|
3792
|
-
* This method returns `false`.
|
|
3793
|
-
*
|
|
3794
|
-
* @static
|
|
3795
|
-
* @memberOf _
|
|
3796
|
-
* @since 4.13.0
|
|
3797
|
-
* @category Util
|
|
3798
|
-
* @returns {boolean} Returns `false`.
|
|
3799
|
-
* @example
|
|
3800
|
-
*
|
|
3801
|
-
* _.times(2, _.stubFalse);
|
|
3802
|
-
* // => [false, false]
|
|
3803
|
-
*/
|
|
3804
|
-
function stubFalse() {
|
|
3805
|
-
return false;
|
|
3806
|
-
}
|
|
3807
|
-
|
|
3808
|
-
module.exports = stubFalse;
|
|
3809
|
-
|
|
3810
|
-
|
|
3811
3600
|
/***/ }),
|
|
3812
3601
|
|
|
3813
3602
|
/***/ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_isPrototype.js":
|
|
@@ -4831,43 +4620,6 @@ function flatten(array) {
|
|
|
4831
4620
|
module.exports = flatten;
|
|
4832
4621
|
|
|
4833
4622
|
|
|
4834
|
-
/***/ }),
|
|
4835
|
-
|
|
4836
|
-
/***/ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/flow.js":
|
|
4837
|
-
/*!******************************************************************************!*\
|
|
4838
|
-
!*** ../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/flow.js ***!
|
|
4839
|
-
\******************************************************************************/
|
|
4840
|
-
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|
4841
|
-
|
|
4842
|
-
var createFlow = __webpack_require__(/*! ./_createFlow */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_createFlow.js");
|
|
4843
|
-
|
|
4844
|
-
/**
|
|
4845
|
-
* Creates a function that returns the result of invoking the given functions
|
|
4846
|
-
* with the `this` binding of the created function, where each successive
|
|
4847
|
-
* invocation is supplied the return value of the previous.
|
|
4848
|
-
*
|
|
4849
|
-
* @static
|
|
4850
|
-
* @memberOf _
|
|
4851
|
-
* @since 3.0.0
|
|
4852
|
-
* @category Util
|
|
4853
|
-
* @param {...(Function|Function[])} [funcs] The functions to invoke.
|
|
4854
|
-
* @returns {Function} Returns the new composite function.
|
|
4855
|
-
* @see _.flowRight
|
|
4856
|
-
* @example
|
|
4857
|
-
*
|
|
4858
|
-
* function square(n) {
|
|
4859
|
-
* return n * n;
|
|
4860
|
-
* }
|
|
4861
|
-
*
|
|
4862
|
-
* var addSquare = _.flow([_.add, square]);
|
|
4863
|
-
* addSquare(1, 2);
|
|
4864
|
-
* // => 9
|
|
4865
|
-
*/
|
|
4866
|
-
var flow = createFlow();
|
|
4867
|
-
|
|
4868
|
-
module.exports = flow;
|
|
4869
|
-
|
|
4870
|
-
|
|
4871
4623
|
/***/ }),
|
|
4872
4624
|
|
|
4873
4625
|
/***/ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/forOwn.js":
|
|
@@ -7245,17 +6997,18 @@ const BrushHelpers = {
|
|
|
7245
6997
|
"use strict";
|
|
7246
6998
|
__webpack_require__.r(__webpack_exports__);
|
|
7247
6999
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
7000
|
+
/* harmony export */ "VICTORY_BRUSH_CONTAINER_DEFAULT_PROPS": function() { return /* binding */ VICTORY_BRUSH_CONTAINER_DEFAULT_PROPS; },
|
|
7248
7001
|
/* harmony export */ "VictoryBrushContainer": function() { return /* binding */ VictoryBrushContainer; },
|
|
7249
|
-
/* harmony export */ "
|
|
7002
|
+
/* harmony export */ "useVictoryBrushContainer": function() { return /* binding */ useVictoryBrushContainer; }
|
|
7250
7003
|
/* harmony export */ });
|
|
7251
7004
|
/* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash/defaults */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/defaults.js");
|
|
7252
7005
|
/* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_defaults__WEBPACK_IMPORTED_MODULE_0__);
|
|
7253
7006
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
|
|
7254
7007
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
|
|
7255
|
-
/* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-
|
|
7256
|
-
/* harmony import */ var
|
|
7257
|
-
/* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-
|
|
7258
|
-
/* harmony import */ var
|
|
7008
|
+
/* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-primitives/rect.js");
|
|
7009
|
+
/* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-util/selection.js");
|
|
7010
|
+
/* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-container/victory-container.js");
|
|
7011
|
+
/* harmony import */ var _brush_helpers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./brush-helpers */ "../../victory-brush-container/es/brush-helpers.js");
|
|
7259
7012
|
/* harmony import */ var react_fast_compare__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-fast-compare */ "../../../node_modules/.pnpm/react-fast-compare@3.2.0/node_modules/react-fast-compare/index.js");
|
|
7260
7013
|
/* harmony import */ var react_fast_compare__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_fast_compare__WEBPACK_IMPORTED_MODULE_2__);
|
|
7261
7014
|
|
|
@@ -7263,204 +7016,208 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
7263
7016
|
|
|
7264
7017
|
|
|
7265
7018
|
|
|
7266
|
-
|
|
7267
|
-
|
|
7268
|
-
|
|
7269
|
-
|
|
7270
|
-
|
|
7271
|
-
|
|
7272
|
-
|
|
7273
|
-
|
|
7274
|
-
|
|
7275
|
-
|
|
7276
|
-
|
|
7277
|
-
|
|
7278
|
-
|
|
7279
|
-
|
|
7280
|
-
|
|
7281
|
-
|
|
7282
|
-
|
|
7283
|
-
|
|
7284
|
-
|
|
7285
|
-
|
|
7286
|
-
|
|
7287
|
-
|
|
7019
|
+
const VICTORY_BRUSH_CONTAINER_DEFAULT_PROPS = {
|
|
7020
|
+
allowDrag: true,
|
|
7021
|
+
allowDraw: true,
|
|
7022
|
+
allowResize: true,
|
|
7023
|
+
brushComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(victory_core__WEBPACK_IMPORTED_MODULE_3__.Rect, null),
|
|
7024
|
+
brushStyle: {
|
|
7025
|
+
stroke: "transparent",
|
|
7026
|
+
fill: "black",
|
|
7027
|
+
fillOpacity: 0.1
|
|
7028
|
+
},
|
|
7029
|
+
handleComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(victory_core__WEBPACK_IMPORTED_MODULE_3__.Rect, null),
|
|
7030
|
+
handleStyle: {
|
|
7031
|
+
stroke: "transparent",
|
|
7032
|
+
fill: "transparent"
|
|
7033
|
+
},
|
|
7034
|
+
handleWidth: 8,
|
|
7035
|
+
mouseMoveThreshold: 0
|
|
7036
|
+
};
|
|
7037
|
+
const useVictoryBrushContainer = initialProps => {
|
|
7038
|
+
const props = {
|
|
7039
|
+
...VICTORY_BRUSH_CONTAINER_DEFAULT_PROPS,
|
|
7040
|
+
...initialProps
|
|
7041
|
+
};
|
|
7042
|
+
const {
|
|
7043
|
+
children
|
|
7044
|
+
} = props;
|
|
7045
|
+
const getSelectBox = coordinates => {
|
|
7046
|
+
const {
|
|
7047
|
+
x,
|
|
7048
|
+
y
|
|
7049
|
+
} = coordinates;
|
|
7050
|
+
const {
|
|
7051
|
+
brushStyle,
|
|
7052
|
+
brushComponent,
|
|
7053
|
+
name
|
|
7054
|
+
} = props;
|
|
7055
|
+
const brushComponentStyle = brushComponent.props && brushComponent.props.style;
|
|
7056
|
+
const cursor = !props.allowDrag && !props.allowResize ? "auto" : "move";
|
|
7057
|
+
return x[0] !== x[1] && y[0] !== y[1] ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().cloneElement(brushComponent, {
|
|
7058
|
+
key: `${name}-brush`,
|
|
7059
|
+
width: Math.abs(x[1] - x[0]) || 1,
|
|
7060
|
+
height: Math.abs(y[1] - y[0]) || 1,
|
|
7061
|
+
x: Math.min(x[0], x[1]),
|
|
7062
|
+
y: Math.min(y[0], y[1]),
|
|
7063
|
+
cursor,
|
|
7064
|
+
style: lodash_defaults__WEBPACK_IMPORTED_MODULE_0___default()({}, brushComponentStyle, brushStyle)
|
|
7065
|
+
}) : null;
|
|
7066
|
+
};
|
|
7067
|
+
const getCursorPointers = () => {
|
|
7068
|
+
const cursors = {
|
|
7069
|
+
yProps: "ns-resize",
|
|
7070
|
+
xProps: "ew-resize"
|
|
7288
7071
|
};
|
|
7289
|
-
|
|
7290
|
-
|
|
7291
|
-
|
|
7292
|
-
|
|
7293
|
-
|
|
7294
|
-
|
|
7295
|
-
},
|
|
7296
|
-
onTouchStart: (evt, targetProps) => {
|
|
7297
|
-
return props.disable ? {} : _brush_helpers__WEBPACK_IMPORTED_MODULE_5__.BrushHelpers.onMouseDown(evt, targetProps);
|
|
7298
|
-
},
|
|
7299
|
-
onGlobalMouseMove: (evt, targetProps) => {
|
|
7300
|
-
return props.disable || !targetProps.isPanning && !targetProps.isSelecting ? {} : _brush_helpers__WEBPACK_IMPORTED_MODULE_5__.BrushHelpers.onGlobalMouseMove(evt, targetProps);
|
|
7301
|
-
},
|
|
7302
|
-
onGlobalTouchMove: (evt, targetProps) => {
|
|
7303
|
-
return props.disable || !targetProps.isPanning && !targetProps.isSelecting ? {} : _brush_helpers__WEBPACK_IMPORTED_MODULE_5__.BrushHelpers.onGlobalMouseMove(evt, targetProps);
|
|
7304
|
-
},
|
|
7305
|
-
onGlobalMouseUp: (evt, targetProps) => {
|
|
7306
|
-
return props.disable ? {} : _brush_helpers__WEBPACK_IMPORTED_MODULE_5__.BrushHelpers.onGlobalMouseUp(evt, targetProps);
|
|
7307
|
-
},
|
|
7308
|
-
onGlobalTouchEnd: (evt, targetProps) => {
|
|
7309
|
-
return props.disable ? {} : _brush_helpers__WEBPACK_IMPORTED_MODULE_5__.BrushHelpers.onGlobalMouseUp(evt, targetProps);
|
|
7310
|
-
},
|
|
7311
|
-
onGlobalTouchCancel: (evt, targetProps) => {
|
|
7312
|
-
return props.disable ? {} : _brush_helpers__WEBPACK_IMPORTED_MODULE_5__.BrushHelpers.onGlobalMouseUp(evt, targetProps);
|
|
7313
|
-
}
|
|
7314
|
-
}
|
|
7315
|
-
}];
|
|
7316
|
-
}
|
|
7317
|
-
getSelectBox(props, coordinates) {
|
|
7318
|
-
const {
|
|
7319
|
-
x,
|
|
7320
|
-
y
|
|
7321
|
-
} = coordinates;
|
|
7322
|
-
const {
|
|
7323
|
-
brushStyle,
|
|
7324
|
-
brushComponent,
|
|
7325
|
-
name
|
|
7326
|
-
} = props;
|
|
7327
|
-
const brushComponentStyle = brushComponent.props && brushComponent.props.style;
|
|
7328
|
-
const cursor = !props.allowDrag && !props.allowResize ? "auto" : "move";
|
|
7329
|
-
return x[0] !== x[1] && y[0] !== y[1] ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().cloneElement(brushComponent, {
|
|
7330
|
-
key: `${name}-brush`,
|
|
7331
|
-
width: Math.abs(x[1] - x[0]) || 1,
|
|
7332
|
-
height: Math.abs(y[1] - y[0]) || 1,
|
|
7333
|
-
x: Math.min(x[0], x[1]),
|
|
7334
|
-
y: Math.min(y[0], y[1]),
|
|
7335
|
-
cursor,
|
|
7336
|
-
style: lodash_defaults__WEBPACK_IMPORTED_MODULE_0___default()({}, brushComponentStyle, brushStyle)
|
|
7337
|
-
}) : null;
|
|
7338
|
-
}
|
|
7339
|
-
getCursorPointers(props) {
|
|
7340
|
-
const cursors = {
|
|
7341
|
-
yProps: "ns-resize",
|
|
7342
|
-
xProps: "ew-resize"
|
|
7343
|
-
};
|
|
7344
|
-
if (!props.allowResize && props.allowDrag) {
|
|
7345
|
-
cursors.xProps = "move";
|
|
7346
|
-
cursors.yProps = "move";
|
|
7347
|
-
} else if (!props.allowResize && !props.allowDrag) {
|
|
7348
|
-
cursors.xProps = "auto";
|
|
7349
|
-
cursors.yProps = "auto";
|
|
7350
|
-
}
|
|
7351
|
-
return cursors;
|
|
7352
|
-
}
|
|
7353
|
-
getHandles(props, domain) {
|
|
7354
|
-
const {
|
|
7355
|
-
handleWidth,
|
|
7356
|
-
handleStyle,
|
|
7357
|
-
handleComponent,
|
|
7358
|
-
name
|
|
7359
|
-
} = props;
|
|
7360
|
-
const domainBox = _brush_helpers__WEBPACK_IMPORTED_MODULE_5__.BrushHelpers.getDomainBox(props, domain);
|
|
7361
|
-
const {
|
|
7362
|
-
x1,
|
|
7363
|
-
x2,
|
|
7364
|
-
y1,
|
|
7365
|
-
y2
|
|
7366
|
-
} = domainBox;
|
|
7367
|
-
const {
|
|
7368
|
-
top,
|
|
7369
|
-
bottom,
|
|
7370
|
-
left,
|
|
7371
|
-
right
|
|
7372
|
-
} = _brush_helpers__WEBPACK_IMPORTED_MODULE_5__.BrushHelpers.getHandles(props, domainBox);
|
|
7373
|
-
const width = Math.abs(x2 - x1) || 1;
|
|
7374
|
-
const height = Math.abs(y2 - y1) || 1;
|
|
7375
|
-
const handleComponentStyle = handleComponent.props && handleComponent.props.style || {};
|
|
7376
|
-
const style = lodash_defaults__WEBPACK_IMPORTED_MODULE_0___default()({}, handleComponentStyle, handleStyle);
|
|
7377
|
-
const cursors = this.getCursorPointers(props);
|
|
7378
|
-
const yProps = {
|
|
7379
|
-
style,
|
|
7380
|
-
width,
|
|
7381
|
-
height: handleWidth,
|
|
7382
|
-
cursor: cursors.yProps
|
|
7383
|
-
};
|
|
7384
|
-
const xProps = {
|
|
7385
|
-
style,
|
|
7386
|
-
width: handleWidth,
|
|
7387
|
-
height,
|
|
7388
|
-
cursor: cursors.xProps
|
|
7389
|
-
};
|
|
7390
|
-
const handleProps = {
|
|
7391
|
-
top: top && Object.assign({
|
|
7392
|
-
x: top.x1,
|
|
7393
|
-
y: top.y1
|
|
7394
|
-
}, yProps),
|
|
7395
|
-
bottom: bottom && Object.assign({
|
|
7396
|
-
x: bottom.x1,
|
|
7397
|
-
y: bottom.y1
|
|
7398
|
-
}, yProps),
|
|
7399
|
-
left: left && Object.assign({
|
|
7400
|
-
y: left.y1,
|
|
7401
|
-
x: left.x1
|
|
7402
|
-
}, xProps),
|
|
7403
|
-
right: right && Object.assign({
|
|
7404
|
-
y: right.y1,
|
|
7405
|
-
x: right.x1
|
|
7406
|
-
}, xProps)
|
|
7407
|
-
};
|
|
7408
|
-
const handles = ["top", "bottom", "left", "right"].reduce((memo, curr) => handleProps[curr] ? memo.concat( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().cloneElement(handleComponent, Object.assign({
|
|
7409
|
-
key: `${name}-handle-${curr}`
|
|
7410
|
-
}, handleProps[curr]))) : memo, []);
|
|
7411
|
-
return handles.length ? handles : null;
|
|
7412
|
-
}
|
|
7413
|
-
getRect(props) {
|
|
7414
|
-
const {
|
|
7415
|
-
currentDomain,
|
|
7416
|
-
cachedBrushDomain
|
|
7417
|
-
} = props;
|
|
7418
|
-
const brushDomain = lodash_defaults__WEBPACK_IMPORTED_MODULE_0___default()({}, props.brushDomain, props.domain);
|
|
7419
|
-
const domain = react_fast_compare__WEBPACK_IMPORTED_MODULE_2___default()(brushDomain, cachedBrushDomain) ? lodash_defaults__WEBPACK_IMPORTED_MODULE_0___default()({}, currentDomain, brushDomain) : brushDomain;
|
|
7420
|
-
const coordinates = victory_core__WEBPACK_IMPORTED_MODULE_6__.getDomainCoordinates(props, domain);
|
|
7421
|
-
const selectBox = this.getSelectBox(props, coordinates);
|
|
7422
|
-
return selectBox ? [selectBox, this.getHandles(props, domain)] : [];
|
|
7423
|
-
}
|
|
7424
|
-
|
|
7425
|
-
// Overrides method in VictoryContainer
|
|
7426
|
-
getChildren(props) {
|
|
7427
|
-
return [...react__WEBPACK_IMPORTED_MODULE_1___default().Children.toArray(props.children), ...this.getRect(props)];
|
|
7072
|
+
if (!props.allowResize && props.allowDrag) {
|
|
7073
|
+
cursors.xProps = "move";
|
|
7074
|
+
cursors.yProps = "move";
|
|
7075
|
+
} else if (!props.allowResize && !props.allowDrag) {
|
|
7076
|
+
cursors.xProps = "auto";
|
|
7077
|
+
cursors.yProps = "auto";
|
|
7428
7078
|
}
|
|
7079
|
+
return cursors;
|
|
7429
7080
|
};
|
|
7430
|
-
|
|
7431
|
-
const
|
|
7432
|
-
|
|
7433
|
-
|
|
7434
|
-
|
|
7435
|
-
|
|
7436
|
-
|
|
7437
|
-
|
|
7438
|
-
|
|
7439
|
-
|
|
7440
|
-
|
|
7441
|
-
|
|
7442
|
-
|
|
7443
|
-
|
|
7444
|
-
|
|
7445
|
-
|
|
7446
|
-
|
|
7447
|
-
|
|
7448
|
-
|
|
7449
|
-
|
|
7450
|
-
|
|
7451
|
-
|
|
7452
|
-
|
|
7453
|
-
|
|
7454
|
-
|
|
7455
|
-
|
|
7456
|
-
|
|
7457
|
-
|
|
7458
|
-
|
|
7459
|
-
|
|
7460
|
-
|
|
7461
|
-
|
|
7462
|
-
|
|
7463
|
-
|
|
7081
|
+
const getHandles = domain => {
|
|
7082
|
+
const {
|
|
7083
|
+
handleWidth,
|
|
7084
|
+
handleStyle,
|
|
7085
|
+
handleComponent,
|
|
7086
|
+
name
|
|
7087
|
+
} = props;
|
|
7088
|
+
const domainBox = _brush_helpers__WEBPACK_IMPORTED_MODULE_4__.BrushHelpers.getDomainBox(props, domain);
|
|
7089
|
+
const {
|
|
7090
|
+
x1,
|
|
7091
|
+
x2,
|
|
7092
|
+
y1,
|
|
7093
|
+
y2
|
|
7094
|
+
} = domainBox;
|
|
7095
|
+
const {
|
|
7096
|
+
top,
|
|
7097
|
+
bottom,
|
|
7098
|
+
left,
|
|
7099
|
+
right
|
|
7100
|
+
} = _brush_helpers__WEBPACK_IMPORTED_MODULE_4__.BrushHelpers.getHandles(props, domainBox);
|
|
7101
|
+
const width = Math.abs(x2 - x1) || 1;
|
|
7102
|
+
const height = Math.abs(y2 - y1) || 1;
|
|
7103
|
+
const handleComponentStyle = handleComponent.props && handleComponent.props.style || {};
|
|
7104
|
+
const style = lodash_defaults__WEBPACK_IMPORTED_MODULE_0___default()({}, handleComponentStyle, handleStyle);
|
|
7105
|
+
const cursors = getCursorPointers();
|
|
7106
|
+
const yProps = {
|
|
7107
|
+
style,
|
|
7108
|
+
width,
|
|
7109
|
+
height: handleWidth,
|
|
7110
|
+
cursor: cursors.yProps
|
|
7111
|
+
};
|
|
7112
|
+
const xProps = {
|
|
7113
|
+
style,
|
|
7114
|
+
width: handleWidth,
|
|
7115
|
+
height,
|
|
7116
|
+
cursor: cursors.xProps
|
|
7117
|
+
};
|
|
7118
|
+
const handleProps = {
|
|
7119
|
+
top: top && Object.assign({
|
|
7120
|
+
x: top.x1,
|
|
7121
|
+
y: top.y1
|
|
7122
|
+
}, yProps),
|
|
7123
|
+
bottom: bottom && Object.assign({
|
|
7124
|
+
x: bottom.x1,
|
|
7125
|
+
y: bottom.y1
|
|
7126
|
+
}, yProps),
|
|
7127
|
+
left: left && Object.assign({
|
|
7128
|
+
y: left.y1,
|
|
7129
|
+
x: left.x1
|
|
7130
|
+
}, xProps),
|
|
7131
|
+
right: right && Object.assign({
|
|
7132
|
+
y: right.y1,
|
|
7133
|
+
x: right.x1
|
|
7134
|
+
}, xProps)
|
|
7135
|
+
};
|
|
7136
|
+
const handles = ["top", "bottom", "left", "right"].reduce((memo, curr) => handleProps[curr] ? memo.concat( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().cloneElement(handleComponent, Object.assign({
|
|
7137
|
+
key: `${name}-handle-${curr}`
|
|
7138
|
+
}, handleProps[curr]))) : memo, []);
|
|
7139
|
+
return handles.length ? handles : null;
|
|
7140
|
+
};
|
|
7141
|
+
const getRect = () => {
|
|
7142
|
+
const {
|
|
7143
|
+
currentDomain,
|
|
7144
|
+
cachedBrushDomain
|
|
7145
|
+
} = props;
|
|
7146
|
+
const brushDomain = lodash_defaults__WEBPACK_IMPORTED_MODULE_0___default()({}, props.brushDomain, props.domain);
|
|
7147
|
+
const domain = react_fast_compare__WEBPACK_IMPORTED_MODULE_2___default()(brushDomain, cachedBrushDomain) ? lodash_defaults__WEBPACK_IMPORTED_MODULE_0___default()({}, currentDomain, brushDomain) : brushDomain;
|
|
7148
|
+
const coordinates = victory_core__WEBPACK_IMPORTED_MODULE_5__.getDomainCoordinates(props, domain);
|
|
7149
|
+
const selectBox = getSelectBox(coordinates);
|
|
7150
|
+
return selectBox ? [selectBox, getHandles(domain)] : [];
|
|
7151
|
+
};
|
|
7152
|
+
return {
|
|
7153
|
+
props,
|
|
7154
|
+
children: [...react__WEBPACK_IMPORTED_MODULE_1___default().Children.toArray(children), ...getRect()]
|
|
7155
|
+
};
|
|
7156
|
+
};
|
|
7157
|
+
const VictoryBrushContainer = initialProps => {
|
|
7158
|
+
const {
|
|
7159
|
+
props,
|
|
7160
|
+
children
|
|
7161
|
+
} = useVictoryBrushContainer(initialProps);
|
|
7162
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(victory_core__WEBPACK_IMPORTED_MODULE_6__.VictoryContainer, props, children);
|
|
7163
|
+
};
|
|
7164
|
+
VictoryBrushContainer.role = "container";
|
|
7165
|
+
VictoryBrushContainer.defaultEvents = initialProps => {
|
|
7166
|
+
const props = {
|
|
7167
|
+
...VICTORY_BRUSH_CONTAINER_DEFAULT_PROPS,
|
|
7168
|
+
...initialProps
|
|
7169
|
+
};
|
|
7170
|
+
const createEventHandler = (handler, isDisabled) =>
|
|
7171
|
+
// eslint-disable-next-line max-params
|
|
7172
|
+
(event, targetProps, eventKey, context) => props.disable || isDisabled?.(targetProps) ? {} : handler(event, {
|
|
7173
|
+
...props,
|
|
7174
|
+
...targetProps
|
|
7175
|
+
}, eventKey, context);
|
|
7176
|
+
return [{
|
|
7177
|
+
target: "parent",
|
|
7178
|
+
eventHandlers: {
|
|
7179
|
+
onMouseDown: createEventHandler(_brush_helpers__WEBPACK_IMPORTED_MODULE_4__.BrushHelpers.onMouseDown),
|
|
7180
|
+
onTouchStart: createEventHandler(_brush_helpers__WEBPACK_IMPORTED_MODULE_4__.BrushHelpers.onMouseDown),
|
|
7181
|
+
onGlobalMouseMove: createEventHandler(_brush_helpers__WEBPACK_IMPORTED_MODULE_4__.BrushHelpers.onGlobalMouseMove, targetProps => !targetProps.isPanning && !targetProps.isSelecting),
|
|
7182
|
+
onGlobalTouchMove: createEventHandler(_brush_helpers__WEBPACK_IMPORTED_MODULE_4__.BrushHelpers.onGlobalMouseMove, targetProps => !targetProps.isPanning && !targetProps.isSelecting),
|
|
7183
|
+
onGlobalMouseUp: createEventHandler(_brush_helpers__WEBPACK_IMPORTED_MODULE_4__.BrushHelpers.onGlobalMouseUp),
|
|
7184
|
+
onGlobalTouchEnd: createEventHandler(_brush_helpers__WEBPACK_IMPORTED_MODULE_4__.BrushHelpers.onGlobalMouseUp),
|
|
7185
|
+
onGlobalTouchCancel: createEventHandler(_brush_helpers__WEBPACK_IMPORTED_MODULE_4__.BrushHelpers.onGlobalMouseUp)
|
|
7186
|
+
}
|
|
7187
|
+
}];
|
|
7188
|
+
};
|
|
7189
|
+
|
|
7190
|
+
/***/ }),
|
|
7191
|
+
|
|
7192
|
+
/***/ "../../victory-core/es/victory-clip-container/victory-clip-container.js":
|
|
7193
|
+
/*!******************************************************************************!*\
|
|
7194
|
+
!*** ../../victory-core/es/victory-clip-container/victory-clip-container.js ***!
|
|
7195
|
+
\******************************************************************************/
|
|
7196
|
+
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
7197
|
+
|
|
7198
|
+
"use strict";
|
|
7199
|
+
__webpack_require__.r(__webpack_exports__);
|
|
7200
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
7201
|
+
/* harmony export */ "VictoryClipContainer": function() { return /* binding */ VictoryClipContainer; }
|
|
7202
|
+
/* harmony export */ });
|
|
7203
|
+
/* harmony import */ var lodash_uniqueId__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash/uniqueId */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/uniqueId.js");
|
|
7204
|
+
/* harmony import */ var lodash_uniqueId__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_uniqueId__WEBPACK_IMPORTED_MODULE_0__);
|
|
7205
|
+
/* harmony import */ var lodash_isObject__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash/isObject */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isObject.js");
|
|
7206
|
+
/* harmony import */ var lodash_isObject__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_isObject__WEBPACK_IMPORTED_MODULE_1__);
|
|
7207
|
+
/* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lodash/defaults */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/defaults.js");
|
|
7208
|
+
/* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash_defaults__WEBPACK_IMPORTED_MODULE_2__);
|
|
7209
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "react");
|
|
7210
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
|
|
7211
|
+
/* harmony import */ var _victory_util_helpers__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../victory-util/helpers */ "../../victory-core/es/victory-util/helpers.js");
|
|
7212
|
+
/* harmony import */ var _victory_util_user_props__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../victory-util/user-props */ "../../victory-core/es/victory-util/user-props.js");
|
|
7213
|
+
/* harmony import */ var _victory_primitives_clip_path__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../victory-primitives/clip-path */ "../../victory-core/es/victory-primitives/clip-path.js");
|
|
7214
|
+
/* harmony import */ var _victory_primitives_circle__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../victory-primitives/circle */ "../../victory-core/es/victory-primitives/circle.js");
|
|
7215
|
+
/* harmony import */ var _victory_primitives_rect__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../victory-primitives/rect */ "../../victory-core/es/victory-primitives/rect.js");
|
|
7216
|
+
|
|
7217
|
+
|
|
7218
|
+
|
|
7219
|
+
|
|
7220
|
+
|
|
7464
7221
|
|
|
7465
7222
|
|
|
7466
7223
|
|
|
@@ -7636,23 +7393,18 @@ class VictoryClipContainer extends (react__WEBPACK_IMPORTED_MODULE_3___default()
|
|
|
7636
7393
|
"use strict";
|
|
7637
7394
|
__webpack_require__.r(__webpack_exports__);
|
|
7638
7395
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
7639
|
-
/* harmony export */ "VictoryContainer": function() { return /* binding */ VictoryContainer; }
|
|
7396
|
+
/* harmony export */ "VictoryContainer": function() { return /* binding */ VictoryContainer; },
|
|
7397
|
+
/* harmony export */ "useVictoryContainer": function() { return /* binding */ useVictoryContainer; }
|
|
7640
7398
|
/* harmony export */ });
|
|
7641
|
-
/* harmony import */ var
|
|
7642
|
-
/* harmony import */ var
|
|
7643
|
-
/* harmony import */ var
|
|
7644
|
-
/* harmony import */ var
|
|
7645
|
-
/* harmony import */ var
|
|
7646
|
-
/* harmony import */ var
|
|
7647
|
-
/* harmony import */ var
|
|
7648
|
-
/* harmony import */ var
|
|
7649
|
-
/* harmony import */ var
|
|
7650
|
-
/* harmony import */ var _victory_portal_portal_context__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../victory-portal/portal-context */ "../../victory-core/es/victory-portal/portal-context.js");
|
|
7651
|
-
/* harmony import */ var _victory_util_timer_context__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../victory-util/timer-context */ "../../victory-core/es/victory-util/timer-context.js");
|
|
7652
|
-
/* harmony import */ var _victory_util_helpers__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../victory-util/helpers */ "../../victory-core/es/victory-util/helpers.js");
|
|
7653
|
-
/* harmony import */ var _victory_util_user_props__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../victory-util/user-props */ "../../victory-core/es/victory-util/user-props.js");
|
|
7654
|
-
|
|
7655
|
-
|
|
7399
|
+
/* harmony import */ var lodash_uniqueId__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash/uniqueId */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/uniqueId.js");
|
|
7400
|
+
/* harmony import */ var lodash_uniqueId__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_uniqueId__WEBPACK_IMPORTED_MODULE_0__);
|
|
7401
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
|
|
7402
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
|
|
7403
|
+
/* harmony import */ var _victory_portal_portal__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../victory-portal/portal */ "../../victory-core/es/victory-portal/portal.js");
|
|
7404
|
+
/* harmony import */ var _victory_util_user_props__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../victory-util/user-props */ "../../victory-core/es/victory-util/user-props.js");
|
|
7405
|
+
/* harmony import */ var _victory_util__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../victory-util */ "../../victory-core/es/victory-util/merge-refs.js");
|
|
7406
|
+
/* harmony import */ var _victory_portal_portal_outlet__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../victory-portal/portal-outlet */ "../../victory-core/es/victory-portal/portal-outlet.js");
|
|
7407
|
+
/* harmony import */ var _victory_portal_portal_context__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../victory-portal/portal-context */ "../../victory-core/es/victory-portal/portal-context.js");
|
|
7656
7408
|
|
|
7657
7409
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : 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; }; return _extends.apply(this, arguments); }
|
|
7658
7410
|
|
|
@@ -7661,175 +7413,149 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function
|
|
|
7661
7413
|
|
|
7662
7414
|
|
|
7663
7415
|
|
|
7664
|
-
|
|
7665
|
-
|
|
7666
|
-
|
|
7667
|
-
|
|
7668
|
-
|
|
7669
|
-
|
|
7670
|
-
|
|
7671
|
-
|
|
7672
|
-
|
|
7416
|
+
const defaultProps = {
|
|
7417
|
+
className: "VictoryContainer",
|
|
7418
|
+
portalComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_victory_portal_portal__WEBPACK_IMPORTED_MODULE_2__.Portal, null),
|
|
7419
|
+
portalZIndex: 99,
|
|
7420
|
+
responsive: true,
|
|
7421
|
+
role: "img"
|
|
7422
|
+
};
|
|
7423
|
+
function useVictoryContainer(initialProps) {
|
|
7424
|
+
const props = {
|
|
7425
|
+
...defaultProps,
|
|
7426
|
+
...initialProps
|
|
7673
7427
|
};
|
|
7674
|
-
|
|
7675
|
-
|
|
7676
|
-
|
|
7677
|
-
|
|
7678
|
-
|
|
7679
|
-
|
|
7680
|
-
|
|
7681
|
-
|
|
7682
|
-
|
|
7683
|
-
|
|
7684
|
-
|
|
7685
|
-
|
|
7686
|
-
|
|
7687
|
-
|
|
7688
|
-
|
|
7689
|
-
|
|
7690
|
-
|
|
7691
|
-
|
|
7692
|
-
|
|
7693
|
-
|
|
7694
|
-
this.props.containerRef(container);
|
|
7695
|
-
}
|
|
7696
|
-
this.containerRef = container;
|
|
7697
|
-
return container;
|
|
7428
|
+
const {
|
|
7429
|
+
title,
|
|
7430
|
+
desc,
|
|
7431
|
+
width,
|
|
7432
|
+
height,
|
|
7433
|
+
responsive
|
|
7434
|
+
} = props;
|
|
7435
|
+
const localContainerRef = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null);
|
|
7436
|
+
|
|
7437
|
+
// Generated ID stored in ref because it needs to persist across renders
|
|
7438
|
+
const generatedId = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(lodash_uniqueId__WEBPACK_IMPORTED_MODULE_0___default()("victory-container-"));
|
|
7439
|
+
const containerId = props.containerId ?? generatedId.current;
|
|
7440
|
+
const getIdForElement = elName => `${containerId}-${elName}`;
|
|
7441
|
+
const userProps = _victory_util_user_props__WEBPACK_IMPORTED_MODULE_3__.getSafeUserProps(props);
|
|
7442
|
+
const dimensions = responsive ? {
|
|
7443
|
+
width: "100%",
|
|
7444
|
+
height: "100%"
|
|
7445
|
+
} : {
|
|
7446
|
+
width,
|
|
7447
|
+
height
|
|
7698
7448
|
};
|
|
7699
|
-
|
|
7700
|
-
|
|
7701
|
-
|
|
7702
|
-
|
|
7703
|
-
|
|
7704
|
-
|
|
7705
|
-
|
|
7706
|
-
|
|
7707
|
-
|
|
7708
|
-
|
|
7709
|
-
|
|
7710
|
-
|
|
7711
|
-
|
|
7712
|
-
|
|
7713
|
-
|
|
7714
|
-
|
|
7715
|
-
|
|
7716
|
-
|
|
7717
|
-
|
|
7718
|
-
|
|
7719
|
-
|
|
7720
|
-
|
|
7721
|
-
|
|
7722
|
-
|
|
7723
|
-
|
|
7724
|
-
|
|
7725
|
-
|
|
7726
|
-
|
|
7727
|
-
|
|
7728
|
-
|
|
7729
|
-
|
|
7730
|
-
|
|
7731
|
-
|
|
7732
|
-
|
|
7733
|
-
|
|
7734
|
-
|
|
7735
|
-
|
|
7736
|
-
|
|
7737
|
-
|
|
7738
|
-
|
|
7739
|
-
|
|
7740
|
-
|
|
7741
|
-
|
|
7742
|
-
|
|
7743
|
-
|
|
7744
|
-
|
|
7745
|
-
|
|
7746
|
-
|
|
7747
|
-
|
|
7748
|
-
|
|
7749
|
-
|
|
7750
|
-
const
|
|
7751
|
-
|
|
7752
|
-
|
|
7753
|
-
|
|
7754
|
-
} : {
|
|
7755
|
-
width,
|
|
7756
|
-
height
|
|
7449
|
+
const viewBox = responsive ? `0 0 ${width} ${height}` : undefined;
|
|
7450
|
+
const preserveAspectRatio = responsive ? props.preserveAspectRatio : undefined;
|
|
7451
|
+
const ariaLabelledBy = [title && getIdForElement("title"), props["aria-labelledby"]].filter(Boolean).join(" ") || undefined;
|
|
7452
|
+
const ariaDescribedBy = [desc && getIdForElement("desc"), props["aria-describedby"]].filter(Boolean).join(" ") || undefined;
|
|
7453
|
+
const titleId = getIdForElement("title");
|
|
7454
|
+
const descId = getIdForElement("desc");
|
|
7455
|
+
return {
|
|
7456
|
+
...props,
|
|
7457
|
+
titleId,
|
|
7458
|
+
descId,
|
|
7459
|
+
dimensions,
|
|
7460
|
+
viewBox,
|
|
7461
|
+
preserveAspectRatio,
|
|
7462
|
+
ariaLabelledBy,
|
|
7463
|
+
ariaDescribedBy,
|
|
7464
|
+
userProps,
|
|
7465
|
+
localContainerRef
|
|
7466
|
+
};
|
|
7467
|
+
}
|
|
7468
|
+
const VictoryContainer = initialProps => {
|
|
7469
|
+
const {
|
|
7470
|
+
role,
|
|
7471
|
+
title,
|
|
7472
|
+
desc,
|
|
7473
|
+
children,
|
|
7474
|
+
className,
|
|
7475
|
+
portalZIndex,
|
|
7476
|
+
portalComponent,
|
|
7477
|
+
width,
|
|
7478
|
+
height,
|
|
7479
|
+
style,
|
|
7480
|
+
tabIndex,
|
|
7481
|
+
responsive,
|
|
7482
|
+
events,
|
|
7483
|
+
ouiaId,
|
|
7484
|
+
ouiaSafe,
|
|
7485
|
+
ouiaType,
|
|
7486
|
+
dimensions,
|
|
7487
|
+
ariaDescribedBy,
|
|
7488
|
+
ariaLabelledBy,
|
|
7489
|
+
viewBox,
|
|
7490
|
+
preserveAspectRatio,
|
|
7491
|
+
userProps,
|
|
7492
|
+
titleId,
|
|
7493
|
+
descId,
|
|
7494
|
+
containerRef,
|
|
7495
|
+
localContainerRef
|
|
7496
|
+
} = useVictoryContainer(initialProps);
|
|
7497
|
+
react__WEBPACK_IMPORTED_MODULE_1___default().useEffect(() => {
|
|
7498
|
+
if (!events?.onWheel) return;
|
|
7499
|
+
const handleWheel = e => e.preventDefault();
|
|
7500
|
+
const container = localContainerRef?.current;
|
|
7501
|
+
container?.addEventListener("wheel", handleWheel);
|
|
7502
|
+
return () => {
|
|
7503
|
+
container?.removeEventListener("wheel", handleWheel);
|
|
7757
7504
|
};
|
|
7758
|
-
|
|
7505
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
7506
|
+
}, []);
|
|
7507
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement("div", {
|
|
7508
|
+
className: className,
|
|
7509
|
+
style: {
|
|
7510
|
+
...style,
|
|
7511
|
+
width: responsive ? style?.width : dimensions.width,
|
|
7512
|
+
height: responsive ? style?.height : dimensions.height,
|
|
7759
7513
|
pointerEvents: "none",
|
|
7760
7514
|
touchAction: "none",
|
|
7761
7515
|
position: "relative"
|
|
7762
|
-
},
|
|
7763
|
-
|
|
7516
|
+
},
|
|
7517
|
+
"data-ouia-component-id": ouiaId,
|
|
7518
|
+
"data-ouia-component-type": ouiaType,
|
|
7519
|
+
"data-ouia-safe": ouiaSafe,
|
|
7520
|
+
ref: (0,_victory_util__WEBPACK_IMPORTED_MODULE_4__.mergeRefs)([localContainerRef, containerRef])
|
|
7521
|
+
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_victory_portal_portal_context__WEBPACK_IMPORTED_MODULE_5__.PortalProvider, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement("svg", _extends({
|
|
7522
|
+
width: width,
|
|
7523
|
+
height: height,
|
|
7524
|
+
tabIndex: tabIndex,
|
|
7525
|
+
role: role,
|
|
7526
|
+
"aria-labelledby": ariaLabelledBy,
|
|
7527
|
+
"aria-describedby": ariaDescribedBy,
|
|
7528
|
+
viewBox: viewBox,
|
|
7529
|
+
preserveAspectRatio: preserveAspectRatio,
|
|
7530
|
+
style: {
|
|
7531
|
+
...dimensions,
|
|
7532
|
+
pointerEvents: "all"
|
|
7533
|
+
}
|
|
7534
|
+
}, userProps, events), title ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement("title", {
|
|
7535
|
+
id: titleId
|
|
7536
|
+
}, title) : null, desc ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement("desc", {
|
|
7537
|
+
id: descId
|
|
7538
|
+
}, desc) : null, children), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement("div", {
|
|
7539
|
+
style: {
|
|
7540
|
+
...dimensions,
|
|
7764
7541
|
zIndex: portalZIndex,
|
|
7765
7542
|
position: "absolute",
|
|
7766
7543
|
top: 0,
|
|
7767
7544
|
left: 0
|
|
7768
|
-
}
|
|
7769
|
-
|
|
7770
|
-
|
|
7771
|
-
|
|
7772
|
-
|
|
7545
|
+
}
|
|
7546
|
+
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_victory_portal_portal_outlet__WEBPACK_IMPORTED_MODULE_6__.PortalOutlet, {
|
|
7547
|
+
as: portalComponent,
|
|
7548
|
+
width: width,
|
|
7549
|
+
height: height,
|
|
7550
|
+
viewBox: viewBox,
|
|
7551
|
+
preserveAspectRatio: preserveAspectRatio,
|
|
7552
|
+
style: {
|
|
7553
|
+
...dimensions,
|
|
7773
7554
|
overflow: "visible"
|
|
7774
|
-
}
|
|
7775
|
-
|
|
7776
|
-
|
|
7777
|
-
|
|
7778
|
-
viewBox: svgProps.viewBox,
|
|
7779
|
-
preserveAspectRatio: svgProps.preserveAspectRatio,
|
|
7780
|
-
style: portalSvgStyle
|
|
7781
|
-
};
|
|
7782
|
-
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(_victory_portal_portal_context__WEBPACK_IMPORTED_MODULE_7__.PortalContext.Provider, {
|
|
7783
|
-
value: {
|
|
7784
|
-
portalUpdate: this.portalUpdate,
|
|
7785
|
-
portalRegister: this.portalRegister,
|
|
7786
|
-
portalDeregister: this.portalDeregister
|
|
7787
|
-
}
|
|
7788
|
-
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement("div", _extends({
|
|
7789
|
-
style: lodash_defaults__WEBPACK_IMPORTED_MODULE_2___default()({}, style, divStyle),
|
|
7790
|
-
className: className,
|
|
7791
|
-
ref: this.saveContainerRef
|
|
7792
|
-
}, this.getOUIAProps(props)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement("svg", _extends({}, svgProps, {
|
|
7793
|
-
style: svgStyle
|
|
7794
|
-
}), title ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement("title", {
|
|
7795
|
-
id: this.getIdForElement("title")
|
|
7796
|
-
}, title) : null, desc ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement("desc", {
|
|
7797
|
-
id: this.getIdForElement("desc")
|
|
7798
|
-
}, desc) : null, children), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement("div", {
|
|
7799
|
-
style: portalDivStyle
|
|
7800
|
-
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().cloneElement(portalComponent, {
|
|
7801
|
-
...portalProps,
|
|
7802
|
-
ref: this.savePortalRef
|
|
7803
|
-
}))));
|
|
7804
|
-
}
|
|
7805
|
-
render() {
|
|
7806
|
-
const {
|
|
7807
|
-
width,
|
|
7808
|
-
height,
|
|
7809
|
-
responsive,
|
|
7810
|
-
events,
|
|
7811
|
-
title,
|
|
7812
|
-
desc,
|
|
7813
|
-
tabIndex,
|
|
7814
|
-
preserveAspectRatio,
|
|
7815
|
-
role
|
|
7816
|
-
} = this.props;
|
|
7817
|
-
const style = responsive ? this.props.style : _victory_util_helpers__WEBPACK_IMPORTED_MODULE_6__.omit(this.props.style, ["height", "width"]);
|
|
7818
|
-
const userProps = _victory_util_user_props__WEBPACK_IMPORTED_MODULE_8__.getSafeUserProps(this.props);
|
|
7819
|
-
const svgProps = Object.assign({
|
|
7820
|
-
width,
|
|
7821
|
-
height,
|
|
7822
|
-
tabIndex,
|
|
7823
|
-
role,
|
|
7824
|
-
"aria-labelledby": [title && this.getIdForElement("title"), this.props["aria-labelledby"]].filter(Boolean).join(" ") || undefined,
|
|
7825
|
-
"aria-describedby": [desc && this.getIdForElement("desc"), this.props["aria-describedby"]].filter(Boolean).join(" ") || undefined,
|
|
7826
|
-
viewBox: responsive ? `0 0 ${width} ${height}` : undefined,
|
|
7827
|
-
preserveAspectRatio: responsive ? preserveAspectRatio : undefined,
|
|
7828
|
-
...userProps
|
|
7829
|
-
}, events);
|
|
7830
|
-
return this.renderContainer(this.props, svgProps, style);
|
|
7831
|
-
}
|
|
7832
|
-
}
|
|
7555
|
+
}
|
|
7556
|
+
}))));
|
|
7557
|
+
};
|
|
7558
|
+
VictoryContainer.role = "container";
|
|
7833
7559
|
|
|
7834
7560
|
/***/ }),
|
|
7835
7561
|
|
|
@@ -8342,17 +8068,78 @@ VictoryLabel.defaultStyles = defaultStyles;
|
|
|
8342
8068
|
"use strict";
|
|
8343
8069
|
__webpack_require__.r(__webpack_exports__);
|
|
8344
8070
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
8345
|
-
/* harmony export */ "PortalContext": function() { return /* binding */ PortalContext; }
|
|
8071
|
+
/* harmony export */ "PortalContext": function() { return /* binding */ PortalContext; },
|
|
8072
|
+
/* harmony export */ "PortalProvider": function() { return /* binding */ PortalProvider; },
|
|
8073
|
+
/* harmony export */ "usePortalContext": function() { return /* binding */ usePortalContext; }
|
|
8346
8074
|
/* harmony export */ });
|
|
8347
8075
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
|
|
8348
8076
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
8349
8077
|
|
|
8350
|
-
|
|
8351
|
-
* The React context object consumers may use to access the context of the
|
|
8352
|
-
* portal.
|
|
8353
|
-
*/
|
|
8354
|
-
const PortalContext = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createContext({});
|
|
8078
|
+
const PortalContext = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createContext(undefined);
|
|
8355
8079
|
PortalContext.displayName = "PortalContext";
|
|
8080
|
+
const usePortalContext = () => {
|
|
8081
|
+
const context = react__WEBPACK_IMPORTED_MODULE_0___default().useContext(PortalContext);
|
|
8082
|
+
return context;
|
|
8083
|
+
};
|
|
8084
|
+
const PortalProvider = _ref => {
|
|
8085
|
+
let {
|
|
8086
|
+
children
|
|
8087
|
+
} = _ref;
|
|
8088
|
+
const [portalChildren, setPortalChildren] = react__WEBPACK_IMPORTED_MODULE_0___default().useState(new Map());
|
|
8089
|
+
const addChild = react__WEBPACK_IMPORTED_MODULE_0___default().useCallback((id, element) => {
|
|
8090
|
+
setPortalChildren(prevChildren => {
|
|
8091
|
+
const nextChildren = new Map(prevChildren);
|
|
8092
|
+
nextChildren.set(id, element);
|
|
8093
|
+
return nextChildren;
|
|
8094
|
+
});
|
|
8095
|
+
}, [setPortalChildren]);
|
|
8096
|
+
const removeChild = react__WEBPACK_IMPORTED_MODULE_0___default().useCallback(id => {
|
|
8097
|
+
setPortalChildren(prevChildren => {
|
|
8098
|
+
const nextChildren = new Map(prevChildren);
|
|
8099
|
+
nextChildren.delete(id);
|
|
8100
|
+
return nextChildren;
|
|
8101
|
+
});
|
|
8102
|
+
}, [setPortalChildren]);
|
|
8103
|
+
const contextValue = react__WEBPACK_IMPORTED_MODULE_0___default().useMemo(() => ({
|
|
8104
|
+
addChild,
|
|
8105
|
+
removeChild,
|
|
8106
|
+
children: portalChildren
|
|
8107
|
+
}), [addChild, removeChild, portalChildren]);
|
|
8108
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(PortalContext.Provider, {
|
|
8109
|
+
value: contextValue
|
|
8110
|
+
}, children);
|
|
8111
|
+
};
|
|
8112
|
+
|
|
8113
|
+
/***/ }),
|
|
8114
|
+
|
|
8115
|
+
/***/ "../../victory-core/es/victory-portal/portal-outlet.js":
|
|
8116
|
+
/*!*************************************************************!*\
|
|
8117
|
+
!*** ../../victory-core/es/victory-portal/portal-outlet.js ***!
|
|
8118
|
+
\*************************************************************/
|
|
8119
|
+
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
8120
|
+
|
|
8121
|
+
"use strict";
|
|
8122
|
+
__webpack_require__.r(__webpack_exports__);
|
|
8123
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
8124
|
+
/* harmony export */ "PortalOutlet": function() { return /* binding */ PortalOutlet; }
|
|
8125
|
+
/* harmony export */ });
|
|
8126
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
|
|
8127
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
8128
|
+
/* harmony import */ var _portal_context__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./portal-context */ "../../victory-core/es/victory-portal/portal-context.js");
|
|
8129
|
+
|
|
8130
|
+
|
|
8131
|
+
const PortalOutlet = _ref => {
|
|
8132
|
+
let {
|
|
8133
|
+
as: portalComponent,
|
|
8134
|
+
...props
|
|
8135
|
+
} = _ref;
|
|
8136
|
+
const portalContext = (0,_portal_context__WEBPACK_IMPORTED_MODULE_1__.usePortalContext)();
|
|
8137
|
+
if (!portalContext) {
|
|
8138
|
+
return null;
|
|
8139
|
+
}
|
|
8140
|
+
const children = Array.from(portalContext.children.values());
|
|
8141
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(portalComponent, props, children);
|
|
8142
|
+
};
|
|
8356
8143
|
|
|
8357
8144
|
/***/ }),
|
|
8358
8145
|
|
|
@@ -8369,39 +8156,13 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
8369
8156
|
/* harmony export */ });
|
|
8370
8157
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
|
|
8371
8158
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
8159
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : 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; }; return _extends.apply(this, arguments); }
|
|
8372
8160
|
|
|
8373
|
-
|
|
8374
|
-
|
|
8375
|
-
|
|
8376
|
-
|
|
8377
|
-
|
|
8378
|
-
this.index = 1;
|
|
8379
|
-
}
|
|
8380
|
-
portalRegister = () => {
|
|
8381
|
-
return ++this.index;
|
|
8382
|
-
};
|
|
8383
|
-
portalUpdate = (key, element) => {
|
|
8384
|
-
this.map[key] = element;
|
|
8385
|
-
this.forceUpdate();
|
|
8386
|
-
};
|
|
8387
|
-
portalDeregister = key => {
|
|
8388
|
-
delete this.map[key];
|
|
8389
|
-
this.forceUpdate();
|
|
8390
|
-
};
|
|
8391
|
-
getChildren() {
|
|
8392
|
-
return Object.keys(this.map).map(key => {
|
|
8393
|
-
const el = this.map[key];
|
|
8394
|
-
return el ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(el, {
|
|
8395
|
-
key
|
|
8396
|
-
}) : el;
|
|
8397
|
-
});
|
|
8398
|
-
}
|
|
8399
|
-
|
|
8400
|
-
// Overridden in victory-core-native
|
|
8401
|
-
render() {
|
|
8402
|
-
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("svg", this.props, this.getChildren());
|
|
8403
|
-
}
|
|
8404
|
-
}
|
|
8161
|
+
const Portal = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().forwardRef((props, ref) => {
|
|
8162
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("svg", _extends({
|
|
8163
|
+
ref: ref
|
|
8164
|
+
}, props));
|
|
8165
|
+
});
|
|
8405
8166
|
|
|
8406
8167
|
/***/ }),
|
|
8407
8168
|
|
|
@@ -8428,59 +8189,44 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
8428
8189
|
|
|
8429
8190
|
|
|
8430
8191
|
|
|
8431
|
-
|
|
8432
|
-
|
|
8433
|
-
|
|
8434
|
-
|
|
8435
|
-
|
|
8436
|
-
|
|
8437
|
-
|
|
8438
|
-
|
|
8439
|
-
|
|
8440
|
-
|
|
8441
|
-
|
|
8442
|
-
|
|
8443
|
-
|
|
8444
|
-
|
|
8445
|
-
|
|
8446
|
-
|
|
8447
|
-
|
|
8448
|
-
}
|
|
8449
|
-
|
|
8450
|
-
|
|
8451
|
-
|
|
8452
|
-
|
|
8453
|
-
|
|
8454
|
-
|
|
8455
|
-
|
|
8456
|
-
|
|
8457
|
-
|
|
8458
|
-
|
|
8459
|
-
|
|
8460
|
-
|
|
8461
|
-
|
|
8462
|
-
|
|
8463
|
-
|
|
8464
|
-
|
|
8465
|
-
|
|
8466
|
-
|
|
8467
|
-
|
|
8468
|
-
|
|
8469
|
-
render() {
|
|
8470
|
-
const children = Array.isArray(this.props.children) ? this.props.children[0] : this.props.children;
|
|
8471
|
-
const {
|
|
8472
|
-
groupComponent
|
|
8473
|
-
} = this.props;
|
|
8474
|
-
const childProps = children && children.props || {};
|
|
8475
|
-
const standardProps = childProps.groupComponent ? {
|
|
8476
|
-
groupComponent,
|
|
8477
|
-
standalone: false
|
|
8478
|
-
} : {};
|
|
8479
|
-
const newProps = lodash_defaults__WEBPACK_IMPORTED_MODULE_0___default()(standardProps, childProps, _victory_util_helpers__WEBPACK_IMPORTED_MODULE_4__.omit(this.props, ["children", "groupComponent"]));
|
|
8480
|
-
const child = children && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().cloneElement(children, newProps);
|
|
8481
|
-
return this.renderPortal(child);
|
|
8482
|
-
}
|
|
8483
|
-
}
|
|
8192
|
+
const defaultProps = {
|
|
8193
|
+
groupComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement("g", null)
|
|
8194
|
+
};
|
|
8195
|
+
const VictoryPortal = initialProps => {
|
|
8196
|
+
const props = {
|
|
8197
|
+
...defaultProps,
|
|
8198
|
+
...initialProps
|
|
8199
|
+
};
|
|
8200
|
+
const id = react__WEBPACK_IMPORTED_MODULE_1___default().useId();
|
|
8201
|
+
const portalContext = (0,_portal_context__WEBPACK_IMPORTED_MODULE_2__.usePortalContext)();
|
|
8202
|
+
if (!portalContext) {
|
|
8203
|
+
const msg = "`renderInPortal` is not supported outside of `VictoryContainer`. " + "Component will be rendered in place";
|
|
8204
|
+
_victory_util_log__WEBPACK_IMPORTED_MODULE_3__.warn(msg);
|
|
8205
|
+
}
|
|
8206
|
+
const children = Array.isArray(props.children) ? props.children[0] : props.children;
|
|
8207
|
+
const {
|
|
8208
|
+
groupComponent
|
|
8209
|
+
} = props;
|
|
8210
|
+
const childProps = children && children.props || {};
|
|
8211
|
+
const standardProps = childProps.groupComponent ? {
|
|
8212
|
+
groupComponent,
|
|
8213
|
+
standalone: false
|
|
8214
|
+
} : {};
|
|
8215
|
+
const newProps = lodash_defaults__WEBPACK_IMPORTED_MODULE_0___default()(standardProps, childProps, _victory_util_helpers__WEBPACK_IMPORTED_MODULE_4__.omit(props, ["children", "groupComponent"]), {
|
|
8216
|
+
key: childProps.key ?? id
|
|
8217
|
+
});
|
|
8218
|
+
const child = children && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().cloneElement(children, newProps);
|
|
8219
|
+
react__WEBPACK_IMPORTED_MODULE_1___default().useEffect(() => {
|
|
8220
|
+
portalContext?.addChild(id, child);
|
|
8221
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
8222
|
+
}, [props.children]);
|
|
8223
|
+
react__WEBPACK_IMPORTED_MODULE_1___default().useEffect(() => {
|
|
8224
|
+
return () => portalContext?.removeChild(id);
|
|
8225
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
8226
|
+
}, []);
|
|
8227
|
+
return portalContext ? null : child;
|
|
8228
|
+
};
|
|
8229
|
+
VictoryPortal.role = "portal";
|
|
8484
8230
|
|
|
8485
8231
|
/***/ }),
|
|
8486
8232
|
|
|
@@ -11884,6 +11630,44 @@ function warn(message) {
|
|
|
11884
11630
|
|
|
11885
11631
|
/***/ }),
|
|
11886
11632
|
|
|
11633
|
+
/***/ "../../victory-core/es/victory-util/merge-refs.js":
|
|
11634
|
+
/*!********************************************************!*\
|
|
11635
|
+
!*** ../../victory-core/es/victory-util/merge-refs.js ***!
|
|
11636
|
+
\********************************************************/
|
|
11637
|
+
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
11638
|
+
|
|
11639
|
+
"use strict";
|
|
11640
|
+
__webpack_require__.r(__webpack_exports__);
|
|
11641
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
11642
|
+
/* harmony export */ "mergeRefs": function() { return /* binding */ mergeRefs; }
|
|
11643
|
+
/* harmony export */ });
|
|
11644
|
+
/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./helpers */ "../../victory-core/es/victory-util/helpers.js");
|
|
11645
|
+
|
|
11646
|
+
/**
|
|
11647
|
+
* Used to merge multiple React refs into a single callback ref.
|
|
11648
|
+
*
|
|
11649
|
+
* @example
|
|
11650
|
+
* ```tsx
|
|
11651
|
+
* <div ref={mergeRefs([ref, forwardedRef])} />
|
|
11652
|
+
* ```
|
|
11653
|
+
*/
|
|
11654
|
+
function mergeRefs(refs) {
|
|
11655
|
+
return value => {
|
|
11656
|
+
refs.forEach(ref => {
|
|
11657
|
+
// If the ref is a function, it's a callback ref and we call it with the value.
|
|
11658
|
+
if (_helpers__WEBPACK_IMPORTED_MODULE_0__.isFunction(ref)) {
|
|
11659
|
+
ref(value);
|
|
11660
|
+
} else if (ref !== null && ref !== undefined) {
|
|
11661
|
+
// If the ref is an object (not null and not undefined), it's an object ref.
|
|
11662
|
+
// We assign the value to its 'current' property.
|
|
11663
|
+
ref.current = value;
|
|
11664
|
+
}
|
|
11665
|
+
});
|
|
11666
|
+
};
|
|
11667
|
+
}
|
|
11668
|
+
|
|
11669
|
+
/***/ }),
|
|
11670
|
+
|
|
11887
11671
|
/***/ "../../victory-core/es/victory-util/scale.js":
|
|
11888
11672
|
/*!***************************************************!*\
|
|
11889
11673
|
!*** ../../victory-core/es/victory-util/scale.js ***!
|
|
@@ -12556,98 +12340,6 @@ const approximateTextSize = (text, style) => _approximateTextSizeInternal.impl(t
|
|
|
12556
12340
|
|
|
12557
12341
|
/***/ }),
|
|
12558
12342
|
|
|
12559
|
-
/***/ "../../victory-core/es/victory-util/timer-context.js":
|
|
12560
|
-
/*!***********************************************************!*\
|
|
12561
|
-
!*** ../../victory-core/es/victory-util/timer-context.js ***!
|
|
12562
|
-
\***********************************************************/
|
|
12563
|
-
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
12564
|
-
|
|
12565
|
-
"use strict";
|
|
12566
|
-
__webpack_require__.r(__webpack_exports__);
|
|
12567
|
-
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
|
|
12568
|
-
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
12569
|
-
/* harmony import */ var _timer__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./timer */ "../../victory-core/es/victory-util/timer.js");
|
|
12570
|
-
|
|
12571
|
-
|
|
12572
|
-
|
|
12573
|
-
/**
|
|
12574
|
-
* The React context object consumers may use to access or override the global
|
|
12575
|
-
* timer.
|
|
12576
|
-
*/
|
|
12577
|
-
const TimerContext = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createContext({
|
|
12578
|
-
transitionTimer: new _timer__WEBPACK_IMPORTED_MODULE_1__["default"](),
|
|
12579
|
-
animationTimer: new _timer__WEBPACK_IMPORTED_MODULE_1__["default"]()
|
|
12580
|
-
});
|
|
12581
|
-
TimerContext.displayName = "TimerContext";
|
|
12582
|
-
/* harmony default export */ __webpack_exports__["default"] = (TimerContext);
|
|
12583
|
-
|
|
12584
|
-
/***/ }),
|
|
12585
|
-
|
|
12586
|
-
/***/ "../../victory-core/es/victory-util/timer.js":
|
|
12587
|
-
/*!***************************************************!*\
|
|
12588
|
-
!*** ../../victory-core/es/victory-util/timer.js ***!
|
|
12589
|
-
\***************************************************/
|
|
12590
|
-
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
12591
|
-
|
|
12592
|
-
"use strict";
|
|
12593
|
-
__webpack_require__.r(__webpack_exports__);
|
|
12594
|
-
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
12595
|
-
/* harmony export */ "default": function() { return /* binding */ Timer; }
|
|
12596
|
-
/* harmony export */ });
|
|
12597
|
-
/* harmony import */ var victory_vendor_d3_timer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! victory-vendor/d3-timer */ "../../victory-vendor/es/d3-timer.js");
|
|
12598
|
-
|
|
12599
|
-
class Timer {
|
|
12600
|
-
constructor() {
|
|
12601
|
-
this.shouldAnimate = true;
|
|
12602
|
-
this.subscribers = [];
|
|
12603
|
-
this.timer = null;
|
|
12604
|
-
this.activeSubscriptions = 0;
|
|
12605
|
-
}
|
|
12606
|
-
bypassAnimation() {
|
|
12607
|
-
this.shouldAnimate = false;
|
|
12608
|
-
}
|
|
12609
|
-
resumeAnimation() {
|
|
12610
|
-
this.shouldAnimate = true;
|
|
12611
|
-
}
|
|
12612
|
-
loop = () => {
|
|
12613
|
-
this.subscribers.forEach(s => {
|
|
12614
|
-
s.callback((0,victory_vendor_d3_timer__WEBPACK_IMPORTED_MODULE_0__.now)() - s.startTime, s.duration);
|
|
12615
|
-
});
|
|
12616
|
-
};
|
|
12617
|
-
start() {
|
|
12618
|
-
if (!this.timer) {
|
|
12619
|
-
this.timer = (0,victory_vendor_d3_timer__WEBPACK_IMPORTED_MODULE_0__.timer)(this.loop);
|
|
12620
|
-
}
|
|
12621
|
-
}
|
|
12622
|
-
stop() {
|
|
12623
|
-
if (this.timer) {
|
|
12624
|
-
this.timer.stop();
|
|
12625
|
-
this.timer = null;
|
|
12626
|
-
}
|
|
12627
|
-
}
|
|
12628
|
-
subscribe(callback, duration) {
|
|
12629
|
-
const subscriptionID = this.subscribers.push({
|
|
12630
|
-
startTime: (0,victory_vendor_d3_timer__WEBPACK_IMPORTED_MODULE_0__.now)(),
|
|
12631
|
-
callback,
|
|
12632
|
-
duration: this.shouldAnimate ? duration : 0
|
|
12633
|
-
});
|
|
12634
|
-
this.activeSubscriptions++;
|
|
12635
|
-
this.start();
|
|
12636
|
-
return subscriptionID;
|
|
12637
|
-
}
|
|
12638
|
-
unsubscribe(id) {
|
|
12639
|
-
if (id !== null && this.subscribers[id - 1]) {
|
|
12640
|
-
delete this.subscribers[id - 1];
|
|
12641
|
-
this.activeSubscriptions--;
|
|
12642
|
-
}
|
|
12643
|
-
if (this.activeSubscriptions === 0) {
|
|
12644
|
-
this.stop();
|
|
12645
|
-
}
|
|
12646
|
-
}
|
|
12647
|
-
}
|
|
12648
|
-
|
|
12649
|
-
/***/ }),
|
|
12650
|
-
|
|
12651
12343
|
/***/ "../../victory-core/es/victory-util/user-props.js":
|
|
12652
12344
|
/*!********************************************************!*\
|
|
12653
12345
|
!*** ../../victory-core/es/victory-util/user-props.js ***!
|
|
@@ -13323,8 +13015,9 @@ const CursorHelpers = new CursorHelpersClass();
|
|
|
13323
13015
|
"use strict";
|
|
13324
13016
|
__webpack_require__.r(__webpack_exports__);
|
|
13325
13017
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
13018
|
+
/* harmony export */ "VICTORY_CURSOR_CONTAINER_DEFAULT_PROPS": function() { return /* binding */ VICTORY_CURSOR_CONTAINER_DEFAULT_PROPS; },
|
|
13326
13019
|
/* harmony export */ "VictoryCursorContainer": function() { return /* binding */ VictoryCursorContainer; },
|
|
13327
|
-
/* harmony export */ "
|
|
13020
|
+
/* harmony export */ "useVictoryCursorContainer": function() { return /* binding */ useVictoryCursorContainer; }
|
|
13328
13021
|
/* harmony export */ });
|
|
13329
13022
|
/* harmony import */ var lodash_isObject__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash/isObject */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isObject.js");
|
|
13330
13023
|
/* harmony import */ var lodash_isObject__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_isObject__WEBPACK_IMPORTED_MODULE_0__);
|
|
@@ -13332,164 +13025,179 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
13332
13025
|
/* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_defaults__WEBPACK_IMPORTED_MODULE_1__);
|
|
13333
13026
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "react");
|
|
13334
13027
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__);
|
|
13335
|
-
/* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-
|
|
13336
|
-
/* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-
|
|
13337
|
-
/* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-
|
|
13338
|
-
/* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-
|
|
13028
|
+
/* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-label/victory-label.js");
|
|
13029
|
+
/* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-primitives/line-segment.js");
|
|
13030
|
+
/* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-util/helpers.js");
|
|
13031
|
+
/* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-container/victory-container.js");
|
|
13339
13032
|
/* harmony import */ var _cursor_helpers__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./cursor-helpers */ "../../victory-cursor-container/es/cursor-helpers.js");
|
|
13340
13033
|
|
|
13341
13034
|
|
|
13035
|
+
/* eslint-disable complexity */
|
|
13342
13036
|
|
|
13343
13037
|
|
|
13344
13038
|
|
|
13345
|
-
|
|
13346
|
-
|
|
13347
|
-
|
|
13348
|
-
|
|
13349
|
-
|
|
13350
|
-
|
|
13351
|
-
|
|
13352
|
-
|
|
13353
|
-
|
|
13354
|
-
|
|
13355
|
-
|
|
13356
|
-
|
|
13357
|
-
|
|
13358
|
-
|
|
13359
|
-
|
|
13360
|
-
|
|
13361
|
-
|
|
13362
|
-
|
|
13363
|
-
|
|
13364
|
-
|
|
13365
|
-
|
|
13366
|
-
|
|
13367
|
-
|
|
13368
|
-
|
|
13369
|
-
|
|
13370
|
-
},
|
|
13371
|
-
onTouchMove: (evt, targetProps) => {
|
|
13372
|
-
return props.disable ? {} : _cursor_helpers__WEBPACK_IMPORTED_MODULE_6__.CursorHelpers.onMouseMove(evt, targetProps);
|
|
13373
|
-
}
|
|
13374
|
-
}
|
|
13375
|
-
}];
|
|
13039
|
+
const VICTORY_CURSOR_CONTAINER_DEFAULT_PROPS = {
|
|
13040
|
+
cursorLabelComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(victory_core__WEBPACK_IMPORTED_MODULE_3__.VictoryLabel, null),
|
|
13041
|
+
cursorLabelOffset: {
|
|
13042
|
+
x: 5,
|
|
13043
|
+
y: -10
|
|
13044
|
+
},
|
|
13045
|
+
cursorComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(victory_core__WEBPACK_IMPORTED_MODULE_4__.LineSegment, null)
|
|
13046
|
+
};
|
|
13047
|
+
const useVictoryCursorContainer = initialProps => {
|
|
13048
|
+
const props = {
|
|
13049
|
+
...VICTORY_CURSOR_CONTAINER_DEFAULT_PROPS,
|
|
13050
|
+
...initialProps
|
|
13051
|
+
};
|
|
13052
|
+
const {
|
|
13053
|
+
children
|
|
13054
|
+
} = props;
|
|
13055
|
+
const getCursorPosition = () => {
|
|
13056
|
+
const {
|
|
13057
|
+
cursorValue,
|
|
13058
|
+
defaultCursorValue,
|
|
13059
|
+
domain,
|
|
13060
|
+
cursorDimension
|
|
13061
|
+
} = props;
|
|
13062
|
+
if (cursorValue) {
|
|
13063
|
+
return cursorValue;
|
|
13376
13064
|
}
|
|
13377
|
-
|
|
13378
|
-
|
|
13379
|
-
|
|
13380
|
-
|
|
13381
|
-
|
|
13382
|
-
cursorDimension
|
|
13383
|
-
} = props;
|
|
13384
|
-
if (cursorValue) {
|
|
13385
|
-
return cursorValue;
|
|
13386
|
-
}
|
|
13387
|
-
if (typeof defaultCursorValue === "number") {
|
|
13388
|
-
return {
|
|
13389
|
-
x: (domain.x[0] + domain.x[1]) / 2,
|
|
13390
|
-
y: (domain.y[0] + domain.y[1]) / 2,
|
|
13065
|
+
if (typeof defaultCursorValue === "number") {
|
|
13066
|
+
return {
|
|
13067
|
+
x: (domain.x[0] + domain.x[1]) / 2,
|
|
13068
|
+
y: (domain.y[0] + domain.y[1]) / 2,
|
|
13069
|
+
...(cursorDimension ? {
|
|
13391
13070
|
[cursorDimension]: defaultCursorValue
|
|
13392
|
-
}
|
|
13393
|
-
}
|
|
13394
|
-
return defaultCursorValue;
|
|
13071
|
+
} : {})
|
|
13072
|
+
};
|
|
13395
13073
|
}
|
|
13396
|
-
|
|
13397
|
-
|
|
13398
|
-
|
|
13399
|
-
|
|
13400
|
-
|
|
13401
|
-
|
|
13402
|
-
|
|
13403
|
-
|
|
13404
|
-
|
|
13405
|
-
|
|
13406
|
-
|
|
13074
|
+
return defaultCursorValue;
|
|
13075
|
+
};
|
|
13076
|
+
const getCursorLabelOffset = () => {
|
|
13077
|
+
const {
|
|
13078
|
+
cursorLabelOffset
|
|
13079
|
+
} = props;
|
|
13080
|
+
if (typeof cursorLabelOffset === "number") {
|
|
13081
|
+
return {
|
|
13082
|
+
x: cursorLabelOffset,
|
|
13083
|
+
y: cursorLabelOffset
|
|
13084
|
+
};
|
|
13407
13085
|
}
|
|
13408
|
-
|
|
13409
|
-
|
|
13410
|
-
|
|
13411
|
-
|
|
13412
|
-
|
|
13413
|
-
return
|
|
13414
|
-
}
|
|
13415
|
-
return
|
|
13086
|
+
return cursorLabelOffset;
|
|
13087
|
+
};
|
|
13088
|
+
const getPadding = () => {
|
|
13089
|
+
if (props.padding === undefined) {
|
|
13090
|
+
const child = Array.isArray(props.children) ? props.children.find(c => {
|
|
13091
|
+
return lodash_isObject__WEBPACK_IMPORTED_MODULE_0___default()(c.props) && c.props.padding !== undefined;
|
|
13092
|
+
}) : props.children;
|
|
13093
|
+
return victory_core__WEBPACK_IMPORTED_MODULE_5__.getPadding(child?.props);
|
|
13416
13094
|
}
|
|
13417
|
-
|
|
13418
|
-
|
|
13419
|
-
|
|
13420
|
-
|
|
13421
|
-
|
|
13422
|
-
|
|
13423
|
-
|
|
13424
|
-
|
|
13425
|
-
|
|
13426
|
-
|
|
13427
|
-
|
|
13428
|
-
|
|
13429
|
-
|
|
13430
|
-
|
|
13431
|
-
|
|
13432
|
-
|
|
13433
|
-
|
|
13434
|
-
|
|
13435
|
-
|
|
13436
|
-
|
|
13437
|
-
const padding = this.getPadding(props);
|
|
13438
|
-
const cursorCoordinates = {
|
|
13439
|
-
x: horizontal ? scale.y(cursorValue.y) : scale.x(cursorValue.x),
|
|
13440
|
-
y: horizontal ? scale.x(cursorValue.x) : scale.y(cursorValue.y)
|
|
13441
|
-
};
|
|
13442
|
-
if (cursorLabel) {
|
|
13443
|
-
let labelProps = lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({
|
|
13444
|
-
active: true
|
|
13445
|
-
}, cursorLabelComponent.props, {
|
|
13446
|
-
x: cursorCoordinates.x + cursorLabelOffset.x,
|
|
13447
|
-
y: cursorCoordinates.y + cursorLabelOffset.y,
|
|
13448
|
-
datum: cursorValue,
|
|
13449
|
-
active: true,
|
|
13450
|
-
key: `${name}-cursor-label`
|
|
13451
|
-
});
|
|
13452
|
-
if (victory_core__WEBPACK_IMPORTED_MODULE_7__.isTooltip(cursorLabelComponent)) {
|
|
13453
|
-
const tooltipTheme = theme && theme.tooltip || {};
|
|
13454
|
-
labelProps = lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({}, labelProps, tooltipTheme);
|
|
13455
|
-
}
|
|
13456
|
-
newElements.push( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().cloneElement(cursorLabelComponent, lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({}, labelProps, {
|
|
13457
|
-
text: victory_core__WEBPACK_IMPORTED_MODULE_7__.evaluateProp(cursorLabel, labelProps)
|
|
13458
|
-
})));
|
|
13459
|
-
}
|
|
13460
|
-
const cursorStyle = Object.assign({
|
|
13461
|
-
stroke: "black"
|
|
13462
|
-
}, cursorComponent.props.style);
|
|
13463
|
-
if (cursorDimension === "x" || cursorDimension === undefined) {
|
|
13464
|
-
newElements.push( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().cloneElement(cursorComponent, {
|
|
13465
|
-
key: `${name}-x-cursor`,
|
|
13466
|
-
x1: cursorCoordinates.x,
|
|
13467
|
-
x2: cursorCoordinates.x,
|
|
13468
|
-
y1: padding.top,
|
|
13469
|
-
y2: height - padding.bottom,
|
|
13470
|
-
style: cursorStyle
|
|
13471
|
-
}));
|
|
13472
|
-
}
|
|
13473
|
-
if (cursorDimension === "y" || cursorDimension === undefined) {
|
|
13474
|
-
newElements.push( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().cloneElement(cursorComponent, {
|
|
13475
|
-
key: `${name}-y-cursor`,
|
|
13476
|
-
x1: padding.left,
|
|
13477
|
-
x2: width - padding.right,
|
|
13478
|
-
y1: cursorCoordinates.y,
|
|
13479
|
-
y2: cursorCoordinates.y,
|
|
13480
|
-
style: cursorStyle
|
|
13481
|
-
}));
|
|
13482
|
-
}
|
|
13483
|
-
return newElements;
|
|
13095
|
+
return victory_core__WEBPACK_IMPORTED_MODULE_5__.getPadding(props);
|
|
13096
|
+
};
|
|
13097
|
+
const getCursorElements = () => {
|
|
13098
|
+
// eslint-disable-line max-statements
|
|
13099
|
+
const {
|
|
13100
|
+
scale,
|
|
13101
|
+
cursorLabelComponent,
|
|
13102
|
+
cursorLabel,
|
|
13103
|
+
cursorComponent,
|
|
13104
|
+
width,
|
|
13105
|
+
height,
|
|
13106
|
+
name,
|
|
13107
|
+
horizontal,
|
|
13108
|
+
theme
|
|
13109
|
+
} = props;
|
|
13110
|
+
const cursorDimension = _cursor_helpers__WEBPACK_IMPORTED_MODULE_6__.CursorHelpers.getDimension(props);
|
|
13111
|
+
const cursorValue = getCursorPosition();
|
|
13112
|
+
const cursorLabelOffset = getCursorLabelOffset();
|
|
13113
|
+
if (!cursorValue) {
|
|
13114
|
+
return [];
|
|
13484
13115
|
}
|
|
13485
|
-
|
|
13486
|
-
|
|
13487
|
-
|
|
13488
|
-
|
|
13116
|
+
const newElements = [];
|
|
13117
|
+
const padding = getPadding();
|
|
13118
|
+
const cursorCoordinates = scale && "x" in scale && "y" in scale && typeof scale.y === "function" && typeof scale.x === "function" ? {
|
|
13119
|
+
x: horizontal ? scale.y(cursorValue.y) : scale.x(cursorValue.x),
|
|
13120
|
+
y: horizontal ? scale.x(cursorValue.x) : scale.y(cursorValue.y)
|
|
13121
|
+
} : {
|
|
13122
|
+
x: cursorValue.x,
|
|
13123
|
+
y: cursorValue.y
|
|
13124
|
+
};
|
|
13125
|
+
if (cursorLabel) {
|
|
13126
|
+
let labelProps = lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({
|
|
13127
|
+
active: true
|
|
13128
|
+
}, cursorLabelComponent.props, {
|
|
13129
|
+
x: cursorCoordinates.x + cursorLabelOffset.x,
|
|
13130
|
+
y: cursorCoordinates.y + cursorLabelOffset.y,
|
|
13131
|
+
datum: cursorValue,
|
|
13132
|
+
active: true,
|
|
13133
|
+
key: `${name}-cursor-label`
|
|
13134
|
+
});
|
|
13135
|
+
if (victory_core__WEBPACK_IMPORTED_MODULE_5__.isTooltip(cursorLabelComponent)) {
|
|
13136
|
+
const tooltipTheme = theme && theme.tooltip || {};
|
|
13137
|
+
labelProps = lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({}, labelProps, tooltipTheme);
|
|
13138
|
+
}
|
|
13139
|
+
newElements.push( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().cloneElement(cursorLabelComponent, lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({}, labelProps, {
|
|
13140
|
+
text: victory_core__WEBPACK_IMPORTED_MODULE_5__.evaluateProp(cursorLabel, labelProps)
|
|
13141
|
+
})));
|
|
13489
13142
|
}
|
|
13143
|
+
const cursorStyle = Object.assign({
|
|
13144
|
+
stroke: "black"
|
|
13145
|
+
}, cursorComponent.props.style);
|
|
13146
|
+
if (cursorDimension === "x" || cursorDimension === undefined) {
|
|
13147
|
+
newElements.push( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().cloneElement(cursorComponent, {
|
|
13148
|
+
key: `${name}-x-cursor`,
|
|
13149
|
+
x1: cursorCoordinates.x,
|
|
13150
|
+
x2: cursorCoordinates.x,
|
|
13151
|
+
y1: padding.top,
|
|
13152
|
+
y2: (typeof height === "number" ? height : 0) - padding.bottom,
|
|
13153
|
+
style: cursorStyle
|
|
13154
|
+
}));
|
|
13155
|
+
}
|
|
13156
|
+
if (cursorDimension === "y" || cursorDimension === undefined) {
|
|
13157
|
+
newElements.push( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().cloneElement(cursorComponent, {
|
|
13158
|
+
key: `${name}-y-cursor`,
|
|
13159
|
+
x1: padding.left,
|
|
13160
|
+
x2: (typeof width === "number" ? width : 0) - padding.right,
|
|
13161
|
+
y1: cursorCoordinates.y,
|
|
13162
|
+
y2: cursorCoordinates.y,
|
|
13163
|
+
style: cursorStyle
|
|
13164
|
+
}));
|
|
13165
|
+
}
|
|
13166
|
+
return newElements;
|
|
13490
13167
|
};
|
|
13491
|
-
|
|
13492
|
-
|
|
13168
|
+
return {
|
|
13169
|
+
props,
|
|
13170
|
+
children: [...react__WEBPACK_IMPORTED_MODULE_2___default().Children.toArray(children), ...getCursorElements()]
|
|
13171
|
+
};
|
|
13172
|
+
};
|
|
13173
|
+
const VictoryCursorContainer = initialProps => {
|
|
13174
|
+
const {
|
|
13175
|
+
props,
|
|
13176
|
+
children
|
|
13177
|
+
} = useVictoryCursorContainer(initialProps);
|
|
13178
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(victory_core__WEBPACK_IMPORTED_MODULE_7__.VictoryContainer, props, children);
|
|
13179
|
+
};
|
|
13180
|
+
VictoryCursorContainer.role = "container";
|
|
13181
|
+
VictoryCursorContainer.defaultEvents = initialProps => {
|
|
13182
|
+
const props = {
|
|
13183
|
+
...VICTORY_CURSOR_CONTAINER_DEFAULT_PROPS,
|
|
13184
|
+
...initialProps
|
|
13185
|
+
};
|
|
13186
|
+
const createEventHandler = (handler, disabled) =>
|
|
13187
|
+
// eslint-disable-next-line max-params
|
|
13188
|
+
(event, targetProps, eventKey, context) => disabled || props.disable ? {} : handler(event, {
|
|
13189
|
+
...props,
|
|
13190
|
+
...targetProps
|
|
13191
|
+
}, eventKey, context);
|
|
13192
|
+
return [{
|
|
13193
|
+
target: "parent",
|
|
13194
|
+
eventHandlers: {
|
|
13195
|
+
onMouseLeave: createEventHandler(_cursor_helpers__WEBPACK_IMPORTED_MODULE_6__.CursorHelpers.onMouseLeave),
|
|
13196
|
+
onMouseMove: createEventHandler(_cursor_helpers__WEBPACK_IMPORTED_MODULE_6__.CursorHelpers.onMouseMove),
|
|
13197
|
+
onTouchMove: createEventHandler(_cursor_helpers__WEBPACK_IMPORTED_MODULE_6__.CursorHelpers.onMouseMove)
|
|
13198
|
+
}
|
|
13199
|
+
}];
|
|
13200
|
+
};
|
|
13493
13201
|
|
|
13494
13202
|
/***/ }),
|
|
13495
13203
|
|
|
@@ -13745,88 +13453,91 @@ const SelectionHelpers = new SelectionHelpersClass();
|
|
|
13745
13453
|
"use strict";
|
|
13746
13454
|
__webpack_require__.r(__webpack_exports__);
|
|
13747
13455
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
13456
|
+
/* harmony export */ "VICTORY_SELECTION_CONTAINER_DEFAULT_PROPS": function() { return /* binding */ VICTORY_SELECTION_CONTAINER_DEFAULT_PROPS; },
|
|
13748
13457
|
/* harmony export */ "VictorySelectionContainer": function() { return /* binding */ VictorySelectionContainer; },
|
|
13749
|
-
/* harmony export */ "
|
|
13458
|
+
/* harmony export */ "useVictorySelectionContainer": function() { return /* binding */ useVictorySelectionContainer; }
|
|
13750
13459
|
/* harmony export */ });
|
|
13751
13460
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
|
|
13752
13461
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
13753
|
-
/* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-
|
|
13754
|
-
/* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-
|
|
13462
|
+
/* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-primitives/rect.js");
|
|
13463
|
+
/* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-container/victory-container.js");
|
|
13755
13464
|
/* harmony import */ var _selection_helpers__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./selection-helpers */ "../../victory-selection-container/es/selection-helpers.js");
|
|
13756
13465
|
|
|
13757
13466
|
|
|
13758
13467
|
|
|
13759
|
-
|
|
13760
|
-
|
|
13761
|
-
|
|
13762
|
-
|
|
13763
|
-
|
|
13764
|
-
|
|
13765
|
-
|
|
13766
|
-
|
|
13767
|
-
|
|
13768
|
-
|
|
13769
|
-
|
|
13770
|
-
|
|
13771
|
-
|
|
13772
|
-
|
|
13773
|
-
};
|
|
13774
|
-
static defaultEvents(props) {
|
|
13775
|
-
return [{
|
|
13776
|
-
target: "parent",
|
|
13777
|
-
eventHandlers: {
|
|
13778
|
-
onMouseDown: (evt, targetProps) => {
|
|
13779
|
-
return props.disable ? {} : _selection_helpers__WEBPACK_IMPORTED_MODULE_3__.SelectionHelpers.onMouseDown(evt, targetProps);
|
|
13780
|
-
},
|
|
13781
|
-
onTouchStart: (evt, targetProps) => {
|
|
13782
|
-
return props.disable ? {} : _selection_helpers__WEBPACK_IMPORTED_MODULE_3__.SelectionHelpers.onMouseDown(evt, targetProps);
|
|
13783
|
-
},
|
|
13784
|
-
onMouseMove: (evt, targetProps) => {
|
|
13785
|
-
return props.disable ? {} : _selection_helpers__WEBPACK_IMPORTED_MODULE_3__.SelectionHelpers.onMouseMove(evt, targetProps);
|
|
13786
|
-
},
|
|
13787
|
-
onTouchMove: (evt, targetProps) => {
|
|
13788
|
-
return props.disable ? {} : _selection_helpers__WEBPACK_IMPORTED_MODULE_3__.SelectionHelpers.onMouseMove(evt, targetProps);
|
|
13789
|
-
},
|
|
13790
|
-
onMouseUp: (evt, targetProps) => {
|
|
13791
|
-
return props.disable ? {} : _selection_helpers__WEBPACK_IMPORTED_MODULE_3__.SelectionHelpers.onMouseUp(evt, targetProps);
|
|
13792
|
-
},
|
|
13793
|
-
onTouchEnd: (evt, targetProps) => {
|
|
13794
|
-
return props.disable ? {} : _selection_helpers__WEBPACK_IMPORTED_MODULE_3__.SelectionHelpers.onMouseUp(evt, targetProps);
|
|
13795
|
-
}
|
|
13796
|
-
}
|
|
13797
|
-
}];
|
|
13798
|
-
}
|
|
13799
|
-
getRect(props) {
|
|
13800
|
-
const {
|
|
13801
|
-
x1,
|
|
13802
|
-
x2,
|
|
13803
|
-
y1,
|
|
13804
|
-
y2,
|
|
13805
|
-
selectionStyle,
|
|
13806
|
-
selectionComponent,
|
|
13807
|
-
name
|
|
13808
|
-
} = props;
|
|
13809
|
-
const width = Math.abs(x2 - x1) || 1;
|
|
13810
|
-
const height = Math.abs(y2 - y1) || 1;
|
|
13811
|
-
const x = Math.min(x1, x2);
|
|
13812
|
-
const y = Math.min(y1, y2);
|
|
13813
|
-
return y2 && x2 && x1 && y1 ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(selectionComponent, {
|
|
13814
|
-
key: `${name}-selection`,
|
|
13815
|
-
x,
|
|
13816
|
-
y,
|
|
13817
|
-
width,
|
|
13818
|
-
height,
|
|
13819
|
-
style: selectionStyle
|
|
13820
|
-
}) : null;
|
|
13821
|
-
}
|
|
13822
|
-
|
|
13823
|
-
// Overrides method in VictoryContainer
|
|
13824
|
-
getChildren(props) {
|
|
13825
|
-
return [...react__WEBPACK_IMPORTED_MODULE_0___default().Children.toArray(props.children), this.getRect(props)];
|
|
13826
|
-
}
|
|
13468
|
+
const VICTORY_SELECTION_CONTAINER_DEFAULT_PROPS = {
|
|
13469
|
+
activateSelectedData: true,
|
|
13470
|
+
allowSelection: true,
|
|
13471
|
+
selectionComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(victory_core__WEBPACK_IMPORTED_MODULE_1__.Rect, null),
|
|
13472
|
+
selectionStyle: {
|
|
13473
|
+
stroke: "transparent",
|
|
13474
|
+
fill: "black",
|
|
13475
|
+
fillOpacity: 0.1
|
|
13476
|
+
}
|
|
13477
|
+
};
|
|
13478
|
+
const useVictorySelectionContainer = initialProps => {
|
|
13479
|
+
const props = {
|
|
13480
|
+
...VICTORY_SELECTION_CONTAINER_DEFAULT_PROPS,
|
|
13481
|
+
...initialProps
|
|
13827
13482
|
};
|
|
13828
|
-
|
|
13829
|
-
|
|
13483
|
+
const {
|
|
13484
|
+
x1,
|
|
13485
|
+
x2,
|
|
13486
|
+
y1,
|
|
13487
|
+
y2,
|
|
13488
|
+
selectionStyle,
|
|
13489
|
+
selectionComponent,
|
|
13490
|
+
children,
|
|
13491
|
+
name
|
|
13492
|
+
} = props;
|
|
13493
|
+
const width = Math.abs(x2 - x1) || 1;
|
|
13494
|
+
const height = Math.abs(y2 - y1) || 1;
|
|
13495
|
+
const x = Math.min(x1, x2);
|
|
13496
|
+
const y = Math.min(y1, y2);
|
|
13497
|
+
const shouldRenderRect = y1 && y2 && x1 && x2;
|
|
13498
|
+
return {
|
|
13499
|
+
props,
|
|
13500
|
+
children: [children, shouldRenderRect && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(selectionComponent, {
|
|
13501
|
+
key: `${name}-selection`,
|
|
13502
|
+
x,
|
|
13503
|
+
y,
|
|
13504
|
+
width,
|
|
13505
|
+
height,
|
|
13506
|
+
style: selectionStyle
|
|
13507
|
+
})]
|
|
13508
|
+
};
|
|
13509
|
+
};
|
|
13510
|
+
const VictorySelectionContainer = initialProps => {
|
|
13511
|
+
const {
|
|
13512
|
+
props,
|
|
13513
|
+
children
|
|
13514
|
+
} = useVictorySelectionContainer(initialProps);
|
|
13515
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(victory_core__WEBPACK_IMPORTED_MODULE_2__.VictoryContainer, props, children);
|
|
13516
|
+
};
|
|
13517
|
+
VictorySelectionContainer.role = "container";
|
|
13518
|
+
VictorySelectionContainer.defaultEvents = initialProps => {
|
|
13519
|
+
const props = {
|
|
13520
|
+
...VICTORY_SELECTION_CONTAINER_DEFAULT_PROPS,
|
|
13521
|
+
...initialProps
|
|
13522
|
+
};
|
|
13523
|
+
const createEventHandler = (handler, disabled) =>
|
|
13524
|
+
// eslint-disable-next-line max-params
|
|
13525
|
+
(event, targetProps, eventKey, context) => disabled || props.disable ? {} : handler(event, {
|
|
13526
|
+
...props,
|
|
13527
|
+
...targetProps
|
|
13528
|
+
}, eventKey, context);
|
|
13529
|
+
return [{
|
|
13530
|
+
target: "parent",
|
|
13531
|
+
eventHandlers: {
|
|
13532
|
+
onMouseDown: createEventHandler(_selection_helpers__WEBPACK_IMPORTED_MODULE_3__.SelectionHelpers.onMouseDown),
|
|
13533
|
+
onTouchStart: createEventHandler(_selection_helpers__WEBPACK_IMPORTED_MODULE_3__.SelectionHelpers.onMouseDown),
|
|
13534
|
+
onMouseMove: createEventHandler(_selection_helpers__WEBPACK_IMPORTED_MODULE_3__.SelectionHelpers.onMouseMove),
|
|
13535
|
+
onTouchMove: createEventHandler(_selection_helpers__WEBPACK_IMPORTED_MODULE_3__.SelectionHelpers.onMouseMove),
|
|
13536
|
+
onMouseUp: createEventHandler(_selection_helpers__WEBPACK_IMPORTED_MODULE_3__.SelectionHelpers.onMouseUp),
|
|
13537
|
+
onTouchEnd: createEventHandler(_selection_helpers__WEBPACK_IMPORTED_MODULE_3__.SelectionHelpers.onMouseUp)
|
|
13538
|
+
}
|
|
13539
|
+
}];
|
|
13540
|
+
};
|
|
13830
13541
|
|
|
13831
13542
|
/***/ }),
|
|
13832
13543
|
|
|
@@ -14487,7 +14198,7 @@ class VictoryTooltip extends (react__WEBPACK_IMPORTED_MODULE_4___default().Compo
|
|
|
14487
14198
|
renderInPortal
|
|
14488
14199
|
} = props;
|
|
14489
14200
|
if (!active) {
|
|
14490
|
-
return
|
|
14201
|
+
return null;
|
|
14491
14202
|
}
|
|
14492
14203
|
const evaluatedProps = this.getEvaluatedProps(props);
|
|
14493
14204
|
const {
|
|
@@ -14558,32 +14269,6 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
14558
14269
|
|
|
14559
14270
|
|
|
14560
14271
|
|
|
14561
|
-
/***/ }),
|
|
14562
|
-
|
|
14563
|
-
/***/ "../../victory-vendor/es/d3-timer.js":
|
|
14564
|
-
/*!*******************************************!*\
|
|
14565
|
-
!*** ../../victory-vendor/es/d3-timer.js ***!
|
|
14566
|
-
\*******************************************/
|
|
14567
|
-
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
14568
|
-
|
|
14569
|
-
"use strict";
|
|
14570
|
-
__webpack_require__.r(__webpack_exports__);
|
|
14571
|
-
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
14572
|
-
/* harmony export */ "interval": function() { return /* reexport safe */ d3_timer__WEBPACK_IMPORTED_MODULE_0__.interval; },
|
|
14573
|
-
/* harmony export */ "now": function() { return /* reexport safe */ d3_timer__WEBPACK_IMPORTED_MODULE_0__.now; },
|
|
14574
|
-
/* harmony export */ "timeout": function() { return /* reexport safe */ d3_timer__WEBPACK_IMPORTED_MODULE_0__.timeout; },
|
|
14575
|
-
/* harmony export */ "timer": function() { return /* reexport safe */ d3_timer__WEBPACK_IMPORTED_MODULE_0__.timer; },
|
|
14576
|
-
/* harmony export */ "timerFlush": function() { return /* reexport safe */ d3_timer__WEBPACK_IMPORTED_MODULE_0__.timerFlush; }
|
|
14577
|
-
/* harmony export */ });
|
|
14578
|
-
/* harmony import */ var d3_timer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3-timer */ "../../../node_modules/.pnpm/d3-timer@3.0.1/node_modules/d3-timer/src/index.js");
|
|
14579
|
-
|
|
14580
|
-
// `victory-vendor/d3-timer` (ESM)
|
|
14581
|
-
// See upstream license: https://github.com/d3/d3-timer/blob/main/LICENSE
|
|
14582
|
-
//
|
|
14583
|
-
// Our ESM package uses the underlying installed dependencies of `node_modules/d3-timer`
|
|
14584
|
-
|
|
14585
|
-
|
|
14586
|
-
|
|
14587
14272
|
/***/ }),
|
|
14588
14273
|
|
|
14589
14274
|
/***/ "../../victory-voronoi-container/es/victory-voronoi-container.js":
|
|
@@ -14595,8 +14280,9 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
14595
14280
|
"use strict";
|
|
14596
14281
|
__webpack_require__.r(__webpack_exports__);
|
|
14597
14282
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
14283
|
+
/* harmony export */ "VICTORY_VORONOI_CONTAINER_DEFAULT_PROPS": function() { return /* binding */ VICTORY_VORONOI_CONTAINER_DEFAULT_PROPS; },
|
|
14598
14284
|
/* harmony export */ "VictoryVoronoiContainer": function() { return /* binding */ VictoryVoronoiContainer; },
|
|
14599
|
-
/* harmony export */ "
|
|
14285
|
+
/* harmony export */ "useVictoryVoronoiContainer": function() { return /* binding */ useVictoryVoronoiContainer; }
|
|
14600
14286
|
/* harmony export */ });
|
|
14601
14287
|
/* harmony import */ var lodash_pick__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash/pick */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/pick.js");
|
|
14602
14288
|
/* harmony import */ var lodash_pick__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_pick__WEBPACK_IMPORTED_MODULE_0__);
|
|
@@ -14604,10 +14290,10 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
14604
14290
|
/* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_defaults__WEBPACK_IMPORTED_MODULE_1__);
|
|
14605
14291
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "react");
|
|
14606
14292
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__);
|
|
14607
|
-
/* harmony import */ var
|
|
14608
|
-
/* harmony import */ var
|
|
14609
|
-
/* harmony import */ var
|
|
14610
|
-
/* harmony import */ var
|
|
14293
|
+
/* harmony import */ var victory_tooltip__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! victory-tooltip */ "../../victory-tooltip/es/victory-tooltip.js");
|
|
14294
|
+
/* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-util/helpers.js");
|
|
14295
|
+
/* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-container/victory-container.js");
|
|
14296
|
+
/* harmony import */ var _voronoi_helpers__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./voronoi-helpers */ "../../victory-voronoi-container/es/voronoi-helpers.js");
|
|
14611
14297
|
|
|
14612
14298
|
|
|
14613
14299
|
/* eslint-disable react/no-multi-comp */
|
|
@@ -14615,204 +14301,214 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
14615
14301
|
|
|
14616
14302
|
|
|
14617
14303
|
|
|
14618
|
-
|
|
14619
|
-
|
|
14620
|
-
|
|
14621
|
-
|
|
14622
|
-
|
|
14623
|
-
|
|
14624
|
-
|
|
14625
|
-
|
|
14626
|
-
|
|
14627
|
-
|
|
14628
|
-
|
|
14629
|
-
|
|
14630
|
-
|
|
14631
|
-
|
|
14632
|
-
|
|
14633
|
-
|
|
14634
|
-
|
|
14635
|
-
|
|
14636
|
-
|
|
14637
|
-
|
|
14638
|
-
|
|
14639
|
-
|
|
14640
|
-
|
|
14641
|
-
|
|
14642
|
-
|
|
14643
|
-
return props.disable ? {} : _voronoi_helpers__WEBPACK_IMPORTED_MODULE_5__.VoronoiHelpers.onMouseMove(evt, targetProps);
|
|
14644
|
-
}
|
|
14645
|
-
}
|
|
14646
|
-
}, {
|
|
14647
|
-
target: "data",
|
|
14648
|
-
eventHandlers: props.disable ? {} : {
|
|
14649
|
-
onMouseOver: () => null,
|
|
14650
|
-
onMouseOut: () => null,
|
|
14651
|
-
onMouseMove: () => null
|
|
14652
|
-
}
|
|
14653
|
-
}];
|
|
14654
|
-
}
|
|
14655
|
-
getDimension(props) {
|
|
14656
|
-
const {
|
|
14657
|
-
horizontal,
|
|
14658
|
-
voronoiDimension
|
|
14659
|
-
} = props;
|
|
14660
|
-
if (!horizontal || !voronoiDimension) {
|
|
14661
|
-
return voronoiDimension;
|
|
14662
|
-
}
|
|
14663
|
-
return voronoiDimension === "x" ? "y" : "x";
|
|
14664
|
-
}
|
|
14665
|
-
getPoint(point) {
|
|
14666
|
-
const whitelist = ["_x", "_x1", "_x0", "_y", "_y1", "_y0"];
|
|
14667
|
-
return lodash_pick__WEBPACK_IMPORTED_MODULE_0___default()(point, whitelist);
|
|
14668
|
-
}
|
|
14669
|
-
getLabelPosition(props, labelProps, points) {
|
|
14670
|
-
const {
|
|
14671
|
-
mousePosition,
|
|
14672
|
-
mouseFollowTooltips
|
|
14673
|
-
} = props;
|
|
14674
|
-
const voronoiDimension = this.getDimension(props);
|
|
14675
|
-
const point = this.getPoint(points[0]);
|
|
14676
|
-
const basePosition = victory_core__WEBPACK_IMPORTED_MODULE_6__.scalePoint(props, point);
|
|
14677
|
-
let center = mouseFollowTooltips ? mousePosition : undefined;
|
|
14678
|
-
if (!voronoiDimension || points.length < 2) {
|
|
14679
|
-
return {
|
|
14680
|
-
...basePosition,
|
|
14681
|
-
center: lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({}, labelProps.center, center)
|
|
14682
|
-
};
|
|
14683
|
-
}
|
|
14684
|
-
const x = voronoiDimension === "y" ? mousePosition.x : basePosition.x;
|
|
14685
|
-
const y = voronoiDimension === "x" ? mousePosition.y : basePosition.y;
|
|
14686
|
-
center = mouseFollowTooltips ? mousePosition : {
|
|
14687
|
-
x,
|
|
14688
|
-
y
|
|
14689
|
-
};
|
|
14690
|
-
return {
|
|
14691
|
-
x,
|
|
14692
|
-
y,
|
|
14693
|
-
center: lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({}, labelProps.center, center)
|
|
14694
|
-
};
|
|
14695
|
-
}
|
|
14696
|
-
getStyle(props, points, type) {
|
|
14697
|
-
const {
|
|
14698
|
-
labels,
|
|
14699
|
-
labelComponent,
|
|
14700
|
-
theme
|
|
14701
|
-
} = props;
|
|
14702
|
-
const componentProps = labelComponent.props || {};
|
|
14703
|
-
const themeStyles = theme && theme.voronoi && theme.voronoi.style ? theme.voronoi.style : {};
|
|
14704
|
-
const componentStyleArray = type === "flyout" ? componentProps.flyoutStyle : componentProps.style;
|
|
14705
|
-
return points.reduce((memo, datum, index) => {
|
|
14706
|
-
const labelProps = lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({}, componentProps, {
|
|
14707
|
-
datum,
|
|
14708
|
-
active: true
|
|
14709
|
-
});
|
|
14710
|
-
const text = victory_core__WEBPACK_IMPORTED_MODULE_6__.isFunction(labels) ? labels(labelProps) : undefined;
|
|
14711
|
-
const textArray = text !== undefined ? `${text}`.split("\n") : [];
|
|
14712
|
-
const baseStyle = datum.style && datum.style[type] || {};
|
|
14713
|
-
const componentStyle = Array.isArray(componentStyleArray) ? componentStyleArray[index] : componentStyleArray;
|
|
14714
|
-
const style = victory_core__WEBPACK_IMPORTED_MODULE_6__.evaluateStyle(lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({}, componentStyle, baseStyle, themeStyles[type]), labelProps);
|
|
14715
|
-
const styleArray = textArray.length ? textArray.map(() => style) : [style];
|
|
14716
|
-
return memo.concat(styleArray);
|
|
14717
|
-
}, []);
|
|
14304
|
+
const VICTORY_VORONOI_CONTAINER_DEFAULT_PROPS = {
|
|
14305
|
+
activateData: true,
|
|
14306
|
+
activateLabels: true,
|
|
14307
|
+
labelComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(victory_tooltip__WEBPACK_IMPORTED_MODULE_3__.VictoryTooltip, null),
|
|
14308
|
+
voronoiPadding: 5
|
|
14309
|
+
};
|
|
14310
|
+
const getPoint = point => {
|
|
14311
|
+
const whitelist = ["_x", "_x1", "_x0", "_y", "_y1", "_y0"];
|
|
14312
|
+
return lodash_pick__WEBPACK_IMPORTED_MODULE_0___default()(point, whitelist);
|
|
14313
|
+
};
|
|
14314
|
+
const useVictoryVoronoiContainer = initialProps => {
|
|
14315
|
+
const props = {
|
|
14316
|
+
...VICTORY_VORONOI_CONTAINER_DEFAULT_PROPS,
|
|
14317
|
+
...initialProps
|
|
14318
|
+
};
|
|
14319
|
+
const {
|
|
14320
|
+
children
|
|
14321
|
+
} = props;
|
|
14322
|
+
const getDimension = () => {
|
|
14323
|
+
const {
|
|
14324
|
+
horizontal,
|
|
14325
|
+
voronoiDimension
|
|
14326
|
+
} = props;
|
|
14327
|
+
if (!horizontal || !voronoiDimension) {
|
|
14328
|
+
return voronoiDimension;
|
|
14718
14329
|
}
|
|
14719
|
-
|
|
14720
|
-
|
|
14721
|
-
|
|
14722
|
-
|
|
14723
|
-
|
|
14724
|
-
|
|
14725
|
-
|
|
14726
|
-
|
|
14727
|
-
|
|
14728
|
-
|
|
14729
|
-
|
|
14730
|
-
|
|
14731
|
-
const orientation = mouseFollowTooltips ? undefined : labelOrientation;
|
|
14330
|
+
return voronoiDimension === "x" ? "y" : "x";
|
|
14331
|
+
};
|
|
14332
|
+
const getLabelPosition = (labelProps, points) => {
|
|
14333
|
+
const {
|
|
14334
|
+
mousePosition,
|
|
14335
|
+
mouseFollowTooltips
|
|
14336
|
+
} = props;
|
|
14337
|
+
const voronoiDimension = getDimension();
|
|
14338
|
+
const point = getPoint(points[0]);
|
|
14339
|
+
const basePosition = victory_core__WEBPACK_IMPORTED_MODULE_4__.scalePoint(props, point);
|
|
14340
|
+
let center = mouseFollowTooltips ? mousePosition : undefined;
|
|
14341
|
+
if (!voronoiDimension || points.length < 2) {
|
|
14732
14342
|
return {
|
|
14733
|
-
|
|
14734
|
-
|
|
14735
|
-
constrainToVisibleArea: multiPoint || mouseFollowTooltips ? true : undefined
|
|
14343
|
+
...basePosition,
|
|
14344
|
+
center: lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({}, labelProps.center, center)
|
|
14736
14345
|
};
|
|
14737
14346
|
}
|
|
14738
|
-
|
|
14739
|
-
|
|
14740
|
-
|
|
14741
|
-
|
|
14742
|
-
|
|
14743
|
-
|
|
14744
|
-
|
|
14745
|
-
|
|
14746
|
-
|
|
14747
|
-
|
|
14748
|
-
|
|
14749
|
-
|
|
14750
|
-
|
|
14751
|
-
|
|
14752
|
-
|
|
14753
|
-
|
|
14754
|
-
|
|
14755
|
-
|
|
14756
|
-
|
|
14757
|
-
|
|
14758
|
-
|
|
14759
|
-
|
|
14760
|
-
|
|
14761
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
14762
|
-
const {
|
|
14763
|
-
childName,
|
|
14764
|
-
eventKey,
|
|
14765
|
-
style,
|
|
14766
|
-
continuous,
|
|
14767
|
-
...datum
|
|
14768
|
-
} = points[0];
|
|
14769
|
-
const name = props.name === childName ? childName : `${props.name}-${childName}`;
|
|
14770
|
-
const labelProps = lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({
|
|
14771
|
-
key: `${name}-${eventKey}-voronoi-tooltip`,
|
|
14772
|
-
id: `${name}-${eventKey}-voronoi-tooltip`,
|
|
14773
|
-
active: true,
|
|
14774
|
-
renderInPortal: false,
|
|
14775
|
-
activePoints: points,
|
|
14347
|
+
const x = voronoiDimension === "y" ? mousePosition.x : basePosition.x;
|
|
14348
|
+
const y = voronoiDimension === "x" ? mousePosition.y : basePosition.y;
|
|
14349
|
+
center = mouseFollowTooltips ? mousePosition : {
|
|
14350
|
+
x,
|
|
14351
|
+
y
|
|
14352
|
+
};
|
|
14353
|
+
return {
|
|
14354
|
+
x,
|
|
14355
|
+
y,
|
|
14356
|
+
center: lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({}, labelProps.center, center)
|
|
14357
|
+
};
|
|
14358
|
+
};
|
|
14359
|
+
const getStyle = (points, type) => {
|
|
14360
|
+
const {
|
|
14361
|
+
labels,
|
|
14362
|
+
labelComponent,
|
|
14363
|
+
theme
|
|
14364
|
+
} = props;
|
|
14365
|
+
const componentProps = labelComponent.props || {};
|
|
14366
|
+
const themeStyles = theme && theme.voronoi && theme.voronoi.style ? theme.voronoi.style : {};
|
|
14367
|
+
const componentStyleArray = type === "flyout" ? componentProps.flyoutStyle : componentProps.style;
|
|
14368
|
+
return points.reduce((memo, datum, index) => {
|
|
14369
|
+
const labelProps = lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({}, componentProps, {
|
|
14776
14370
|
datum,
|
|
14777
|
-
|
|
14778
|
-
|
|
14779
|
-
|
|
14780
|
-
|
|
14781
|
-
|
|
14782
|
-
|
|
14783
|
-
|
|
14784
|
-
|
|
14785
|
-
|
|
14786
|
-
|
|
14787
|
-
|
|
14788
|
-
|
|
14789
|
-
|
|
14790
|
-
|
|
14791
|
-
|
|
14792
|
-
|
|
14793
|
-
|
|
14794
|
-
|
|
14795
|
-
|
|
14796
|
-
|
|
14797
|
-
|
|
14798
|
-
|
|
14799
|
-
|
|
14800
|
-
|
|
14801
|
-
|
|
14802
|
-
|
|
14803
|
-
|
|
14804
|
-
|
|
14371
|
+
active: true
|
|
14372
|
+
});
|
|
14373
|
+
const text = victory_core__WEBPACK_IMPORTED_MODULE_4__.isFunction(labels) ? labels(labelProps) : undefined;
|
|
14374
|
+
const textArray = text !== undefined ? `${text}`.split("\n") : [];
|
|
14375
|
+
const baseStyle = datum.style && datum.style[type] || {};
|
|
14376
|
+
const componentStyle = Array.isArray(componentStyleArray) ? componentStyleArray[index] : componentStyleArray;
|
|
14377
|
+
const style = victory_core__WEBPACK_IMPORTED_MODULE_4__.evaluateStyle(lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({}, componentStyle, baseStyle, themeStyles[type]), labelProps);
|
|
14378
|
+
const styleArray = textArray.length ? textArray.map(() => style) : [style];
|
|
14379
|
+
return memo.concat(styleArray);
|
|
14380
|
+
}, []);
|
|
14381
|
+
};
|
|
14382
|
+
const getDefaultLabelProps = points => {
|
|
14383
|
+
const {
|
|
14384
|
+
voronoiDimension,
|
|
14385
|
+
horizontal,
|
|
14386
|
+
mouseFollowTooltips
|
|
14387
|
+
} = props;
|
|
14388
|
+
const point = getPoint(points[0]);
|
|
14389
|
+
const multiPoint = voronoiDimension && points.length > 1;
|
|
14390
|
+
const y = point._y1 !== undefined ? point._y1 : point._y;
|
|
14391
|
+
const defaultHorizontalOrientation = y < 0 ? "left" : "right";
|
|
14392
|
+
const defaultOrientation = y < 0 ? "bottom" : "top";
|
|
14393
|
+
const labelOrientation = horizontal ? defaultHorizontalOrientation : defaultOrientation;
|
|
14394
|
+
const orientation = mouseFollowTooltips ? undefined : labelOrientation;
|
|
14395
|
+
return {
|
|
14396
|
+
orientation,
|
|
14397
|
+
pointerLength: multiPoint ? 0 : undefined,
|
|
14398
|
+
constrainToVisibleArea: multiPoint || mouseFollowTooltips ? true : undefined
|
|
14399
|
+
};
|
|
14400
|
+
};
|
|
14401
|
+
const getLabelProps = points => {
|
|
14402
|
+
const {
|
|
14403
|
+
labels,
|
|
14404
|
+
scale,
|
|
14405
|
+
labelComponent,
|
|
14406
|
+
theme,
|
|
14407
|
+
width,
|
|
14408
|
+
height
|
|
14409
|
+
} = props;
|
|
14410
|
+
const componentProps = labelComponent.props || {};
|
|
14411
|
+
const text = points.reduce((memo, datum) => {
|
|
14412
|
+
const labelProps = lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({}, componentProps, {
|
|
14413
|
+
datum,
|
|
14414
|
+
active: true
|
|
14415
|
+
});
|
|
14416
|
+
const t = victory_core__WEBPACK_IMPORTED_MODULE_4__.isFunction(labels) ? labels(labelProps) : null;
|
|
14417
|
+
if (t === null || t === undefined) {
|
|
14418
|
+
return memo;
|
|
14805
14419
|
}
|
|
14420
|
+
return memo.concat(`${t}`.split("\n"));
|
|
14421
|
+
}, []);
|
|
14422
|
+
|
|
14423
|
+
// remove properties from first point to make datum
|
|
14424
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
14425
|
+
const {
|
|
14426
|
+
childName,
|
|
14427
|
+
eventKey,
|
|
14428
|
+
style,
|
|
14429
|
+
continuous,
|
|
14430
|
+
...datum
|
|
14431
|
+
} = points[0];
|
|
14432
|
+
const name = props.name === childName ? childName : `${props.name}-${childName}`;
|
|
14433
|
+
const labelProps = lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({
|
|
14434
|
+
key: `${name}-${eventKey}-voronoi-tooltip`,
|
|
14435
|
+
id: `${name}-${eventKey}-voronoi-tooltip`,
|
|
14436
|
+
active: true,
|
|
14437
|
+
renderInPortal: false,
|
|
14438
|
+
activePoints: points,
|
|
14439
|
+
datum,
|
|
14440
|
+
scale,
|
|
14441
|
+
theme
|
|
14442
|
+
}, componentProps, {
|
|
14443
|
+
text,
|
|
14444
|
+
width,
|
|
14445
|
+
height,
|
|
14446
|
+
style: getStyle(points, "labels"),
|
|
14447
|
+
flyoutStyle: getStyle(points, "flyout")[0]
|
|
14448
|
+
}, getDefaultLabelProps(points));
|
|
14449
|
+
const labelPosition = getLabelPosition(labelProps, points);
|
|
14450
|
+
return lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({}, labelPosition, labelProps);
|
|
14451
|
+
};
|
|
14452
|
+
const getTooltip = () => {
|
|
14453
|
+
const {
|
|
14454
|
+
labels,
|
|
14455
|
+
activePoints,
|
|
14456
|
+
labelComponent
|
|
14457
|
+
} = props;
|
|
14458
|
+
if (!labels) {
|
|
14806
14459
|
return null;
|
|
14807
14460
|
}
|
|
14808
|
-
|
|
14809
|
-
|
|
14810
|
-
|
|
14811
|
-
|
|
14461
|
+
if (Array.isArray(activePoints) && activePoints.length) {
|
|
14462
|
+
const labelProps = getLabelProps(activePoints);
|
|
14463
|
+
const {
|
|
14464
|
+
text
|
|
14465
|
+
} = labelProps;
|
|
14466
|
+
const showLabel = Array.isArray(text) ? text.filter(Boolean).length : text;
|
|
14467
|
+
return showLabel ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().cloneElement(labelComponent, labelProps) : null;
|
|
14812
14468
|
}
|
|
14469
|
+
return null;
|
|
14813
14470
|
};
|
|
14814
|
-
|
|
14815
|
-
|
|
14471
|
+
return {
|
|
14472
|
+
props,
|
|
14473
|
+
children: [...react__WEBPACK_IMPORTED_MODULE_2___default().Children.toArray(children), getTooltip()]
|
|
14474
|
+
};
|
|
14475
|
+
};
|
|
14476
|
+
const VictoryVoronoiContainer = initialProps => {
|
|
14477
|
+
const {
|
|
14478
|
+
props,
|
|
14479
|
+
children
|
|
14480
|
+
} = useVictoryVoronoiContainer(initialProps);
|
|
14481
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(victory_core__WEBPACK_IMPORTED_MODULE_5__.VictoryContainer, props, children);
|
|
14482
|
+
};
|
|
14483
|
+
VictoryVoronoiContainer.role = "container";
|
|
14484
|
+
VictoryVoronoiContainer.defaultEvents = initialProps => {
|
|
14485
|
+
const props = {
|
|
14486
|
+
...VICTORY_VORONOI_CONTAINER_DEFAULT_PROPS,
|
|
14487
|
+
...initialProps
|
|
14488
|
+
};
|
|
14489
|
+
const createEventHandler = (handler, disabled) =>
|
|
14490
|
+
// eslint-disable-next-line max-params
|
|
14491
|
+
(event, targetProps, eventKey, context) => disabled || props.disable ? {} : handler(event, {
|
|
14492
|
+
...props,
|
|
14493
|
+
...targetProps
|
|
14494
|
+
}, eventKey, context);
|
|
14495
|
+
return [{
|
|
14496
|
+
target: "parent",
|
|
14497
|
+
eventHandlers: {
|
|
14498
|
+
onMouseLeave: createEventHandler(_voronoi_helpers__WEBPACK_IMPORTED_MODULE_6__.VoronoiHelpers.onMouseLeave),
|
|
14499
|
+
onTouchCancel: createEventHandler(_voronoi_helpers__WEBPACK_IMPORTED_MODULE_6__.VoronoiHelpers.onMouseLeave),
|
|
14500
|
+
onMouseMove: createEventHandler(_voronoi_helpers__WEBPACK_IMPORTED_MODULE_6__.VoronoiHelpers.onMouseMove),
|
|
14501
|
+
onTouchMove: createEventHandler(_voronoi_helpers__WEBPACK_IMPORTED_MODULE_6__.VoronoiHelpers.onMouseMove)
|
|
14502
|
+
}
|
|
14503
|
+
}, {
|
|
14504
|
+
target: "data",
|
|
14505
|
+
eventHandlers: props.disable ? {} : {
|
|
14506
|
+
onMouseOver: () => null,
|
|
14507
|
+
onMouseOut: () => null,
|
|
14508
|
+
onMouseMove: () => null
|
|
14509
|
+
}
|
|
14510
|
+
}];
|
|
14511
|
+
};
|
|
14816
14512
|
|
|
14817
14513
|
/***/ }),
|
|
14818
14514
|
|
|
@@ -15089,85 +14785,120 @@ const VoronoiHelpers = new VoronoiHelpersClass();
|
|
|
15089
14785
|
"use strict";
|
|
15090
14786
|
__webpack_require__.r(__webpack_exports__);
|
|
15091
14787
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
14788
|
+
/* harmony export */ "VICTORY_ZOOM_CONTAINER_DEFAULT_PROPS": function() { return /* binding */ VICTORY_ZOOM_CONTAINER_DEFAULT_PROPS; },
|
|
15092
14789
|
/* harmony export */ "VictoryZoomContainer": function() { return /* binding */ VictoryZoomContainer; },
|
|
15093
|
-
/* harmony export */ "
|
|
14790
|
+
/* harmony export */ "useVictoryZoomContainer": function() { return /* binding */ useVictoryZoomContainer; }
|
|
15094
14791
|
/* harmony export */ });
|
|
15095
14792
|
/* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash/defaults */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/defaults.js");
|
|
15096
14793
|
/* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_defaults__WEBPACK_IMPORTED_MODULE_0__);
|
|
15097
14794
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
|
|
15098
14795
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
|
|
15099
14796
|
/* harmony import */ var _zoom_helpers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./zoom-helpers */ "../../victory-zoom-container/es/zoom-helpers.js");
|
|
15100
|
-
/* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-container/victory-container.js");
|
|
15101
|
-
/* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-
|
|
15102
|
-
/* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-
|
|
15103
|
-
/* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-util/helpers.js");
|
|
14797
|
+
/* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-clip-container/victory-clip-container.js");
|
|
14798
|
+
/* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-util/data.js");
|
|
14799
|
+
/* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-container/victory-container.js");
|
|
15104
14800
|
|
|
15105
14801
|
|
|
15106
14802
|
|
|
15107
14803
|
|
|
15108
14804
|
const DEFAULT_DOWNSAMPLE = 150;
|
|
15109
|
-
|
|
15110
|
-
|
|
15111
|
-
|
|
15112
|
-
|
|
15113
|
-
|
|
15114
|
-
|
|
15115
|
-
|
|
15116
|
-
|
|
15117
|
-
|
|
15118
|
-
|
|
14805
|
+
const VICTORY_ZOOM_CONTAINER_DEFAULT_PROPS = {
|
|
14806
|
+
clipContainerComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(victory_core__WEBPACK_IMPORTED_MODULE_2__.VictoryClipContainer, null),
|
|
14807
|
+
allowPan: true,
|
|
14808
|
+
allowZoom: true,
|
|
14809
|
+
zoomActive: false
|
|
14810
|
+
};
|
|
14811
|
+
const useVictoryZoomContainer = initialProps => {
|
|
14812
|
+
const props = {
|
|
14813
|
+
...VICTORY_ZOOM_CONTAINER_DEFAULT_PROPS,
|
|
14814
|
+
...initialProps
|
|
14815
|
+
};
|
|
14816
|
+
const {
|
|
14817
|
+
children,
|
|
14818
|
+
currentDomain,
|
|
14819
|
+
zoomActive,
|
|
14820
|
+
allowZoom,
|
|
14821
|
+
downsample,
|
|
14822
|
+
scale,
|
|
14823
|
+
clipContainerComponent,
|
|
14824
|
+
polar,
|
|
14825
|
+
origin,
|
|
14826
|
+
horizontal
|
|
14827
|
+
} = props;
|
|
14828
|
+
const downsampleZoomData = (child, domain) => {
|
|
14829
|
+
const getData = childProps => {
|
|
14830
|
+
const {
|
|
14831
|
+
data,
|
|
14832
|
+
x,
|
|
14833
|
+
y
|
|
14834
|
+
} = childProps;
|
|
14835
|
+
const defaultGetData = child.type && typeof child.type.getData === "function" ? child.type.getData : () => undefined;
|
|
14836
|
+
// skip costly data formatting if x and y accessors are not present
|
|
14837
|
+
return Array.isArray(data) && !x && !y ? data : defaultGetData(childProps);
|
|
15119
14838
|
};
|
|
15120
|
-
|
|
15121
|
-
|
|
15122
|
-
|
|
15123
|
-
|
|
15124
|
-
|
|
15125
|
-
return props.disable ? {} : _zoom_helpers__WEBPACK_IMPORTED_MODULE_4__.ZoomHelpers.onMouseDown(evt, targetProps);
|
|
15126
|
-
},
|
|
15127
|
-
onTouchStart: (evt, targetProps) => {
|
|
15128
|
-
return props.disable ? {} : _zoom_helpers__WEBPACK_IMPORTED_MODULE_4__.ZoomHelpers.onMouseDown(evt, targetProps);
|
|
15129
|
-
},
|
|
15130
|
-
onMouseUp: (evt, targetProps) => {
|
|
15131
|
-
return props.disable ? {} : _zoom_helpers__WEBPACK_IMPORTED_MODULE_4__.ZoomHelpers.onMouseUp(evt, targetProps);
|
|
15132
|
-
},
|
|
15133
|
-
onTouchEnd: (evt, targetProps) => {
|
|
15134
|
-
return props.disable ? {} : _zoom_helpers__WEBPACK_IMPORTED_MODULE_4__.ZoomHelpers.onMouseUp(evt, targetProps);
|
|
15135
|
-
},
|
|
15136
|
-
onMouseLeave: (evt, targetProps) => {
|
|
15137
|
-
return props.disable ? {} : _zoom_helpers__WEBPACK_IMPORTED_MODULE_4__.ZoomHelpers.onMouseLeave(evt, targetProps);
|
|
15138
|
-
},
|
|
15139
|
-
onTouchCancel: (evt, targetProps) => {
|
|
15140
|
-
return props.disable ? {} : _zoom_helpers__WEBPACK_IMPORTED_MODULE_4__.ZoomHelpers.onMouseLeave(evt, targetProps);
|
|
15141
|
-
},
|
|
15142
|
-
// eslint-disable-next-line max-params
|
|
15143
|
-
onMouseMove: (evt, targetProps, eventKey, ctx) => {
|
|
15144
|
-
if (props.disable) {
|
|
15145
|
-
return {};
|
|
15146
|
-
}
|
|
15147
|
-
return _zoom_helpers__WEBPACK_IMPORTED_MODULE_4__.ZoomHelpers.onMouseMove(evt, targetProps, eventKey, ctx);
|
|
15148
|
-
},
|
|
15149
|
-
// eslint-disable-next-line max-params
|
|
15150
|
-
onTouchMove: (evt, targetProps, eventKey, ctx) => {
|
|
15151
|
-
if (props.disable) {
|
|
15152
|
-
return {};
|
|
15153
|
-
}
|
|
15154
|
-
evt.preventDefault();
|
|
15155
|
-
return _zoom_helpers__WEBPACK_IMPORTED_MODULE_4__.ZoomHelpers.onMouseMove(evt, targetProps, eventKey, ctx);
|
|
15156
|
-
},
|
|
15157
|
-
...(props.disable || !props.allowZoom ? {} : {
|
|
15158
|
-
onWheel: _zoom_helpers__WEBPACK_IMPORTED_MODULE_4__.ZoomHelpers.onWheel
|
|
15159
|
-
})
|
|
15160
|
-
}
|
|
15161
|
-
}];
|
|
14839
|
+
const data = getData(child.props);
|
|
14840
|
+
|
|
14841
|
+
// return undefined if downsample is not run, then default() will replace with child.props.data
|
|
14842
|
+
if (!downsample || !domain || !data) {
|
|
14843
|
+
return undefined;
|
|
15162
14844
|
}
|
|
15163
|
-
|
|
15164
|
-
|
|
15165
|
-
|
|
15166
|
-
|
|
15167
|
-
|
|
15168
|
-
|
|
15169
|
-
|
|
15170
|
-
|
|
14845
|
+
const maxPoints = downsample === true ? DEFAULT_DOWNSAMPLE : downsample;
|
|
14846
|
+
const dimension = props.zoomDimension || "x";
|
|
14847
|
+
|
|
14848
|
+
// important: assumes data is ordered by dimension
|
|
14849
|
+
// get the start and end of the data that is in the current visible domain
|
|
14850
|
+
let startIndex = data.findIndex(d => d[dimension] >= domain[dimension][0]);
|
|
14851
|
+
let endIndex = data.findIndex(d => d[dimension] > domain[dimension][1]);
|
|
14852
|
+
// pick one more point (if available) at each end so that VictoryLine, VictoryArea connect
|
|
14853
|
+
if (startIndex !== 0) {
|
|
14854
|
+
startIndex -= 1;
|
|
14855
|
+
}
|
|
14856
|
+
if (endIndex !== -1) {
|
|
14857
|
+
endIndex += 1;
|
|
14858
|
+
}
|
|
14859
|
+
const visibleData = data.slice(startIndex, endIndex);
|
|
14860
|
+
return victory_core__WEBPACK_IMPORTED_MODULE_3__.downsample(visibleData, maxPoints, startIndex);
|
|
14861
|
+
};
|
|
14862
|
+
const modifiedChildren = react__WEBPACK_IMPORTED_MODULE_1___default().Children.toArray(children).map(child => {
|
|
14863
|
+
const role = child.type && child.type.role;
|
|
14864
|
+
const isDataComponent = victory_core__WEBPACK_IMPORTED_MODULE_3__.isDataComponent(child);
|
|
14865
|
+
const originalDomain = lodash_defaults__WEBPACK_IMPORTED_MODULE_0___default()({}, props.originalDomain, props.domain);
|
|
14866
|
+
const zoomDomain = lodash_defaults__WEBPACK_IMPORTED_MODULE_0___default()({}, props.zoomDomain, props.domain);
|
|
14867
|
+
const cachedZoomDomain = lodash_defaults__WEBPACK_IMPORTED_MODULE_0___default()({}, props.cachedZoomDomain, props.domain);
|
|
14868
|
+
let domain;
|
|
14869
|
+
if (!_zoom_helpers__WEBPACK_IMPORTED_MODULE_4__.ZoomHelpers.checkDomainEquality(zoomDomain, cachedZoomDomain)) {
|
|
14870
|
+
// if zoomDomain has been changed, use it
|
|
14871
|
+
domain = zoomDomain;
|
|
14872
|
+
} else if (allowZoom && !zoomActive) {
|
|
14873
|
+
// if user has zoomed all the way out, use the child domain
|
|
14874
|
+
domain = child.props.domain;
|
|
14875
|
+
} else {
|
|
14876
|
+
// default: use currentDomain, set by the event handlers
|
|
14877
|
+
domain = lodash_defaults__WEBPACK_IMPORTED_MODULE_0___default()({}, currentDomain, originalDomain);
|
|
14878
|
+
}
|
|
14879
|
+
let newDomain = props.polar ? {
|
|
14880
|
+
x: originalDomain.x,
|
|
14881
|
+
y: [0, domain.y[1]]
|
|
14882
|
+
} : domain;
|
|
14883
|
+
if (newDomain && props.zoomDimension) {
|
|
14884
|
+
// if zooming is restricted to a dimension, don't squash changes to zoomDomain in other dim
|
|
14885
|
+
newDomain = {
|
|
14886
|
+
...zoomDomain,
|
|
14887
|
+
[props.zoomDimension]: newDomain[props.zoomDimension]
|
|
14888
|
+
};
|
|
14889
|
+
}
|
|
14890
|
+
|
|
14891
|
+
// don't downsample stacked data
|
|
14892
|
+
const childProps = isDataComponent && role !== "stack" ? {
|
|
14893
|
+
domain: newDomain,
|
|
14894
|
+
data: downsampleZoomData(child, newDomain)
|
|
14895
|
+
} : {
|
|
14896
|
+
domain: newDomain
|
|
14897
|
+
};
|
|
14898
|
+
const newChild = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().cloneElement(child, lodash_defaults__WEBPACK_IMPORTED_MODULE_0___default()(childProps, child.props));
|
|
14899
|
+
|
|
14900
|
+
// Clip data components
|
|
14901
|
+
if (victory_core__WEBPACK_IMPORTED_MODULE_3__.isDataComponent(newChild)) {
|
|
15171
14902
|
const rangeX = horizontal ? scale.y.range() : scale.x.range();
|
|
15172
14903
|
const rangeY = horizontal ? scale.x.range() : scale.y.range();
|
|
15173
14904
|
const plottableWidth = Math.abs(rangeX[0] - rangeX[1]);
|
|
@@ -15183,110 +14914,51 @@ function zoomContainerMixin(Base) {
|
|
|
15183
14914
|
radius: polar ? radius : undefined,
|
|
15184
14915
|
...clipContainerComponent.props
|
|
15185
14916
|
});
|
|
15186
|
-
return react__WEBPACK_IMPORTED_MODULE_1___default().
|
|
15187
|
-
|
|
15188
|
-
return child;
|
|
15189
|
-
}
|
|
15190
|
-
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().cloneElement(child, {
|
|
15191
|
-
groupComponent
|
|
15192
|
-
});
|
|
15193
|
-
});
|
|
15194
|
-
}
|
|
15195
|
-
modifyPolarDomain(domain, originalDomain) {
|
|
15196
|
-
// Only zoom the radius of polar charts. Zooming angles is very confusing
|
|
15197
|
-
return {
|
|
15198
|
-
x: originalDomain.x,
|
|
15199
|
-
y: [0, domain.y[1]]
|
|
15200
|
-
};
|
|
15201
|
-
}
|
|
15202
|
-
downsampleZoomData(props, child, domain) {
|
|
15203
|
-
const {
|
|
15204
|
-
downsample
|
|
15205
|
-
} = props;
|
|
15206
|
-
const getData = childProps => {
|
|
15207
|
-
const {
|
|
15208
|
-
data,
|
|
15209
|
-
x,
|
|
15210
|
-
y
|
|
15211
|
-
} = childProps;
|
|
15212
|
-
const defaultGetData = child.type && victory_core__WEBPACK_IMPORTED_MODULE_6__.isFunction(child.type.getData) ? child.type.getData : () => undefined;
|
|
15213
|
-
// skip costly data formatting if x and y accessors are not present
|
|
15214
|
-
return Array.isArray(data) && !x && !y ? data : defaultGetData(childProps);
|
|
15215
|
-
};
|
|
15216
|
-
const data = getData(child.props);
|
|
15217
|
-
|
|
15218
|
-
// return undefined if downsample is not run, then default() will replace with child.props.data
|
|
15219
|
-
if (!downsample || !domain || !data) {
|
|
15220
|
-
return undefined;
|
|
15221
|
-
}
|
|
15222
|
-
const maxPoints = downsample === true ? DEFAULT_DOWNSAMPLE : downsample;
|
|
15223
|
-
const dimension = props.zoomDimension || "x";
|
|
15224
|
-
|
|
15225
|
-
// important: assumes data is ordered by dimension
|
|
15226
|
-
// get the start and end of the data that is in the current visible domain
|
|
15227
|
-
let startIndex = data.findIndex(d => d[dimension] >= domain[dimension][0]);
|
|
15228
|
-
let endIndex = data.findIndex(d => d[dimension] > domain[dimension][1]);
|
|
15229
|
-
// pick one more point (if available) at each end so that VictoryLine, VictoryArea connect
|
|
15230
|
-
if (startIndex !== 0) {
|
|
15231
|
-
startIndex -= 1;
|
|
15232
|
-
}
|
|
15233
|
-
if (endIndex !== -1) {
|
|
15234
|
-
endIndex += 1;
|
|
15235
|
-
}
|
|
15236
|
-
const visibleData = data.slice(startIndex, endIndex);
|
|
15237
|
-
return victory_core__WEBPACK_IMPORTED_MODULE_5__.downsample(visibleData, maxPoints, startIndex);
|
|
15238
|
-
}
|
|
15239
|
-
modifyChildren(props) {
|
|
15240
|
-
const childComponents = react__WEBPACK_IMPORTED_MODULE_1___default().Children.toArray(props.children);
|
|
15241
|
-
return childComponents.map(child => {
|
|
15242
|
-
const role = child.type && child.type.role;
|
|
15243
|
-
const isDataComponent = victory_core__WEBPACK_IMPORTED_MODULE_5__.isDataComponent(child);
|
|
15244
|
-
const {
|
|
15245
|
-
currentDomain,
|
|
15246
|
-
zoomActive,
|
|
15247
|
-
allowZoom
|
|
15248
|
-
} = props;
|
|
15249
|
-
const originalDomain = lodash_defaults__WEBPACK_IMPORTED_MODULE_0___default()({}, props.originalDomain, props.domain);
|
|
15250
|
-
const zoomDomain = lodash_defaults__WEBPACK_IMPORTED_MODULE_0___default()({}, props.zoomDomain, props.domain);
|
|
15251
|
-
const cachedZoomDomain = lodash_defaults__WEBPACK_IMPORTED_MODULE_0___default()({}, props.cachedZoomDomain, props.domain);
|
|
15252
|
-
let domain;
|
|
15253
|
-
if (!_zoom_helpers__WEBPACK_IMPORTED_MODULE_4__.ZoomHelpers.checkDomainEquality(zoomDomain, cachedZoomDomain)) {
|
|
15254
|
-
// if zoomDomain has been changed, use it
|
|
15255
|
-
domain = zoomDomain;
|
|
15256
|
-
} else if (allowZoom && !zoomActive) {
|
|
15257
|
-
// if user has zoomed all the way out, use the child domain
|
|
15258
|
-
domain = child.props.domain;
|
|
15259
|
-
} else {
|
|
15260
|
-
// default: use currentDomain, set by the event handlers
|
|
15261
|
-
domain = lodash_defaults__WEBPACK_IMPORTED_MODULE_0___default()({}, currentDomain, originalDomain);
|
|
15262
|
-
}
|
|
15263
|
-
let newDomain = props.polar ? this.modifyPolarDomain(domain, originalDomain) : domain;
|
|
15264
|
-
if (newDomain && props.zoomDimension) {
|
|
15265
|
-
// if zooming is restricted to a dimension, don't squash changes to zoomDomain in other dim
|
|
15266
|
-
newDomain = {
|
|
15267
|
-
...zoomDomain,
|
|
15268
|
-
[props.zoomDimension]: newDomain[props.zoomDimension]
|
|
15269
|
-
};
|
|
15270
|
-
}
|
|
15271
|
-
// don't downsample stacked data
|
|
15272
|
-
const newProps = isDataComponent && role !== "stack" ? {
|
|
15273
|
-
domain: newDomain,
|
|
15274
|
-
data: this.downsampleZoomData(props, child, newDomain)
|
|
15275
|
-
} : {
|
|
15276
|
-
domain: newDomain
|
|
15277
|
-
};
|
|
15278
|
-
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().cloneElement(child, lodash_defaults__WEBPACK_IMPORTED_MODULE_0___default()(newProps, child.props));
|
|
14917
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().cloneElement(newChild, {
|
|
14918
|
+
groupComponent
|
|
15279
14919
|
});
|
|
15280
14920
|
}
|
|
15281
|
-
|
|
15282
|
-
|
|
15283
|
-
|
|
15284
|
-
|
|
15285
|
-
|
|
15286
|
-
}
|
|
14921
|
+
return newChild;
|
|
14922
|
+
});
|
|
14923
|
+
return {
|
|
14924
|
+
props,
|
|
14925
|
+
children: modifiedChildren
|
|
15287
14926
|
};
|
|
15288
|
-
}
|
|
15289
|
-
const VictoryZoomContainer =
|
|
14927
|
+
};
|
|
14928
|
+
const VictoryZoomContainer = initialProps => {
|
|
14929
|
+
const {
|
|
14930
|
+
props,
|
|
14931
|
+
children
|
|
14932
|
+
} = useVictoryZoomContainer(initialProps);
|
|
14933
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(victory_core__WEBPACK_IMPORTED_MODULE_5__.VictoryContainer, props, children);
|
|
14934
|
+
};
|
|
14935
|
+
VictoryZoomContainer.role = "container";
|
|
14936
|
+
VictoryZoomContainer.defaultEvents = initialProps => {
|
|
14937
|
+
const props = {
|
|
14938
|
+
...VICTORY_ZOOM_CONTAINER_DEFAULT_PROPS,
|
|
14939
|
+
...initialProps
|
|
14940
|
+
};
|
|
14941
|
+
const createEventHandler = (handler, disabled) =>
|
|
14942
|
+
// eslint-disable-next-line max-params
|
|
14943
|
+
(event, targetProps, eventKey, context) => disabled || props.disable ? {} : handler(event, {
|
|
14944
|
+
...props,
|
|
14945
|
+
...targetProps
|
|
14946
|
+
}, eventKey, context);
|
|
14947
|
+
return [{
|
|
14948
|
+
target: "parent",
|
|
14949
|
+
eventHandlers: {
|
|
14950
|
+
onMouseDown: createEventHandler(_zoom_helpers__WEBPACK_IMPORTED_MODULE_4__.ZoomHelpers.onMouseDown),
|
|
14951
|
+
onTouchStart: createEventHandler(_zoom_helpers__WEBPACK_IMPORTED_MODULE_4__.ZoomHelpers.onMouseDown),
|
|
14952
|
+
onMouseUp: createEventHandler(_zoom_helpers__WEBPACK_IMPORTED_MODULE_4__.ZoomHelpers.onMouseUp),
|
|
14953
|
+
onTouchEnd: createEventHandler(_zoom_helpers__WEBPACK_IMPORTED_MODULE_4__.ZoomHelpers.onMouseUp),
|
|
14954
|
+
onMouseLeave: createEventHandler(_zoom_helpers__WEBPACK_IMPORTED_MODULE_4__.ZoomHelpers.onMouseLeave),
|
|
14955
|
+
onTouchCancel: createEventHandler(_zoom_helpers__WEBPACK_IMPORTED_MODULE_4__.ZoomHelpers.onMouseLeave),
|
|
14956
|
+
onMouseMove: createEventHandler(_zoom_helpers__WEBPACK_IMPORTED_MODULE_4__.ZoomHelpers.onMouseMove),
|
|
14957
|
+
onTouchMove: createEventHandler(_zoom_helpers__WEBPACK_IMPORTED_MODULE_4__.ZoomHelpers.onMouseMove),
|
|
14958
|
+
onWheel: createEventHandler(_zoom_helpers__WEBPACK_IMPORTED_MODULE_4__.ZoomHelpers.onWheel, !props.allowZoom)
|
|
14959
|
+
}
|
|
14960
|
+
}];
|
|
14961
|
+
};
|
|
15290
14962
|
|
|
15291
14963
|
/***/ }),
|
|
15292
14964
|
|
|
@@ -20991,221 +20663,6 @@ year.every = function(k) {
|
|
|
20991
20663
|
var years = year.range;
|
|
20992
20664
|
|
|
20993
20665
|
|
|
20994
|
-
/***/ }),
|
|
20995
|
-
|
|
20996
|
-
/***/ "../../../node_modules/.pnpm/d3-timer@3.0.1/node_modules/d3-timer/src/index.js":
|
|
20997
|
-
/*!*************************************************************************************!*\
|
|
20998
|
-
!*** ../../../node_modules/.pnpm/d3-timer@3.0.1/node_modules/d3-timer/src/index.js ***!
|
|
20999
|
-
\*************************************************************************************/
|
|
21000
|
-
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
21001
|
-
|
|
21002
|
-
"use strict";
|
|
21003
|
-
__webpack_require__.r(__webpack_exports__);
|
|
21004
|
-
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
21005
|
-
/* harmony export */ "interval": function() { return /* reexport safe */ _interval_js__WEBPACK_IMPORTED_MODULE_2__["default"]; },
|
|
21006
|
-
/* harmony export */ "now": function() { return /* reexport safe */ _timer_js__WEBPACK_IMPORTED_MODULE_0__.now; },
|
|
21007
|
-
/* harmony export */ "timeout": function() { return /* reexport safe */ _timeout_js__WEBPACK_IMPORTED_MODULE_1__["default"]; },
|
|
21008
|
-
/* harmony export */ "timer": function() { return /* reexport safe */ _timer_js__WEBPACK_IMPORTED_MODULE_0__.timer; },
|
|
21009
|
-
/* harmony export */ "timerFlush": function() { return /* reexport safe */ _timer_js__WEBPACK_IMPORTED_MODULE_0__.timerFlush; }
|
|
21010
|
-
/* harmony export */ });
|
|
21011
|
-
/* harmony import */ var _timer_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./timer.js */ "../../../node_modules/.pnpm/d3-timer@3.0.1/node_modules/d3-timer/src/timer.js");
|
|
21012
|
-
/* harmony import */ var _timeout_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./timeout.js */ "../../../node_modules/.pnpm/d3-timer@3.0.1/node_modules/d3-timer/src/timeout.js");
|
|
21013
|
-
/* harmony import */ var _interval_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./interval.js */ "../../../node_modules/.pnpm/d3-timer@3.0.1/node_modules/d3-timer/src/interval.js");
|
|
21014
|
-
|
|
21015
|
-
|
|
21016
|
-
|
|
21017
|
-
|
|
21018
|
-
|
|
21019
|
-
|
|
21020
|
-
|
|
21021
|
-
/***/ }),
|
|
21022
|
-
|
|
21023
|
-
/***/ "../../../node_modules/.pnpm/d3-timer@3.0.1/node_modules/d3-timer/src/interval.js":
|
|
21024
|
-
/*!****************************************************************************************!*\
|
|
21025
|
-
!*** ../../../node_modules/.pnpm/d3-timer@3.0.1/node_modules/d3-timer/src/interval.js ***!
|
|
21026
|
-
\****************************************************************************************/
|
|
21027
|
-
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
21028
|
-
|
|
21029
|
-
"use strict";
|
|
21030
|
-
__webpack_require__.r(__webpack_exports__);
|
|
21031
|
-
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
21032
|
-
/* harmony export */ "default": function() { return /* export default binding */ __WEBPACK_DEFAULT_EXPORT__; }
|
|
21033
|
-
/* harmony export */ });
|
|
21034
|
-
/* harmony import */ var _timer_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./timer.js */ "../../../node_modules/.pnpm/d3-timer@3.0.1/node_modules/d3-timer/src/timer.js");
|
|
21035
|
-
|
|
21036
|
-
|
|
21037
|
-
/* harmony default export */ function __WEBPACK_DEFAULT_EXPORT__(callback, delay, time) {
|
|
21038
|
-
var t = new _timer_js__WEBPACK_IMPORTED_MODULE_0__.Timer, total = delay;
|
|
21039
|
-
if (delay == null) return t.restart(callback, delay, time), t;
|
|
21040
|
-
t._restart = t.restart;
|
|
21041
|
-
t.restart = function(callback, delay, time) {
|
|
21042
|
-
delay = +delay, time = time == null ? (0,_timer_js__WEBPACK_IMPORTED_MODULE_0__.now)() : +time;
|
|
21043
|
-
t._restart(function tick(elapsed) {
|
|
21044
|
-
elapsed += total;
|
|
21045
|
-
t._restart(tick, total += delay, time);
|
|
21046
|
-
callback(elapsed);
|
|
21047
|
-
}, delay, time);
|
|
21048
|
-
}
|
|
21049
|
-
t.restart(callback, delay, time);
|
|
21050
|
-
return t;
|
|
21051
|
-
}
|
|
21052
|
-
|
|
21053
|
-
|
|
21054
|
-
/***/ }),
|
|
21055
|
-
|
|
21056
|
-
/***/ "../../../node_modules/.pnpm/d3-timer@3.0.1/node_modules/d3-timer/src/timeout.js":
|
|
21057
|
-
/*!***************************************************************************************!*\
|
|
21058
|
-
!*** ../../../node_modules/.pnpm/d3-timer@3.0.1/node_modules/d3-timer/src/timeout.js ***!
|
|
21059
|
-
\***************************************************************************************/
|
|
21060
|
-
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
21061
|
-
|
|
21062
|
-
"use strict";
|
|
21063
|
-
__webpack_require__.r(__webpack_exports__);
|
|
21064
|
-
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
21065
|
-
/* harmony export */ "default": function() { return /* export default binding */ __WEBPACK_DEFAULT_EXPORT__; }
|
|
21066
|
-
/* harmony export */ });
|
|
21067
|
-
/* harmony import */ var _timer_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./timer.js */ "../../../node_modules/.pnpm/d3-timer@3.0.1/node_modules/d3-timer/src/timer.js");
|
|
21068
|
-
|
|
21069
|
-
|
|
21070
|
-
/* harmony default export */ function __WEBPACK_DEFAULT_EXPORT__(callback, delay, time) {
|
|
21071
|
-
var t = new _timer_js__WEBPACK_IMPORTED_MODULE_0__.Timer;
|
|
21072
|
-
delay = delay == null ? 0 : +delay;
|
|
21073
|
-
t.restart(elapsed => {
|
|
21074
|
-
t.stop();
|
|
21075
|
-
callback(elapsed + delay);
|
|
21076
|
-
}, delay, time);
|
|
21077
|
-
return t;
|
|
21078
|
-
}
|
|
21079
|
-
|
|
21080
|
-
|
|
21081
|
-
/***/ }),
|
|
21082
|
-
|
|
21083
|
-
/***/ "../../../node_modules/.pnpm/d3-timer@3.0.1/node_modules/d3-timer/src/timer.js":
|
|
21084
|
-
/*!*************************************************************************************!*\
|
|
21085
|
-
!*** ../../../node_modules/.pnpm/d3-timer@3.0.1/node_modules/d3-timer/src/timer.js ***!
|
|
21086
|
-
\*************************************************************************************/
|
|
21087
|
-
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
21088
|
-
|
|
21089
|
-
"use strict";
|
|
21090
|
-
__webpack_require__.r(__webpack_exports__);
|
|
21091
|
-
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
21092
|
-
/* harmony export */ "Timer": function() { return /* binding */ Timer; },
|
|
21093
|
-
/* harmony export */ "now": function() { return /* binding */ now; },
|
|
21094
|
-
/* harmony export */ "timer": function() { return /* binding */ timer; },
|
|
21095
|
-
/* harmony export */ "timerFlush": function() { return /* binding */ timerFlush; }
|
|
21096
|
-
/* harmony export */ });
|
|
21097
|
-
var frame = 0, // is an animation frame pending?
|
|
21098
|
-
timeout = 0, // is a timeout pending?
|
|
21099
|
-
interval = 0, // are any timers active?
|
|
21100
|
-
pokeDelay = 1000, // how frequently we check for clock skew
|
|
21101
|
-
taskHead,
|
|
21102
|
-
taskTail,
|
|
21103
|
-
clockLast = 0,
|
|
21104
|
-
clockNow = 0,
|
|
21105
|
-
clockSkew = 0,
|
|
21106
|
-
clock = typeof performance === "object" && performance.now ? performance : Date,
|
|
21107
|
-
setFrame = typeof window === "object" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(f) { setTimeout(f, 17); };
|
|
21108
|
-
|
|
21109
|
-
function now() {
|
|
21110
|
-
return clockNow || (setFrame(clearNow), clockNow = clock.now() + clockSkew);
|
|
21111
|
-
}
|
|
21112
|
-
|
|
21113
|
-
function clearNow() {
|
|
21114
|
-
clockNow = 0;
|
|
21115
|
-
}
|
|
21116
|
-
|
|
21117
|
-
function Timer() {
|
|
21118
|
-
this._call =
|
|
21119
|
-
this._time =
|
|
21120
|
-
this._next = null;
|
|
21121
|
-
}
|
|
21122
|
-
|
|
21123
|
-
Timer.prototype = timer.prototype = {
|
|
21124
|
-
constructor: Timer,
|
|
21125
|
-
restart: function(callback, delay, time) {
|
|
21126
|
-
if (typeof callback !== "function") throw new TypeError("callback is not a function");
|
|
21127
|
-
time = (time == null ? now() : +time) + (delay == null ? 0 : +delay);
|
|
21128
|
-
if (!this._next && taskTail !== this) {
|
|
21129
|
-
if (taskTail) taskTail._next = this;
|
|
21130
|
-
else taskHead = this;
|
|
21131
|
-
taskTail = this;
|
|
21132
|
-
}
|
|
21133
|
-
this._call = callback;
|
|
21134
|
-
this._time = time;
|
|
21135
|
-
sleep();
|
|
21136
|
-
},
|
|
21137
|
-
stop: function() {
|
|
21138
|
-
if (this._call) {
|
|
21139
|
-
this._call = null;
|
|
21140
|
-
this._time = Infinity;
|
|
21141
|
-
sleep();
|
|
21142
|
-
}
|
|
21143
|
-
}
|
|
21144
|
-
};
|
|
21145
|
-
|
|
21146
|
-
function timer(callback, delay, time) {
|
|
21147
|
-
var t = new Timer;
|
|
21148
|
-
t.restart(callback, delay, time);
|
|
21149
|
-
return t;
|
|
21150
|
-
}
|
|
21151
|
-
|
|
21152
|
-
function timerFlush() {
|
|
21153
|
-
now(); // Get the current time, if not already set.
|
|
21154
|
-
++frame; // Pretend we’ve set an alarm, if we haven’t already.
|
|
21155
|
-
var t = taskHead, e;
|
|
21156
|
-
while (t) {
|
|
21157
|
-
if ((e = clockNow - t._time) >= 0) t._call.call(undefined, e);
|
|
21158
|
-
t = t._next;
|
|
21159
|
-
}
|
|
21160
|
-
--frame;
|
|
21161
|
-
}
|
|
21162
|
-
|
|
21163
|
-
function wake() {
|
|
21164
|
-
clockNow = (clockLast = clock.now()) + clockSkew;
|
|
21165
|
-
frame = timeout = 0;
|
|
21166
|
-
try {
|
|
21167
|
-
timerFlush();
|
|
21168
|
-
} finally {
|
|
21169
|
-
frame = 0;
|
|
21170
|
-
nap();
|
|
21171
|
-
clockNow = 0;
|
|
21172
|
-
}
|
|
21173
|
-
}
|
|
21174
|
-
|
|
21175
|
-
function poke() {
|
|
21176
|
-
var now = clock.now(), delay = now - clockLast;
|
|
21177
|
-
if (delay > pokeDelay) clockSkew -= delay, clockLast = now;
|
|
21178
|
-
}
|
|
21179
|
-
|
|
21180
|
-
function nap() {
|
|
21181
|
-
var t0, t1 = taskHead, t2, time = Infinity;
|
|
21182
|
-
while (t1) {
|
|
21183
|
-
if (t1._call) {
|
|
21184
|
-
if (time > t1._time) time = t1._time;
|
|
21185
|
-
t0 = t1, t1 = t1._next;
|
|
21186
|
-
} else {
|
|
21187
|
-
t2 = t1._next, t1._next = null;
|
|
21188
|
-
t1 = t0 ? t0._next = t2 : taskHead = t2;
|
|
21189
|
-
}
|
|
21190
|
-
}
|
|
21191
|
-
taskTail = t0;
|
|
21192
|
-
sleep(time);
|
|
21193
|
-
}
|
|
21194
|
-
|
|
21195
|
-
function sleep(time) {
|
|
21196
|
-
if (frame) return; // Soonest alarm already set, or will be.
|
|
21197
|
-
if (timeout) timeout = clearTimeout(timeout);
|
|
21198
|
-
var delay = time - clockNow; // Strictly less than if we recomputed clockNow.
|
|
21199
|
-
if (delay > 24) {
|
|
21200
|
-
if (time < Infinity) timeout = setTimeout(wake, time - clock.now() - clockSkew);
|
|
21201
|
-
if (interval) interval = clearInterval(interval);
|
|
21202
|
-
} else {
|
|
21203
|
-
if (!interval) clockLast = clock.now(), interval = setInterval(poke, pokeDelay);
|
|
21204
|
-
frame = 1, setFrame(wake);
|
|
21205
|
-
}
|
|
21206
|
-
}
|
|
21207
|
-
|
|
21208
|
-
|
|
21209
20666
|
/***/ }),
|
|
21210
20667
|
|
|
21211
20668
|
/***/ "../../../node_modules/.pnpm/internmap@2.0.3/node_modules/internmap/src/index.js":
|
|
@@ -21386,11 +20843,10 @@ var __webpack_exports__ = {};
|
|
|
21386
20843
|
\******************/
|
|
21387
20844
|
__webpack_require__.r(__webpack_exports__);
|
|
21388
20845
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
21389
|
-
/* harmony export */ "combineContainerMixins": function() { return /* reexport safe */ _create_container__WEBPACK_IMPORTED_MODULE_0__.combineContainerMixins; },
|
|
21390
20846
|
/* harmony export */ "createContainer": function() { return /* reexport safe */ _create_container__WEBPACK_IMPORTED_MODULE_0__.createContainer; },
|
|
21391
20847
|
/* harmony export */ "makeCreateContainerFunction": function() { return /* reexport safe */ _create_container__WEBPACK_IMPORTED_MODULE_0__.makeCreateContainerFunction; }
|
|
21392
20848
|
/* harmony export */ });
|
|
21393
|
-
/* harmony import */ var _create_container__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./create-container */ "./create-container.
|
|
20849
|
+
/* harmony import */ var _create_container__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./create-container */ "./create-container.tsx");
|
|
21394
20850
|
|
|
21395
20851
|
}();
|
|
21396
20852
|
/******/ return __webpack_exports__;
|