victory-cursor-container 37.3.2 → 37.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/dist/victory-cursor-container.js +191 -145
- package/dist/victory-cursor-container.min.js +1 -1
- package/es/cursor-helpers.d.ts +0 -1
- package/es/cursor-helpers.js +2 -2
- package/es/victory-cursor-container.d.ts +36 -36
- package/es/victory-cursor-container.js +7 -7
- package/lib/cursor-helpers.d.ts +0 -1
- package/lib/cursor-helpers.js +2 -2
- package/lib/victory-cursor-container.d.ts +36 -36
- package/lib/victory-cursor-container.js +7 -7
- package/package.json +2 -30
- package/src/cursor-helpers.tsx +1 -1
- package/src/victory-cursor-container.tsx +3 -2
|
@@ -22,10 +22,10 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
22
22
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
23
23
|
/* harmony export */ "CursorHelpers": function() { return /* binding */ CursorHelpers; }
|
|
24
24
|
/* harmony export */ });
|
|
25
|
-
/* harmony import */ var lodash_throttle__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash/throttle */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/throttle.js");
|
|
26
|
-
/* harmony import */ var lodash_throttle__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_throttle__WEBPACK_IMPORTED_MODULE_0__);
|
|
27
25
|
/* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-util/helpers.js");
|
|
28
26
|
/* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-util/selection.js");
|
|
27
|
+
/* harmony import */ var lodash_throttle__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash/throttle */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/throttle.js");
|
|
28
|
+
/* harmony import */ var lodash_throttle__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_throttle__WEBPACK_IMPORTED_MODULE_0__);
|
|
29
29
|
|
|
30
30
|
|
|
31
31
|
const ON_MOUSE_MOVE_THROTTLE_MS = 16;
|
|
@@ -143,16 +143,16 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
143
143
|
/* harmony export */ "VictoryCursorContainer": function() { return /* binding */ VictoryCursorContainer; },
|
|
144
144
|
/* harmony export */ "useVictoryCursorContainer": function() { return /* binding */ useVictoryCursorContainer; }
|
|
145
145
|
/* harmony export */ });
|
|
146
|
-
/* harmony import */ var
|
|
147
|
-
/* harmony import */ var
|
|
148
|
-
/* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash/defaults */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/defaults.js");
|
|
149
|
-
/* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_defaults__WEBPACK_IMPORTED_MODULE_1__);
|
|
150
|
-
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "react");
|
|
151
|
-
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__);
|
|
146
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
|
|
147
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
152
148
|
/* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-label/victory-label.js");
|
|
153
149
|
/* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-primitives/line-segment.js");
|
|
154
150
|
/* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-util/helpers.js");
|
|
155
151
|
/* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-container/victory-container.js");
|
|
152
|
+
/* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash/defaults */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/defaults.js");
|
|
153
|
+
/* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_defaults__WEBPACK_IMPORTED_MODULE_1__);
|
|
154
|
+
/* harmony import */ var lodash_isObject__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lodash/isObject */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isObject.js");
|
|
155
|
+
/* harmony import */ var lodash_isObject__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash_isObject__WEBPACK_IMPORTED_MODULE_2__);
|
|
156
156
|
/* harmony import */ var _cursor_helpers__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./cursor-helpers */ "./cursor-helpers.tsx");
|
|
157
157
|
|
|
158
158
|
|
|
@@ -160,12 +160,12 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
160
160
|
|
|
161
161
|
|
|
162
162
|
const VICTORY_CURSOR_CONTAINER_DEFAULT_PROPS = {
|
|
163
|
-
cursorLabelComponent: /*#__PURE__*/
|
|
163
|
+
cursorLabelComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(victory_core__WEBPACK_IMPORTED_MODULE_3__.VictoryLabel, null),
|
|
164
164
|
cursorLabelOffset: {
|
|
165
165
|
x: 5,
|
|
166
166
|
y: -10
|
|
167
167
|
},
|
|
168
|
-
cursorComponent: /*#__PURE__*/
|
|
168
|
+
cursorComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(victory_core__WEBPACK_IMPORTED_MODULE_4__.LineSegment, null)
|
|
169
169
|
};
|
|
170
170
|
const useVictoryCursorContainer = initialProps => {
|
|
171
171
|
const props = {
|
|
@@ -211,11 +211,11 @@ const useVictoryCursorContainer = initialProps => {
|
|
|
211
211
|
const getPadding = () => {
|
|
212
212
|
if (props.padding === undefined) {
|
|
213
213
|
const child = Array.isArray(props.children) ? props.children.find(c => {
|
|
214
|
-
return
|
|
214
|
+
return lodash_isObject__WEBPACK_IMPORTED_MODULE_2___default()(c.props) && c.props.padding !== undefined;
|
|
215
215
|
}) : props.children;
|
|
216
216
|
return victory_core__WEBPACK_IMPORTED_MODULE_5__.getPadding(child?.props);
|
|
217
217
|
}
|
|
218
|
-
return victory_core__WEBPACK_IMPORTED_MODULE_5__.getPadding(props);
|
|
218
|
+
return victory_core__WEBPACK_IMPORTED_MODULE_5__.getPadding(props.padding);
|
|
219
219
|
};
|
|
220
220
|
const getCursorElements = () => {
|
|
221
221
|
const {
|
|
@@ -258,7 +258,7 @@ const useVictoryCursorContainer = initialProps => {
|
|
|
258
258
|
const tooltipTheme = theme && theme.tooltip || {};
|
|
259
259
|
labelProps = lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({}, labelProps, tooltipTheme);
|
|
260
260
|
}
|
|
261
|
-
newElements.push( /*#__PURE__*/
|
|
261
|
+
newElements.push( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(cursorLabelComponent, lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({}, labelProps, {
|
|
262
262
|
text: victory_core__WEBPACK_IMPORTED_MODULE_5__.evaluateProp(cursorLabel, labelProps)
|
|
263
263
|
})));
|
|
264
264
|
}
|
|
@@ -266,7 +266,7 @@ const useVictoryCursorContainer = initialProps => {
|
|
|
266
266
|
stroke: "black"
|
|
267
267
|
}, cursorComponent.props.style);
|
|
268
268
|
if (cursorDimension === "x" || cursorDimension === undefined) {
|
|
269
|
-
newElements.push( /*#__PURE__*/
|
|
269
|
+
newElements.push( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(cursorComponent, {
|
|
270
270
|
key: `${name}-x-cursor`,
|
|
271
271
|
x1: cursorCoordinates.x,
|
|
272
272
|
x2: cursorCoordinates.x,
|
|
@@ -276,7 +276,7 @@ const useVictoryCursorContainer = initialProps => {
|
|
|
276
276
|
}));
|
|
277
277
|
}
|
|
278
278
|
if (cursorDimension === "y" || cursorDimension === undefined) {
|
|
279
|
-
newElements.push( /*#__PURE__*/
|
|
279
|
+
newElements.push( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(cursorComponent, {
|
|
280
280
|
key: `${name}-y-cursor`,
|
|
281
281
|
x1: padding.left,
|
|
282
282
|
x2: (typeof width === "number" ? width : 0) - padding.right,
|
|
@@ -289,7 +289,7 @@ const useVictoryCursorContainer = initialProps => {
|
|
|
289
289
|
};
|
|
290
290
|
return {
|
|
291
291
|
props,
|
|
292
|
-
children: [...
|
|
292
|
+
children: [...react__WEBPACK_IMPORTED_MODULE_0___default().Children.toArray(children), ...getCursorElements()]
|
|
293
293
|
};
|
|
294
294
|
};
|
|
295
295
|
const VictoryCursorContainer = initialProps => {
|
|
@@ -297,7 +297,7 @@ const VictoryCursorContainer = initialProps => {
|
|
|
297
297
|
props,
|
|
298
298
|
children
|
|
299
299
|
} = useVictoryCursorContainer(initialProps);
|
|
300
|
-
return /*#__PURE__*/
|
|
300
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(victory_core__WEBPACK_IMPORTED_MODULE_7__.VictoryContainer, props, children);
|
|
301
301
|
};
|
|
302
302
|
VictoryCursorContainer.role = "container";
|
|
303
303
|
VictoryCursorContainer.defaultEvents = initialProps => {
|
|
@@ -2980,16 +2980,15 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
2980
2980
|
/* harmony export */ "VictoryContainer": function() { return /* binding */ VictoryContainer; },
|
|
2981
2981
|
/* harmony export */ "useVictoryContainer": function() { return /* binding */ useVictoryContainer; }
|
|
2982
2982
|
/* harmony export */ });
|
|
2983
|
-
/* harmony import */ var
|
|
2984
|
-
/* harmony import */ var
|
|
2985
|
-
/* harmony import */ var
|
|
2986
|
-
/* harmony import */ var
|
|
2983
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
|
|
2984
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
2985
|
+
/* harmony import */ var lodash_uniqueId__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash/uniqueId */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/uniqueId.js");
|
|
2986
|
+
/* harmony import */ var lodash_uniqueId__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_uniqueId__WEBPACK_IMPORTED_MODULE_1__);
|
|
2987
2987
|
/* harmony import */ var _victory_portal_portal__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../victory-portal/portal */ "../../victory-core/es/victory-portal/portal.js");
|
|
2988
2988
|
/* 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");
|
|
2989
2989
|
/* harmony import */ var _victory_util__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../victory-util */ "../../victory-core/es/victory-util/merge-refs.js");
|
|
2990
2990
|
/* 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");
|
|
2991
2991
|
/* 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");
|
|
2992
|
-
|
|
2993
2992
|
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); }
|
|
2994
2993
|
|
|
2995
2994
|
|
|
@@ -2997,9 +2996,10 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function
|
|
|
2997
2996
|
|
|
2998
2997
|
|
|
2999
2998
|
|
|
2999
|
+
|
|
3000
3000
|
const defaultProps = {
|
|
3001
3001
|
className: "VictoryContainer",
|
|
3002
|
-
portalComponent: /*#__PURE__*/
|
|
3002
|
+
portalComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_victory_portal_portal__WEBPACK_IMPORTED_MODULE_2__.Portal, null),
|
|
3003
3003
|
portalZIndex: 99,
|
|
3004
3004
|
responsive: true,
|
|
3005
3005
|
role: "img"
|
|
@@ -3016,10 +3016,10 @@ function useVictoryContainer(initialProps) {
|
|
|
3016
3016
|
height,
|
|
3017
3017
|
responsive
|
|
3018
3018
|
} = props;
|
|
3019
|
-
const localContainerRef = (0,
|
|
3019
|
+
const localContainerRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
|
|
3020
3020
|
|
|
3021
3021
|
// Generated ID stored in ref because it needs to persist across renders
|
|
3022
|
-
const generatedId = (0,
|
|
3022
|
+
const generatedId = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(lodash_uniqueId__WEBPACK_IMPORTED_MODULE_1___default()("victory-container-"));
|
|
3023
3023
|
const containerId = props.containerId ?? generatedId.current;
|
|
3024
3024
|
const getIdForElement = elName => `${containerId}-${elName}`;
|
|
3025
3025
|
const userProps = _victory_util_user_props__WEBPACK_IMPORTED_MODULE_3__.getSafeUserProps(props);
|
|
@@ -3078,7 +3078,7 @@ const VictoryContainer = initialProps => {
|
|
|
3078
3078
|
containerRef,
|
|
3079
3079
|
localContainerRef
|
|
3080
3080
|
} = useVictoryContainer(initialProps);
|
|
3081
|
-
|
|
3081
|
+
react__WEBPACK_IMPORTED_MODULE_0___default().useEffect(() => {
|
|
3082
3082
|
if (!events?.onWheel) return;
|
|
3083
3083
|
const handleWheel = e => e.preventDefault();
|
|
3084
3084
|
const container = localContainerRef?.current;
|
|
@@ -3088,7 +3088,7 @@ const VictoryContainer = initialProps => {
|
|
|
3088
3088
|
};
|
|
3089
3089
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
3090
3090
|
}, []);
|
|
3091
|
-
return /*#__PURE__*/
|
|
3091
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
|
|
3092
3092
|
className: className,
|
|
3093
3093
|
style: {
|
|
3094
3094
|
...style,
|
|
@@ -3102,7 +3102,7 @@ const VictoryContainer = initialProps => {
|
|
|
3102
3102
|
"data-ouia-component-type": ouiaType,
|
|
3103
3103
|
"data-ouia-safe": ouiaSafe,
|
|
3104
3104
|
ref: (0,_victory_util__WEBPACK_IMPORTED_MODULE_4__.mergeRefs)([localContainerRef, containerRef])
|
|
3105
|
-
}, /*#__PURE__*/
|
|
3105
|
+
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_victory_portal_portal_context__WEBPACK_IMPORTED_MODULE_5__.PortalProvider, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("svg", _extends({
|
|
3106
3106
|
width: width,
|
|
3107
3107
|
height: height,
|
|
3108
3108
|
tabIndex: tabIndex,
|
|
@@ -3115,11 +3115,11 @@ const VictoryContainer = initialProps => {
|
|
|
3115
3115
|
...dimensions,
|
|
3116
3116
|
pointerEvents: "all"
|
|
3117
3117
|
}
|
|
3118
|
-
}, userProps, events), title ? /*#__PURE__*/
|
|
3118
|
+
}, userProps, events), title ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("title", {
|
|
3119
3119
|
id: titleId
|
|
3120
|
-
}, title) : null, desc ? /*#__PURE__*/
|
|
3120
|
+
}, title) : null, desc ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("desc", {
|
|
3121
3121
|
id: descId
|
|
3122
|
-
}, desc) : null, children), /*#__PURE__*/
|
|
3122
|
+
}, desc) : null, children), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
|
|
3123
3123
|
style: {
|
|
3124
3124
|
...dimensions,
|
|
3125
3125
|
zIndex: portalZIndex,
|
|
@@ -3127,7 +3127,7 @@ const VictoryContainer = initialProps => {
|
|
|
3127
3127
|
top: 0,
|
|
3128
3128
|
left: 0
|
|
3129
3129
|
}
|
|
3130
|
-
}, /*#__PURE__*/
|
|
3130
|
+
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_victory_portal_portal_outlet__WEBPACK_IMPORTED_MODULE_6__.PortalOutlet, {
|
|
3131
3131
|
as: portalComponent,
|
|
3132
3132
|
width: width,
|
|
3133
3133
|
height: height,
|
|
@@ -3154,12 +3154,12 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
3154
3154
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
3155
3155
|
/* harmony export */ "VictoryLabel": function() { return /* binding */ VictoryLabel; }
|
|
3156
3156
|
/* harmony export */ });
|
|
3157
|
-
/* harmony import */ var
|
|
3158
|
-
/* harmony import */ var
|
|
3157
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
|
|
3158
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
3159
3159
|
/* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash/defaults */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/defaults.js");
|
|
3160
3160
|
/* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_defaults__WEBPACK_IMPORTED_MODULE_1__);
|
|
3161
|
-
/* harmony import */ var
|
|
3162
|
-
/* harmony import */ var
|
|
3161
|
+
/* harmony import */ var lodash_isEmpty__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lodash/isEmpty */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isEmpty.js");
|
|
3162
|
+
/* harmony import */ var lodash_isEmpty__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash_isEmpty__WEBPACK_IMPORTED_MODULE_2__);
|
|
3163
3163
|
/* harmony import */ var _victory_portal_victory_portal__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../victory-portal/victory-portal */ "../../victory-core/es/victory-portal/victory-portal.js");
|
|
3164
3164
|
/* harmony import */ var _victory_primitives_rect__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../victory-primitives/rect */ "../../victory-core/es/victory-primitives/rect.js");
|
|
3165
3165
|
/* harmony import */ var _victory_primitives_text__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../victory-primitives/text */ "../../victory-core/es/victory-primitives/text.js");
|
|
@@ -3170,9 +3170,9 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
3170
3170
|
/* harmony import */ var _victory_util_style__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../victory-util/style */ "../../victory-core/es/victory-util/style.js");
|
|
3171
3171
|
/* harmony import */ var _victory_util_textsize__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../victory-util/textsize */ "../../victory-core/es/victory-util/textsize.js");
|
|
3172
3172
|
/* harmony import */ var _victory_util_user_props__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../victory-util/user-props */ "../../victory-core/es/victory-util/user-props.js");
|
|
3173
|
+
/* eslint no-magic-numbers: ["error", { "ignore": [-0.5, 0.5, 0, 1, 2] }]*/
|
|
3173
3174
|
|
|
3174
3175
|
|
|
3175
|
-
/* eslint no-magic-numbers: ["error", { "ignore": [-0.5, 0.5, 0, 1, 2] }]*/
|
|
3176
3176
|
|
|
3177
3177
|
|
|
3178
3178
|
|
|
@@ -3224,7 +3224,7 @@ const shouldUseMultilineBackgrounds = props => {
|
|
|
3224
3224
|
backgroundStyle,
|
|
3225
3225
|
backgroundPadding
|
|
3226
3226
|
} = props;
|
|
3227
|
-
return Array.isArray(backgroundStyle) && !
|
|
3227
|
+
return Array.isArray(backgroundStyle) && !lodash_isEmpty__WEBPACK_IMPORTED_MODULE_2___default()(backgroundStyle) || Array.isArray(backgroundPadding) && !lodash_isEmpty__WEBPACK_IMPORTED_MODULE_2___default()(backgroundPadding);
|
|
3228
3228
|
};
|
|
3229
3229
|
const getStyles = (style, props) => {
|
|
3230
3230
|
if (props.disableInlineStyles) {
|
|
@@ -3240,32 +3240,28 @@ const getStyles = (style, props) => {
|
|
|
3240
3240
|
fontSize: getFontSize(baseStyles)
|
|
3241
3241
|
});
|
|
3242
3242
|
};
|
|
3243
|
-
return Array.isArray(style) && !
|
|
3243
|
+
return Array.isArray(style) && !lodash_isEmpty__WEBPACK_IMPORTED_MODULE_2___default()(style) ? style.map(s => getSingleStyle(s)) : getSingleStyle(style);
|
|
3244
3244
|
};
|
|
3245
3245
|
const getBackgroundStyles = (style, props) => {
|
|
3246
3246
|
if (!style) {
|
|
3247
3247
|
return undefined;
|
|
3248
3248
|
}
|
|
3249
|
-
return Array.isArray(style) && !
|
|
3249
|
+
return Array.isArray(style) && !lodash_isEmpty__WEBPACK_IMPORTED_MODULE_2___default()(style) ? style.map(s => _victory_util_helpers__WEBPACK_IMPORTED_MODULE_3__.evaluateStyle(s, props)) : _victory_util_helpers__WEBPACK_IMPORTED_MODULE_3__.evaluateStyle(style, props);
|
|
3250
3250
|
};
|
|
3251
3251
|
const getBackgroundPadding = props => {
|
|
3252
3252
|
if (props.backgroundPadding && Array.isArray(props.backgroundPadding)) {
|
|
3253
3253
|
return props.backgroundPadding.map(backgroundPadding => {
|
|
3254
3254
|
const padding = _victory_util_helpers__WEBPACK_IMPORTED_MODULE_3__.evaluateProp(backgroundPadding, props);
|
|
3255
|
-
return _victory_util_helpers__WEBPACK_IMPORTED_MODULE_3__.getPadding(
|
|
3256
|
-
padding
|
|
3257
|
-
});
|
|
3255
|
+
return _victory_util_helpers__WEBPACK_IMPORTED_MODULE_3__.getPadding(padding);
|
|
3258
3256
|
});
|
|
3259
3257
|
}
|
|
3260
3258
|
const padding = _victory_util_helpers__WEBPACK_IMPORTED_MODULE_3__.evaluateProp(props.backgroundPadding, props);
|
|
3261
|
-
return _victory_util_helpers__WEBPACK_IMPORTED_MODULE_3__.getPadding(
|
|
3262
|
-
padding
|
|
3263
|
-
});
|
|
3259
|
+
return _victory_util_helpers__WEBPACK_IMPORTED_MODULE_3__.getPadding(padding);
|
|
3264
3260
|
};
|
|
3265
3261
|
const getLineHeight = props => {
|
|
3266
3262
|
const lineHeight = _victory_util_helpers__WEBPACK_IMPORTED_MODULE_3__.evaluateProp(props.lineHeight, props);
|
|
3267
3263
|
if (Array.isArray(lineHeight)) {
|
|
3268
|
-
return
|
|
3264
|
+
return lodash_isEmpty__WEBPACK_IMPORTED_MODULE_2___default()(lineHeight) ? [1] : lineHeight;
|
|
3269
3265
|
}
|
|
3270
3266
|
return lineHeight;
|
|
3271
3267
|
};
|
|
@@ -3385,7 +3381,7 @@ const getFullBackground = (calculatedProps, tspanValues) => {
|
|
|
3385
3381
|
x: inline ? xCoordinate - backgroundPadding.left : xCoordinate + dx - backgroundPadding.left,
|
|
3386
3382
|
y: yCoordinate
|
|
3387
3383
|
};
|
|
3388
|
-
return /*#__PURE__*/
|
|
3384
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(backgroundComponent, lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({}, backgroundComponent.props, backgroundProps));
|
|
3389
3385
|
};
|
|
3390
3386
|
const getInlineXOffset = (calculatedProps, textElements, index) => {
|
|
3391
3387
|
const {
|
|
@@ -3455,7 +3451,7 @@ const getChildBackgrounds = (calculatedProps, tspanValues) => {
|
|
|
3455
3451
|
x: xCoord - padding.left,
|
|
3456
3452
|
y: yCoord
|
|
3457
3453
|
};
|
|
3458
|
-
return /*#__PURE__*/
|
|
3454
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(backgroundComponent, lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({}, backgroundComponent.props, backgroundProps));
|
|
3459
3455
|
});
|
|
3460
3456
|
};
|
|
3461
3457
|
const getBackgroundElement = (calculatedProps, tspanValues) => {
|
|
@@ -3586,16 +3582,16 @@ const renderLabel = (calculatedProps, tspanValues) => {
|
|
|
3586
3582
|
style: currentStyle,
|
|
3587
3583
|
children: line
|
|
3588
3584
|
};
|
|
3589
|
-
return /*#__PURE__*/
|
|
3585
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(tspanComponent, tspanProps);
|
|
3590
3586
|
});
|
|
3591
|
-
return /*#__PURE__*/
|
|
3587
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(textComponent, textProps, tspans);
|
|
3592
3588
|
};
|
|
3593
3589
|
const defaultProps = {
|
|
3594
|
-
backgroundComponent: /*#__PURE__*/
|
|
3595
|
-
groupComponent: /*#__PURE__*/
|
|
3590
|
+
backgroundComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_victory_primitives_rect__WEBPACK_IMPORTED_MODULE_8__.Rect, null),
|
|
3591
|
+
groupComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("g", null),
|
|
3596
3592
|
direction: "inherit",
|
|
3597
|
-
textComponent: /*#__PURE__*/
|
|
3598
|
-
tspanComponent: /*#__PURE__*/
|
|
3593
|
+
textComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_victory_primitives_text__WEBPACK_IMPORTED_MODULE_9__.Text, null),
|
|
3594
|
+
tspanComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_victory_primitives_tspan__WEBPACK_IMPORTED_MODULE_10__.TSpan, null),
|
|
3599
3595
|
capHeight: 0.71,
|
|
3600
3596
|
// Magic number from d3.
|
|
3601
3597
|
lineHeight: 1
|
|
@@ -3632,10 +3628,10 @@ const VictoryLabel = initialProps => {
|
|
|
3632
3628
|
if (props.backgroundStyle) {
|
|
3633
3629
|
const backgroundElement = getBackgroundElement(calculatedProps, tspanValues);
|
|
3634
3630
|
const children = [backgroundElement, label];
|
|
3635
|
-
const backgroundWithLabel = /*#__PURE__*/
|
|
3636
|
-
return props.renderInPortal ? /*#__PURE__*/
|
|
3631
|
+
const backgroundWithLabel = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(props.groupComponent, {}, children);
|
|
3632
|
+
return props.renderInPortal ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_victory_portal_victory_portal__WEBPACK_IMPORTED_MODULE_12__.VictoryPortal, null, backgroundWithLabel) : backgroundWithLabel;
|
|
3637
3633
|
}
|
|
3638
|
-
return props.renderInPortal ? /*#__PURE__*/
|
|
3634
|
+
return props.renderInPortal ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_victory_portal_victory_portal__WEBPACK_IMPORTED_MODULE_12__.VictoryPortal, null, label) : label;
|
|
3639
3635
|
};
|
|
3640
3636
|
VictoryLabel.displayName = "VictoryLabel";
|
|
3641
3637
|
VictoryLabel.role = "label";
|
|
@@ -3761,12 +3757,12 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
3761
3757
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
3762
3758
|
/* harmony export */ "VictoryPortal": function() { return /* binding */ VictoryPortal; }
|
|
3763
3759
|
/* harmony export */ });
|
|
3764
|
-
/* harmony import */ var
|
|
3765
|
-
/* harmony import */ var
|
|
3760
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
|
|
3761
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
3766
3762
|
/* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash/defaults */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/defaults.js");
|
|
3767
3763
|
/* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_defaults__WEBPACK_IMPORTED_MODULE_1__);
|
|
3768
|
-
/* harmony import */ var
|
|
3769
|
-
/* harmony import */ var
|
|
3764
|
+
/* harmony import */ var lodash_uniqueId__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lodash/uniqueId */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/uniqueId.js");
|
|
3765
|
+
/* harmony import */ var lodash_uniqueId__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash_uniqueId__WEBPACK_IMPORTED_MODULE_2__);
|
|
3770
3766
|
/* harmony import */ var _victory_util_log__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../victory-util/log */ "../../victory-core/es/victory-util/log.js");
|
|
3771
3767
|
/* harmony import */ var _victory_util_helpers__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../victory-util/helpers */ "../../victory-core/es/victory-util/helpers.js");
|
|
3772
3768
|
/* harmony import */ var _portal_context__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./portal-context */ "../../victory-core/es/victory-portal/portal-context.js");
|
|
@@ -3777,14 +3773,14 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
3777
3773
|
|
|
3778
3774
|
|
|
3779
3775
|
const defaultProps = {
|
|
3780
|
-
groupComponent: /*#__PURE__*/
|
|
3776
|
+
groupComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("g", null)
|
|
3781
3777
|
};
|
|
3782
3778
|
const VictoryPortal = initialProps => {
|
|
3783
3779
|
const props = {
|
|
3784
3780
|
...defaultProps,
|
|
3785
3781
|
...initialProps
|
|
3786
3782
|
};
|
|
3787
|
-
const [id] = (0,
|
|
3783
|
+
const [id] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(lodash_uniqueId__WEBPACK_IMPORTED_MODULE_2___default()());
|
|
3788
3784
|
const portalContext = (0,_portal_context__WEBPACK_IMPORTED_MODULE_3__.usePortalContext)();
|
|
3789
3785
|
if (!portalContext) {
|
|
3790
3786
|
const msg = "`renderInPortal` is not supported outside of `VictoryContainer`. " + "Component will be rendered in place";
|
|
@@ -3802,12 +3798,12 @@ const VictoryPortal = initialProps => {
|
|
|
3802
3798
|
const newProps = lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()(standardProps, childProps, _victory_util_helpers__WEBPACK_IMPORTED_MODULE_5__.omit(props, ["children", "groupComponent"]), {
|
|
3803
3799
|
key: childProps.key ?? id
|
|
3804
3800
|
});
|
|
3805
|
-
const child = children && /*#__PURE__*/
|
|
3806
|
-
|
|
3801
|
+
const child = children && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(children, newProps);
|
|
3802
|
+
react__WEBPACK_IMPORTED_MODULE_0___default().useEffect(() => {
|
|
3807
3803
|
portalContext?.addChild(id, child);
|
|
3808
3804
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
3809
3805
|
}, [props.children]);
|
|
3810
|
-
|
|
3806
|
+
react__WEBPACK_IMPORTED_MODULE_0___default().useEffect(() => {
|
|
3811
3807
|
return () => portalContext?.removeChild(id);
|
|
3812
3808
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
3813
3809
|
}, []);
|
|
@@ -3828,10 +3824,10 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
3828
3824
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
3829
3825
|
/* harmony export */ "LineSegment": function() { return /* binding */ LineSegment; }
|
|
3830
3826
|
/* harmony export */ });
|
|
3831
|
-
/* harmony import */ var
|
|
3832
|
-
/* harmony import */ var
|
|
3833
|
-
/* harmony import */ var
|
|
3834
|
-
/* harmony import */ var
|
|
3827
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
|
|
3828
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
3829
|
+
/* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash/defaults */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/defaults.js");
|
|
3830
|
+
/* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_defaults__WEBPACK_IMPORTED_MODULE_1__);
|
|
3835
3831
|
/* harmony import */ var _victory_util_helpers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../victory-util/helpers */ "../../victory-core/es/victory-util/helpers.js");
|
|
3836
3832
|
/* harmony import */ var _line__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./line */ "../../victory-core/es/victory-primitives/line.js");
|
|
3837
3833
|
|
|
@@ -3863,13 +3859,13 @@ const evaluateProps = props => {
|
|
|
3863
3859
|
});
|
|
3864
3860
|
};
|
|
3865
3861
|
const defaultProps = {
|
|
3866
|
-
lineComponent: /*#__PURE__*/
|
|
3862
|
+
lineComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_line__WEBPACK_IMPORTED_MODULE_3__.Line, null),
|
|
3867
3863
|
role: "presentation",
|
|
3868
3864
|
shapeRendering: "auto"
|
|
3869
3865
|
};
|
|
3870
3866
|
const LineSegment = initialProps => {
|
|
3871
|
-
const props = evaluateProps(
|
|
3872
|
-
return /*#__PURE__*/
|
|
3867
|
+
const props = evaluateProps(lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({}, initialProps, defaultProps));
|
|
3868
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(props.lineComponent, {
|
|
3873
3869
|
...props.events,
|
|
3874
3870
|
"aria-label": props.ariaLabel,
|
|
3875
3871
|
style: props.style,
|
|
@@ -5279,40 +5275,45 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
5279
5275
|
/* harmony export */ "reduceChildren": function() { return /* binding */ reduceChildren; },
|
|
5280
5276
|
/* harmony export */ "scalePoint": function() { return /* binding */ scalePoint; }
|
|
5281
5277
|
/* harmony export */ });
|
|
5282
|
-
/* harmony import */ var
|
|
5283
|
-
/* harmony import */ var
|
|
5284
|
-
/* harmony import */ var
|
|
5285
|
-
/* harmony import */ var
|
|
5286
|
-
/* harmony import */ var
|
|
5287
|
-
/* harmony import */ var
|
|
5288
|
-
/* harmony import */ var
|
|
5289
|
-
/* harmony import */ var
|
|
5290
|
-
|
|
5278
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
|
|
5279
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
5280
|
+
/* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash/defaults */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/defaults.js");
|
|
5281
|
+
/* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_defaults__WEBPACK_IMPORTED_MODULE_1__);
|
|
5282
|
+
/* harmony import */ var lodash_property__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lodash/property */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/property.js");
|
|
5283
|
+
/* harmony import */ var lodash_property__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash_property__WEBPACK_IMPORTED_MODULE_2__);
|
|
5284
|
+
/* harmony import */ var lodash_pick__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! lodash/pick */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/pick.js");
|
|
5285
|
+
/* harmony import */ var lodash_pick__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(lodash_pick__WEBPACK_IMPORTED_MODULE_3__);
|
|
5291
5286
|
|
|
5292
5287
|
|
|
5293
5288
|
|
|
5294
|
-
// Private Functions
|
|
5295
5289
|
|
|
5296
|
-
|
|
5297
|
-
|
|
5298
|
-
|
|
5299
|
-
|
|
5290
|
+
/**
|
|
5291
|
+
* Determine the range of a cartesian axis
|
|
5292
|
+
*/
|
|
5293
|
+
function getCartesianRange(options) {
|
|
5294
|
+
const vertical = options.axis !== "x";
|
|
5300
5295
|
if (vertical) {
|
|
5301
|
-
return [
|
|
5296
|
+
return [options.height - options.padding.bottom, options.padding.top];
|
|
5302
5297
|
}
|
|
5303
|
-
return [padding.left,
|
|
5298
|
+
return [options.padding.left, options.width - options.padding.right];
|
|
5304
5299
|
}
|
|
5305
|
-
|
|
5306
|
-
|
|
5307
|
-
|
|
5308
|
-
|
|
5300
|
+
|
|
5301
|
+
/**
|
|
5302
|
+
* Determine the range of a polar axis in radians
|
|
5303
|
+
*/
|
|
5304
|
+
function getPolarRange(options) {
|
|
5305
|
+
if (options.axis === "x") {
|
|
5306
|
+
const startAngle = degreesToRadians(options.startAngle || 0);
|
|
5307
|
+
const endAngle = degreesToRadians(options.endAngle || 360);
|
|
5309
5308
|
return [startAngle, endAngle];
|
|
5310
5309
|
}
|
|
5311
|
-
return [
|
|
5310
|
+
return [options.innerRadius || 0, getRadius({
|
|
5311
|
+
height: options.height,
|
|
5312
|
+
width: options.width,
|
|
5313
|
+
padding: options.padding
|
|
5314
|
+
})];
|
|
5312
5315
|
}
|
|
5313
5316
|
|
|
5314
|
-
// Exported Functions
|
|
5315
|
-
|
|
5316
5317
|
/**
|
|
5317
5318
|
* Creates an object composed of the inverted keys and values of object.
|
|
5318
5319
|
* If object contains duplicate values, subsequent values overwrite property assignments of previous values.
|
|
@@ -5349,8 +5350,11 @@ function omit(originalObject, ks) {
|
|
|
5349
5350
|
}
|
|
5350
5351
|
return newObject;
|
|
5351
5352
|
}
|
|
5353
|
+
|
|
5354
|
+
/**
|
|
5355
|
+
* Coalesce the x and y values from a data point
|
|
5356
|
+
*/
|
|
5352
5357
|
function getPoint(datum) {
|
|
5353
|
-
const exists = val => val !== undefined;
|
|
5354
5358
|
const {
|
|
5355
5359
|
_x,
|
|
5356
5360
|
_x1,
|
|
@@ -5361,16 +5365,20 @@ function getPoint(datum) {
|
|
|
5361
5365
|
_y0,
|
|
5362
5366
|
_voronoiY
|
|
5363
5367
|
} = datum;
|
|
5364
|
-
const defaultX =
|
|
5365
|
-
const defaultY =
|
|
5368
|
+
const defaultX = _x1 ?? _x;
|
|
5369
|
+
const defaultY = _y1 ?? _y;
|
|
5366
5370
|
const point = {
|
|
5367
|
-
x:
|
|
5368
|
-
x0:
|
|
5369
|
-
y:
|
|
5370
|
-
y0:
|
|
5371
|
+
x: _voronoiX ?? defaultX,
|
|
5372
|
+
x0: _x0 ?? _x,
|
|
5373
|
+
y: _voronoiY ?? defaultY,
|
|
5374
|
+
y0: _y0 ?? _y
|
|
5371
5375
|
};
|
|
5372
|
-
return
|
|
5376
|
+
return lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({}, point, datum);
|
|
5373
5377
|
}
|
|
5378
|
+
|
|
5379
|
+
/**
|
|
5380
|
+
* Scale a point based on the origin, direction, and given scale function
|
|
5381
|
+
*/
|
|
5374
5382
|
function scalePoint(props, datum) {
|
|
5375
5383
|
const {
|
|
5376
5384
|
scale,
|
|
@@ -5393,11 +5401,11 @@ function scalePoint(props, datum) {
|
|
|
5393
5401
|
y0: polar ? -y0 * Math.sin(x0) + origin.x : y0
|
|
5394
5402
|
};
|
|
5395
5403
|
}
|
|
5396
|
-
|
|
5397
|
-
|
|
5398
|
-
|
|
5399
|
-
|
|
5400
|
-
|
|
5404
|
+
|
|
5405
|
+
/**
|
|
5406
|
+
* Returns a padding value from a number or partial padding values
|
|
5407
|
+
*/
|
|
5408
|
+
function getPadding(padding) {
|
|
5401
5409
|
const paddingVal = typeof padding === "number" ? padding : 0;
|
|
5402
5410
|
const paddingObj = typeof padding === "object" ? padding : {};
|
|
5403
5411
|
return {
|
|
@@ -5407,6 +5415,10 @@ function getPadding(props, name) {
|
|
|
5407
5415
|
right: paddingObj.right || paddingVal
|
|
5408
5416
|
};
|
|
5409
5417
|
}
|
|
5418
|
+
|
|
5419
|
+
/**
|
|
5420
|
+
* Returns true if the component is defined as a tooltip
|
|
5421
|
+
*/
|
|
5410
5422
|
function isTooltip(component) {
|
|
5411
5423
|
const labelRole = component && component.type && component.type.role;
|
|
5412
5424
|
return labelRole === "tooltip";
|
|
@@ -5421,8 +5433,8 @@ function getDefaultStyles(props, role) {
|
|
|
5421
5433
|
return defaultStyles;
|
|
5422
5434
|
}
|
|
5423
5435
|
const tooltipStyle = theme.tooltip && theme.tooltip.style || {};
|
|
5424
|
-
const labelStyle =
|
|
5425
|
-
return
|
|
5436
|
+
const labelStyle = lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({}, tooltipStyle, defaultStyles.labels);
|
|
5437
|
+
return lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({}, {
|
|
5426
5438
|
labels: labelStyle
|
|
5427
5439
|
}, defaultStyles);
|
|
5428
5440
|
}
|
|
@@ -5430,7 +5442,7 @@ function getStyles(style, defaultStyles) {
|
|
|
5430
5442
|
const width = "100%";
|
|
5431
5443
|
const height = "100%";
|
|
5432
5444
|
if (!style) {
|
|
5433
|
-
return
|
|
5445
|
+
return lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({
|
|
5434
5446
|
parent: {
|
|
5435
5447
|
height,
|
|
5436
5448
|
width
|
|
@@ -5446,14 +5458,18 @@ function getStyles(style, defaultStyles) {
|
|
|
5446
5458
|
const defaultLabels = defaultStyles && defaultStyles.labels || {};
|
|
5447
5459
|
const defaultData = defaultStyles && defaultStyles.data || {};
|
|
5448
5460
|
return {
|
|
5449
|
-
parent:
|
|
5461
|
+
parent: lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({}, parent, defaultParent, {
|
|
5450
5462
|
width,
|
|
5451
5463
|
height
|
|
5452
5464
|
}),
|
|
5453
|
-
labels:
|
|
5454
|
-
data:
|
|
5465
|
+
labels: lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({}, labels, defaultLabels),
|
|
5466
|
+
data: lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({}, data, defaultData)
|
|
5455
5467
|
};
|
|
5456
5468
|
}
|
|
5469
|
+
|
|
5470
|
+
/**
|
|
5471
|
+
* Returns the value of a prop or accessor function with the given props
|
|
5472
|
+
*/
|
|
5457
5473
|
function evaluateProp(prop, props) {
|
|
5458
5474
|
return isFunction(prop) ? prop(props) : prop;
|
|
5459
5475
|
}
|
|
@@ -5475,19 +5491,28 @@ function degreesToRadians(degrees) {
|
|
|
5475
5491
|
function radiansToDegrees(radians) {
|
|
5476
5492
|
return typeof radians === "number" ? radians / (Math.PI / 180) : radians;
|
|
5477
5493
|
}
|
|
5478
|
-
|
|
5494
|
+
|
|
5495
|
+
/**
|
|
5496
|
+
* Get the maximum radius that will fit in the container
|
|
5497
|
+
*/
|
|
5498
|
+
function getRadius(options) {
|
|
5499
|
+
const {
|
|
5500
|
+
width,
|
|
5501
|
+
height,
|
|
5502
|
+
padding
|
|
5503
|
+
} = options;
|
|
5479
5504
|
const {
|
|
5480
5505
|
left,
|
|
5481
5506
|
right,
|
|
5482
5507
|
top,
|
|
5483
5508
|
bottom
|
|
5484
|
-
} =
|
|
5485
|
-
const {
|
|
5486
|
-
width,
|
|
5487
|
-
height
|
|
5488
|
-
} = props;
|
|
5509
|
+
} = padding;
|
|
5489
5510
|
return Math.min(width - left - right, height - top - bottom) / 2;
|
|
5490
5511
|
}
|
|
5512
|
+
|
|
5513
|
+
/**
|
|
5514
|
+
* Returns the origin for a polar chart within the padded area
|
|
5515
|
+
*/
|
|
5491
5516
|
function getPolarOrigin(props) {
|
|
5492
5517
|
const {
|
|
5493
5518
|
width,
|
|
@@ -5498,7 +5523,7 @@ function getPolarOrigin(props) {
|
|
|
5498
5523
|
bottom,
|
|
5499
5524
|
left,
|
|
5500
5525
|
right
|
|
5501
|
-
} = getPadding(props);
|
|
5526
|
+
} = getPadding(props.padding);
|
|
5502
5527
|
const radius = Math.min(width - left - right, height - top - bottom) / 2;
|
|
5503
5528
|
const offsetWidth = width / 2 + left - right;
|
|
5504
5529
|
const offsetHeight = height / 2 + top - bottom;
|
|
@@ -5507,13 +5532,30 @@ function getPolarOrigin(props) {
|
|
|
5507
5532
|
y: offsetHeight + radius > height ? radius + top - bottom : offsetHeight
|
|
5508
5533
|
};
|
|
5509
5534
|
}
|
|
5535
|
+
|
|
5536
|
+
/**
|
|
5537
|
+
* Determine the range of an axis based on the given props
|
|
5538
|
+
*/
|
|
5510
5539
|
function getRange(props, axis) {
|
|
5511
5540
|
if (props.range && props.range[axis]) {
|
|
5512
5541
|
return props.range[axis];
|
|
5513
5542
|
} else if (props.range && Array.isArray(props.range)) {
|
|
5514
5543
|
return props.range;
|
|
5515
5544
|
}
|
|
5516
|
-
return props.polar ? getPolarRange(
|
|
5545
|
+
return props.polar ? getPolarRange({
|
|
5546
|
+
axis,
|
|
5547
|
+
innerRadius: props.innerRadius,
|
|
5548
|
+
startAngle: props.startAngle,
|
|
5549
|
+
endAngle: props.endAngle,
|
|
5550
|
+
height: props.height,
|
|
5551
|
+
width: props.width,
|
|
5552
|
+
padding: getPadding(props.padding)
|
|
5553
|
+
}) : getCartesianRange({
|
|
5554
|
+
axis,
|
|
5555
|
+
height: props.height,
|
|
5556
|
+
width: props.width,
|
|
5557
|
+
padding: getPadding(props.padding)
|
|
5558
|
+
});
|
|
5517
5559
|
}
|
|
5518
5560
|
|
|
5519
5561
|
/**
|
|
@@ -5545,7 +5587,7 @@ function createAccessor(key) {
|
|
|
5545
5587
|
return x => x;
|
|
5546
5588
|
}
|
|
5547
5589
|
// otherwise, assume it is an array index, property key or path (_.property handles all three)
|
|
5548
|
-
return
|
|
5590
|
+
return lodash_property__WEBPACK_IMPORTED_MODULE_2___default()(key);
|
|
5549
5591
|
}
|
|
5550
5592
|
function modifyProps(props, fallbackProps, role) {
|
|
5551
5593
|
const theme = props.theme && props.theme[role] ? props.theme[role] : {};
|
|
@@ -5554,7 +5596,7 @@ function modifyProps(props, fallbackProps, role) {
|
|
|
5554
5596
|
const defaultObject = horizontal === undefined ? {} : {
|
|
5555
5597
|
horizontal
|
|
5556
5598
|
};
|
|
5557
|
-
return
|
|
5599
|
+
return lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()(defaultObject, props, themeProps, fallbackProps);
|
|
5558
5600
|
}
|
|
5559
5601
|
|
|
5560
5602
|
/**
|
|
@@ -5641,10 +5683,10 @@ initialMemo, combine) {
|
|
|
5641
5683
|
const childRole = child.type && child.type.role;
|
|
5642
5684
|
const childName = child.props.name || `${childRole}-${names[index]}`;
|
|
5643
5685
|
if (child.props && child.props.children) {
|
|
5644
|
-
const childProps = Object.assign({}, child.props,
|
|
5645
|
-
const nestedChildren = child.type && child.type.role === "stack" && isFunction(child.type.getChildren) ? child.type.getChildren(childProps) :
|
|
5646
|
-
const nestedChildProps = Object.assign({}, c.props,
|
|
5647
|
-
return /*#__PURE__*/
|
|
5686
|
+
const childProps = Object.assign({}, child.props, lodash_pick__WEBPACK_IMPORTED_MODULE_3___default()(parentProps, sharedProps));
|
|
5687
|
+
const nestedChildren = child.type && child.type.role === "stack" && isFunction(child.type.getChildren) ? child.type.getChildren(childProps) : react__WEBPACK_IMPORTED_MODULE_0___default().Children.toArray(child.props.children).map(c => {
|
|
5688
|
+
const nestedChildProps = Object.assign({}, c.props, lodash_pick__WEBPACK_IMPORTED_MODULE_3___default()(childProps, sharedProps));
|
|
5689
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(c, nestedChildProps);
|
|
5648
5690
|
});
|
|
5649
5691
|
const childNames = nestedChildren.map((c, i) => `${childName}-${i}`);
|
|
5650
5692
|
const nestedResults = traverseChildren(nestedChildren, childNames, child);
|
|
@@ -5658,7 +5700,7 @@ initialMemo, combine) {
|
|
|
5658
5700
|
return newMemo;
|
|
5659
5701
|
}, initialMemo);
|
|
5660
5702
|
};
|
|
5661
|
-
const validChildren = children.filter(
|
|
5703
|
+
const validChildren = children.filter(react__WEBPACK_IMPORTED_MODULE_0__.isValidElement);
|
|
5662
5704
|
const childNames = validChildren.map((c, i) => i);
|
|
5663
5705
|
return traverseChildren(validChildren, childNames);
|
|
5664
5706
|
}
|
|
@@ -5678,10 +5720,10 @@ function isHorizontal(props) {
|
|
|
5678
5720
|
if (memo || childProps.horizontal || !childProps.children) {
|
|
5679
5721
|
return memo || childProps.horizontal;
|
|
5680
5722
|
}
|
|
5681
|
-
return traverseChildren(
|
|
5723
|
+
return traverseChildren(react__WEBPACK_IMPORTED_MODULE_0___default().Children.toArray(childProps.children));
|
|
5682
5724
|
}, false);
|
|
5683
5725
|
};
|
|
5684
|
-
return traverseChildren(
|
|
5726
|
+
return traverseChildren(react__WEBPACK_IMPORTED_MODULE_0___default().Children.toArray(props.children));
|
|
5685
5727
|
}
|
|
5686
5728
|
|
|
5687
5729
|
/***/ }),
|
|
@@ -5702,9 +5744,10 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
5702
5744
|
/* harmony export */ "getProps": function() { return /* binding */ getProps; },
|
|
5703
5745
|
/* harmony export */ "getText": function() { return /* binding */ getText; }
|
|
5704
5746
|
/* harmony export */ });
|
|
5747
|
+
/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./helpers */ "../../victory-core/es/victory-util/helpers.js");
|
|
5705
5748
|
/* 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");
|
|
5706
5749
|
/* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_defaults__WEBPACK_IMPORTED_MODULE_0__);
|
|
5707
|
-
|
|
5750
|
+
|
|
5708
5751
|
|
|
5709
5752
|
|
|
5710
5753
|
// Private Functions
|
|
@@ -5950,11 +5993,12 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
5950
5993
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
5951
5994
|
/* harmony export */ "warn": function() { return /* binding */ warn; }
|
|
5952
5995
|
/* harmony export */ });
|
|
5953
|
-
/* global console */
|
|
5996
|
+
/* global console process */
|
|
5954
5997
|
/* eslint-disable no-console */
|
|
5955
5998
|
|
|
5956
|
-
// TODO: Use "warning" npm module like React is switching to.
|
|
5957
5999
|
function warn(message) {
|
|
6000
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
6001
|
+
// @ts-ignore - Webpack DefinePlugin will replace process.env.NODE_ENV
|
|
5958
6002
|
if (true) {
|
|
5959
6003
|
if (console && console.warn) {
|
|
5960
6004
|
console.warn(message);
|
|
@@ -6232,13 +6276,15 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
6232
6276
|
/* harmony export */ "approximateTextSize": function() { return /* binding */ approximateTextSize; },
|
|
6233
6277
|
/* harmony export */ "convertLengthToPixels": function() { return /* binding */ convertLengthToPixels; }
|
|
6234
6278
|
/* harmony export */ });
|
|
6235
|
-
/* harmony import */ var
|
|
6236
|
-
/* harmony import */ var
|
|
6237
|
-
/* harmony import */ var
|
|
6238
|
-
/* harmony import */ var
|
|
6239
|
-
|
|
6240
|
-
// http://www.pearsonified.com/2012/01/characters-per-line.php
|
|
6279
|
+
/* 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");
|
|
6280
|
+
/* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_defaults__WEBPACK_IMPORTED_MODULE_0__);
|
|
6281
|
+
/* harmony import */ var lodash_memoize__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash/memoize */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/memoize.js");
|
|
6282
|
+
/* harmony import */ var lodash_memoize__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_memoize__WEBPACK_IMPORTED_MODULE_1__);
|
|
6283
|
+
// http://www.pearsonified.com/2012/01/characters-per-line.php
|
|
6241
6284
|
/* eslint-disable no-magic-numbers */
|
|
6285
|
+
|
|
6286
|
+
|
|
6287
|
+
|
|
6242
6288
|
// Based on measuring specific character widths
|
|
6243
6289
|
// as in the following example https://bl.ocks.org/tophtucker/62f93a4658387bb61e4510c37e2e97cf
|
|
6244
6290
|
// For new fonts: pull gist, open index.html locally, add font files (if not generic), enter font name in `font-family` input
|
|
@@ -6417,7 +6463,7 @@ const convertLengthToPixels = (length, fontSize) => {
|
|
|
6417
6463
|
};
|
|
6418
6464
|
const _prepareParams = (inputStyle, index) => {
|
|
6419
6465
|
const lineStyle = Array.isArray(inputStyle) ? inputStyle[index] : inputStyle;
|
|
6420
|
-
const style =
|
|
6466
|
+
const style = lodash_defaults__WEBPACK_IMPORTED_MODULE_0___default()({}, lineStyle, defaultStyle);
|
|
6421
6467
|
return Object.assign({}, style, {
|
|
6422
6468
|
fontFamily: style.fontFamily,
|
|
6423
6469
|
letterSpacing: typeof style.letterSpacing === "number" ? style.letterSpacing : convertLengthToPixels(String(style.letterSpacing), style.fontSize),
|
|
@@ -6465,7 +6511,7 @@ const _approximateDimensionsInternal = (text, style) => {
|
|
|
6465
6511
|
height: heightWithRotate * coefficients.heightOverlapCoef
|
|
6466
6512
|
};
|
|
6467
6513
|
};
|
|
6468
|
-
const _getMeasurementContainer =
|
|
6514
|
+
const _getMeasurementContainer = lodash_memoize__WEBPACK_IMPORTED_MODULE_1___default()(() => {
|
|
6469
6515
|
const element = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
6470
6516
|
element.setAttribute("xlink", "http://www.w3.org/1999/xlink");
|
|
6471
6517
|
element.setAttribute("width", "300");
|
|
@@ -6486,7 +6532,7 @@ const styleToKeyComponent = style => {
|
|
|
6486
6532
|
}
|
|
6487
6533
|
return `${style.angle}:${style.fontFamily}:${style.fontSize}:${style.letterSpacing}:${style.lineHeight}`;
|
|
6488
6534
|
};
|
|
6489
|
-
const _measureDimensionsInternal =
|
|
6535
|
+
const _measureDimensionsInternal = lodash_memoize__WEBPACK_IMPORTED_MODULE_1___default()((text, style) => {
|
|
6490
6536
|
let containerElement = _getMeasurementContainer();
|
|
6491
6537
|
if (!containerElement.isConnected) {
|
|
6492
6538
|
_getMeasurementContainer.cache.clear?.();
|