victory-core 36.6.0 → 36.6.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.
Files changed (172) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/dist/victory-core.js +5 -3
  3. package/es/index.js +1 -2
  4. package/es/types/callbacks.d.ts +2 -1
  5. package/es/types/callbacks.js +1 -2
  6. package/es/types/prop-types.js +1 -2
  7. package/es/victory-accessible-group/victory-accessible-group.js +1 -2
  8. package/es/victory-animation/util.js +1 -2
  9. package/es/victory-animation/victory-animation.js +1 -2
  10. package/es/victory-clip-container/victory-clip-container.js +1 -2
  11. package/es/victory-container/victory-container.js +1 -2
  12. package/es/victory-label/victory-label.d.ts +4 -8
  13. package/es/victory-label/victory-label.js +1 -2
  14. package/es/victory-portal/portal-context.js +1 -2
  15. package/es/victory-portal/portal.js +1 -2
  16. package/es/victory-portal/victory-portal.js +1 -2
  17. package/es/victory-primitives/arc.js +1 -2
  18. package/es/victory-primitives/background.js +1 -2
  19. package/es/victory-primitives/border.js +1 -2
  20. package/es/victory-primitives/circle.js +1 -2
  21. package/es/victory-primitives/clip-path.js +1 -2
  22. package/es/victory-primitives/index.js +1 -2
  23. package/es/victory-primitives/line-segment.js +1 -2
  24. package/es/victory-primitives/line.js +1 -2
  25. package/es/victory-primitives/path.js +1 -2
  26. package/es/victory-primitives/point.js +1 -2
  27. package/es/victory-primitives/rect.js +1 -2
  28. package/es/victory-primitives/text.js +1 -2
  29. package/es/victory-primitives/tspan.js +1 -2
  30. package/es/victory-primitives/types.js +1 -2
  31. package/es/victory-primitives/whisker.js +1 -2
  32. package/es/victory-state/defaults.js +1 -2
  33. package/es/victory-state/helpers/get-axis-data.js +1 -2
  34. package/es/victory-state/helpers/get-data.js +1 -2
  35. package/es/victory-state/helpers/get-domain.js +1 -2
  36. package/es/victory-state/helpers/get-range.js +1 -2
  37. package/es/victory-state/helpers/get-scale.js +1 -2
  38. package/es/victory-state/index.js +1 -2
  39. package/es/victory-state/types.js +1 -2
  40. package/es/victory-state/victory-provider.js +1 -2
  41. package/es/victory-theme/grayscale.js +1 -2
  42. package/es/victory-theme/material.js +1 -2
  43. package/es/victory-theme/types.js +1 -2
  44. package/es/victory-theme/victory-theme.js +1 -2
  45. package/es/victory-transition/victory-transition.js +1 -2
  46. package/es/victory-util/add-events.d.ts +25 -7
  47. package/es/victory-util/add-events.js +1 -2
  48. package/es/victory-util/axis.js +1 -2
  49. package/es/victory-util/collection.js +1 -2
  50. package/es/victory-util/common-props.js +1 -2
  51. package/es/victory-util/data.js +1 -2
  52. package/es/victory-util/default-transitions.js +1 -2
  53. package/es/victory-util/domain.js +1 -2
  54. package/es/victory-util/events.d.ts +1 -1
  55. package/es/victory-util/events.js +1 -2
  56. package/es/victory-util/helpers.d.ts +2 -1
  57. package/es/victory-util/helpers.js +1 -2
  58. package/es/victory-util/hooks/index.js +1 -2
  59. package/es/victory-util/hooks/use-animation-state.js +1 -2
  60. package/es/victory-util/hooks/use-previous-props.js +1 -2
  61. package/es/victory-util/immutable.js +1 -2
  62. package/es/victory-util/index.js +1 -2
  63. package/es/victory-util/label-helpers.js +1 -2
  64. package/es/victory-util/line-helpers.js +1 -2
  65. package/es/victory-util/log.js +1 -2
  66. package/es/victory-util/point-path-helpers.js +1 -2
  67. package/es/victory-util/prop-types.js +1 -2
  68. package/es/victory-util/scale.js +1 -2
  69. package/es/victory-util/selection.d.ts +1 -1
  70. package/es/victory-util/selection.js +2 -3
  71. package/es/victory-util/style.js +1 -2
  72. package/es/victory-util/textsize.js +1 -2
  73. package/es/victory-util/timer-context.js +1 -2
  74. package/es/victory-util/timer.js +1 -2
  75. package/es/victory-util/transitions.js +1 -2
  76. package/es/victory-util/type-helpers.js +1 -2
  77. package/es/victory-util/user-props.d.ts +1 -1
  78. package/es/victory-util/user-props.js +4 -3
  79. package/es/victory-util/with-container.d.ts +1 -1
  80. package/es/victory-util/with-container.js +1 -2
  81. package/es/victory-util/wrapper.d.ts +1 -1
  82. package/es/victory-util/wrapper.js +1 -2
  83. package/lib/index.js +1 -2
  84. package/lib/types/callbacks.d.ts +2 -1
  85. package/lib/types/callbacks.js +1 -2
  86. package/lib/types/prop-types.js +1 -2
  87. package/lib/victory-accessible-group/victory-accessible-group.js +1 -2
  88. package/lib/victory-animation/util.js +1 -2
  89. package/lib/victory-animation/victory-animation.js +1 -2
  90. package/lib/victory-clip-container/victory-clip-container.js +1 -2
  91. package/lib/victory-container/victory-container.js +1 -2
  92. package/lib/victory-label/victory-label.d.ts +4 -8
  93. package/lib/victory-label/victory-label.js +1 -2
  94. package/lib/victory-portal/portal-context.js +1 -2
  95. package/lib/victory-portal/portal.js +1 -2
  96. package/lib/victory-portal/victory-portal.js +1 -2
  97. package/lib/victory-primitives/arc.js +1 -2
  98. package/lib/victory-primitives/background.js +1 -2
  99. package/lib/victory-primitives/border.js +1 -2
  100. package/lib/victory-primitives/circle.js +1 -2
  101. package/lib/victory-primitives/clip-path.js +1 -2
  102. package/lib/victory-primitives/index.js +1 -2
  103. package/lib/victory-primitives/line-segment.js +1 -2
  104. package/lib/victory-primitives/line.js +1 -2
  105. package/lib/victory-primitives/path.js +1 -2
  106. package/lib/victory-primitives/point.js +1 -2
  107. package/lib/victory-primitives/rect.js +1 -2
  108. package/lib/victory-primitives/text.js +1 -2
  109. package/lib/victory-primitives/tspan.js +1 -2
  110. package/lib/victory-primitives/types.js +1 -2
  111. package/lib/victory-primitives/whisker.js +1 -2
  112. package/lib/victory-state/defaults.js +1 -2
  113. package/lib/victory-state/helpers/get-axis-data.js +1 -2
  114. package/lib/victory-state/helpers/get-data.js +1 -2
  115. package/lib/victory-state/helpers/get-domain.js +1 -2
  116. package/lib/victory-state/helpers/get-range.js +1 -2
  117. package/lib/victory-state/helpers/get-scale.js +1 -2
  118. package/lib/victory-state/index.js +1 -2
  119. package/lib/victory-state/types.js +1 -2
  120. package/lib/victory-state/victory-provider.js +1 -2
  121. package/lib/victory-theme/grayscale.js +1 -2
  122. package/lib/victory-theme/material.js +1 -2
  123. package/lib/victory-theme/types.js +1 -2
  124. package/lib/victory-theme/victory-theme.js +1 -2
  125. package/lib/victory-transition/victory-transition.js +1 -2
  126. package/lib/victory-util/add-events.d.ts +25 -7
  127. package/lib/victory-util/add-events.js +1 -2
  128. package/lib/victory-util/axis.js +1 -2
  129. package/lib/victory-util/collection.js +1 -2
  130. package/lib/victory-util/common-props.js +1 -2
  131. package/lib/victory-util/data.js +1 -2
  132. package/lib/victory-util/default-transitions.js +1 -2
  133. package/lib/victory-util/domain.js +1 -2
  134. package/lib/victory-util/events.d.ts +1 -1
  135. package/lib/victory-util/events.js +1 -2
  136. package/lib/victory-util/helpers.d.ts +2 -1
  137. package/lib/victory-util/helpers.js +1 -2
  138. package/lib/victory-util/hooks/index.js +1 -2
  139. package/lib/victory-util/hooks/use-animation-state.js +1 -2
  140. package/lib/victory-util/hooks/use-previous-props.js +1 -2
  141. package/lib/victory-util/immutable.js +1 -2
  142. package/lib/victory-util/index.js +1 -2
  143. package/lib/victory-util/label-helpers.js +1 -2
  144. package/lib/victory-util/line-helpers.js +1 -2
  145. package/lib/victory-util/log.js +1 -2
  146. package/lib/victory-util/point-path-helpers.js +1 -2
  147. package/lib/victory-util/prop-types.js +1 -2
  148. package/lib/victory-util/scale.js +1 -2
  149. package/lib/victory-util/selection.d.ts +1 -1
  150. package/lib/victory-util/selection.js +7 -4
  151. package/lib/victory-util/style.js +1 -2
  152. package/lib/victory-util/textsize.js +1 -2
  153. package/lib/victory-util/timer-context.js +1 -2
  154. package/lib/victory-util/timer.js +1 -2
  155. package/lib/victory-util/transitions.js +1 -2
  156. package/lib/victory-util/type-helpers.js +1 -2
  157. package/lib/victory-util/user-props.d.ts +1 -1
  158. package/lib/victory-util/user-props.js +4 -3
  159. package/lib/victory-util/with-container.d.ts +1 -1
  160. package/lib/victory-util/with-container.js +1 -2
  161. package/lib/victory-util/wrapper.d.ts +1 -1
  162. package/lib/victory-util/wrapper.js +1 -2
  163. package/package.json +34 -17
  164. package/src/types/callbacks.ts +3 -1
  165. package/src/victory-label/victory-label.tsx +4 -3
  166. package/src/victory-util/add-events.tsx +45 -6
  167. package/src/victory-util/events.ts +2 -1
  168. package/src/victory-util/helpers.ts +5 -1
  169. package/src/victory-util/selection.ts +3 -1
  170. package/src/victory-util/user-props.ts +2 -1
  171. package/src/victory-util/with-container.tsx +2 -2
  172. package/src/victory-util/wrapper.tsx +1 -1
@@ -59,5 +59,4 @@ export var getLineFunction = function (props) {
59
59
  scale = props.scale,
60
60
  horizontal = props.horizontal;
61
61
  return polar ? d3Shape.lineRadial().defined(defined).curve(getInterpolationFunction(props)).angle(getAngleAccessor(scale)).radius(getYAccessor(scale)) : d3Shape.line().defined(defined).curve(getInterpolationFunction(props)).x(horizontal ? getYAccessor(scale) : getXAccessor(scale)).y(horizontal ? getXAccessor(scale) : getYAccessor(scale));
62
- };
63
- //# sourceMappingURL=line-helpers.js.map
62
+ };
@@ -8,5 +8,4 @@ export function warn(message) {
8
8
  console.warn(message);
9
9
  }
10
10
  }
11
- }
12
- //# sourceMappingURL=log.js.map
11
+ }
@@ -68,5 +68,4 @@ export function star(x, y, size) {
68
68
  });
69
69
 
70
70
  return "M ".concat(starCoords.join("L"), " z");
71
- }
72
- //# sourceMappingURL=point-path-helpers.js.map
71
+ }
@@ -238,5 +238,4 @@ export var regExp = makeChainable(function (props, propName, componentName) {
238
238
  }
239
239
 
240
240
  return null;
241
- });
242
- //# sourceMappingURL=prop-types.js.map
241
+ });
@@ -139,5 +139,4 @@ export function getType(scale) {
139
139
  return scale[type.method] !== undefined;
140
140
  })[0];
141
141
  return scaleType ? scaleType.name : undefined;
142
- }
143
- //# sourceMappingURL=scale.js.map
142
+ }
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
- import { VictoryCommonProps } from "./index";
2
+ import { VictoryCommonProps } from "./common-props";
3
3
  import type { DomainPropType, ScaleXYPropType } from "../types/prop-types";
4
4
  export declare function getParentSVG(evt: Pick<React.SyntheticEvent, "target"> & Partial<Pick<React.SyntheticEvent, "nativeEvent">>): SVGElement;
5
5
  export declare function getSVGEventCoordinates(evt: React.SyntheticEvent, svg?: SVGElement): SVGCoordinateType;
@@ -1,4 +1,4 @@
1
- import { Collection } from "./index";
1
+ import * as Collection from "./collection";
2
2
 
3
3
  // Private Functions
4
4
  function transformTarget(target, matrix, dimension) {
@@ -111,5 +111,4 @@ export function getBounds(props) {
111
111
  x: makeBound(point1.x, point2.x),
112
112
  y: makeBound(point1.y, point2.y)
113
113
  };
114
- }
115
- //# sourceMappingURL=selection.js.map
114
+ }
@@ -53,5 +53,4 @@ export function getColorScale(name) {
53
53
  green: ["#354722", "#466631", "#649146", "#8AB25C", "#A9C97E"]
54
54
  };
55
55
  return name ? scales[name] : scales.grayscale;
56
- }
57
- //# sourceMappingURL=style.js.map
56
+ }
@@ -284,5 +284,4 @@ export var _approximateTextSizeInternal = {
284
284
 
285
285
  export var approximateTextSize = function (text, style) {
286
286
  return _approximateTextSizeInternal.impl(text, style);
287
- };
288
- //# sourceMappingURL=textsize.js.map
287
+ };
@@ -10,5 +10,4 @@ var TimerContext = /*#__PURE__*/React.createContext({
10
10
  animationTimer: new Timer()
11
11
  });
12
12
  TimerContext.displayName = "TimerContext";
13
- export default TimerContext;
14
- //# sourceMappingURL=timer-context.js.map
13
+ export default TimerContext;
@@ -84,5 +84,4 @@ var Timer = /*#__PURE__*/function () {
84
84
  return Timer;
85
85
  }();
86
86
 
87
- export { Timer as default };
88
- //# sourceMappingURL=timer.js.map
87
+ export { Timer as default };
@@ -406,5 +406,4 @@ export function getTransitionPropsFactory(props, state, setState) {
406
406
  data: data
407
407
  };
408
408
  };
409
- }
410
- //# sourceMappingURL=transitions.js.map
409
+ }
@@ -24,5 +24,4 @@ export function isDate(value) {
24
24
  }
25
25
  export function isKeyValueObject(datum) {
26
26
  return typeof datum === "object" && !Array.isArray(datum) && !(datum instanceof Date);
27
- }
28
- //# sourceMappingURL=type-helpers.js.map
27
+ }
@@ -1,5 +1,5 @@
1
1
  import * as React from "react";
2
- declare type SafeAttribute = `data-${string}` | `aria-${string}`;
2
+ declare type SafeAttribute = string;
3
3
  /**
4
4
  * getSafeUserProps - function that takes in a props object and removes any
5
5
  * key-value entries that do not match filter strings in the USER_PROPS_SAFELIST
@@ -27,7 +27,9 @@ import * as React from "react";
27
27
  var USER_PROPS_SAFELIST = {
28
28
  startsWith: ["data-", "aria-"],
29
29
  exactMatch: []
30
- };
30
+ }; // Normally we'd use Template Literal Types, but we're avoiding it to maximize TS compatibility with TS < 4.1
31
+
32
+ // `data-${string}` | `aria-${string}`;
31
33
 
32
34
  /**
33
35
  * doesPropStartWith: Function that takes a prop's key and runs it against all
@@ -120,5 +122,4 @@ export var getSafeUserProps = function (props) {
120
122
 
121
123
  export var withSafeUserProps = function (component, props) {
122
124
  return /*#__PURE__*/React.cloneElement(component, getSafeUserProps(props));
123
- };
124
- //# sourceMappingURL=user-props.js.map
125
+ };
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
2
  import { VictoryProviderProps } from "../victory-state";
3
3
  import { VictoryCommonProps } from "./common-props";
4
- export declare function withContainer<Props extends VictoryCommonProps>(WrappedComponent: (props: Props) => React.ReactElement, initialProviderProps?: Partial<VictoryProviderProps>): (props: Props) => JSX.Element;
4
+ export declare function withContainer<Props extends VictoryCommonProps>(WrappedComponent: React.FC<Props>, initialProviderProps?: Partial<VictoryProviderProps>): React.FC<Props>;
5
5
  //# sourceMappingURL=with-container.d.ts.map
@@ -29,5 +29,4 @@ export function withContainer(WrappedComponent) {
29
29
 
30
30
  return /*#__PURE__*/React.createElement(WrappedComponent, props);
31
31
  };
32
- }
33
- //# sourceMappingURL=with-container.js.map
32
+ }
@@ -31,7 +31,7 @@ export declare function getStringsFromChildren(props: any, childComponents: any)
31
31
  x: any[];
32
32
  y: any[];
33
33
  };
34
- export declare function getCategories(props: any, childComponents: any, allStrings: any): {
34
+ export declare function getCategories(props: any, childComponents: any, allStrings?: any): {
35
35
  x: any;
36
36
  y: any;
37
37
  };
@@ -446,5 +446,4 @@ export function getCategories(props, childComponents, allStrings) {
446
446
  x: xCategories.length > 0 ? xCategories : undefined,
447
447
  y: yCategories.length > 0 ? yCategories : undefined
448
448
  };
449
- }
450
- //# sourceMappingURL=wrapper.js.map
449
+ }
package/lib/index.js CHANGED
@@ -235,5 +235,4 @@ Object.keys(_victoryState).forEach(function (key) {
235
235
  return _victoryState[key];
236
236
  }
237
237
  });
238
- });
239
- //# sourceMappingURL=index.js.map
238
+ });
@@ -12,7 +12,7 @@ export interface CallbackArgs {
12
12
  data?: Datum[];
13
13
  datum?: Datum;
14
14
  horizontal?: boolean;
15
- index: ID;
15
+ index?: ID;
16
16
  x?: number;
17
17
  y?: number;
18
18
  scale?: {
@@ -34,4 +34,5 @@ export declare type VictoryOrientationCallback = (args: CallbackArgs) => Orienta
34
34
  export declare type NumberOrCallback = number | VictoryNumberCallback;
35
35
  export declare type PaddingOrCallback = number | BlockProps | VictoryPaddingCallback;
36
36
  export declare type OrientationOrCallback = OrientationTypes | VictoryOrientationCallback;
37
+ export declare type ValueOrCallback<TValue> = TValue | ((args: CallbackArgs) => TValue);
37
38
  //# sourceMappingURL=callbacks.d.ts.map
@@ -1,2 +1 @@
1
- "use strict";
2
- //# sourceMappingURL=callbacks.js.map
1
+ "use strict";
@@ -1,2 +1 @@
1
- "use strict";
2
- //# sourceMappingURL=prop-types.js.map
1
+ "use strict";
@@ -82,5 +82,4 @@ VictoryAccessibleGroup.propTypes = {
82
82
  };
83
83
  VictoryAccessibleGroup.defaultProps = {
84
84
  className: "VictoryAccessibleGroup"
85
- };
86
- //# sourceMappingURL=victory-accessible-group.js.map
85
+ };
@@ -239,5 +239,4 @@ var victoryInterpolator = function (a, b) {
239
239
  return (0, _d3Interpolate.interpolate)(a, b);
240
240
  };
241
241
 
242
- exports.victoryInterpolator = victoryInterpolator;
243
- //# sourceMappingURL=util.js.map
242
+ exports.victoryInterpolator = victoryInterpolator;
@@ -256,5 +256,4 @@ VictoryAnimation.defaultProps = {
256
256
  duration: 1000,
257
257
  easing: "quadInOut"
258
258
  };
259
- VictoryAnimation.contextType = _timerContext.default;
260
- //# sourceMappingURL=victory-animation.js.map
259
+ VictoryAnimation.contextType = _timerContext.default;
@@ -297,5 +297,4 @@ VictoryClipContainer.defaultProps = {
297
297
  rectComponent: /*#__PURE__*/_react.default.createElement(_rect.Rect, null),
298
298
  clipPathComponent: /*#__PURE__*/_react.default.createElement(_clipPath.ClipPath, null),
299
299
  groupComponent: /*#__PURE__*/_react.default.createElement("g", null)
300
- };
301
- //# sourceMappingURL=victory-clip-container.js.map
300
+ };
@@ -296,5 +296,4 @@ VictoryContainer.defaultProps = {
296
296
  responsive: true,
297
297
  role: "img"
298
298
  };
299
- VictoryContainer.contextType = _timerContext.default;
300
- //# sourceMappingURL=victory-container.js.map
299
+ VictoryContainer.contextType = _timerContext.default;
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
- import { NumberOrCallback, StringOrCallback, StringOrNumberOrCallback } from "../types/callbacks";
2
+ import { NumberOrCallback, StringOrCallback, StringOrNumberOrCallback, ValueOrCallback } from "../types/callbacks";
3
3
  import { PaddingProps, VerticalAnchorType, VictoryLabelStyleObject } from "../victory-theme/victory-theme";
4
4
  export declare type TextAnchorType = "start" | "middle" | "end" | "inherit";
5
5
  export declare type OriginType = {
@@ -34,15 +34,11 @@ export interface VictoryLabelProps {
34
34
  tabIndex?: NumberOrCallback;
35
35
  text?: string[] | StringOrNumberOrCallback;
36
36
  textComponent?: React.ReactElement;
37
- textAnchor?: TextAnchorType | {
38
- (): TextAnchorType;
39
- };
37
+ textAnchor?: ValueOrCallback<TextAnchorType>;
40
38
  title?: string;
41
- transform?: string | object | (() => string | object);
39
+ transform?: ValueOrCallback<string | object>;
42
40
  tspanComponent?: React.ReactElement;
43
- verticalAnchor?: VerticalAnchorType | {
44
- (): VerticalAnchorType;
45
- };
41
+ verticalAnchor?: ValueOrCallback<VerticalAnchorType>;
46
42
  x?: number;
47
43
  y?: number;
48
44
  dx?: StringOrNumberOrCallback;
@@ -635,5 +635,4 @@ VictoryLabel.defaultProps = {
635
635
  capHeight: 0.71,
636
636
  // Magic number from d3.
637
637
  lineHeight: 1
638
- };
639
- //# sourceMappingURL=victory-label.js.map
638
+ };
@@ -16,5 +16,4 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
16
16
  var PortalContext = /*#__PURE__*/_react.default.createContext({});
17
17
 
18
18
  exports.PortalContext = PortalContext;
19
- PortalContext.displayName = "PortalContext";
20
- //# sourceMappingURL=portal-context.js.map
19
+ PortalContext.displayName = "PortalContext";
@@ -105,5 +105,4 @@ Portal.propTypes = {
105
105
  style: _propTypes.default.object,
106
106
  viewBox: _propTypes.default.string,
107
107
  width: CustomPropTypes.nonNegative
108
- };
109
- //# sourceMappingURL=portal.js.map
108
+ };
@@ -137,5 +137,4 @@ VictoryPortal.propTypes = {
137
137
  VictoryPortal.defaultProps = {
138
138
  groupComponent: /*#__PURE__*/_react.default.createElement("g", null)
139
139
  };
140
- VictoryPortal.contextType = _portalContext.PortalContext;
141
- //# sourceMappingURL=victory-portal.js.map
140
+ VictoryPortal.contextType = _portalContext.PortalContext;
@@ -110,5 +110,4 @@ Arc.defaultProps = {
110
110
  pathComponent: /*#__PURE__*/_react.default.createElement(_path.Path, null),
111
111
  role: "presentation",
112
112
  shapeRendering: "auto"
113
- };
114
- //# sourceMappingURL=arc.js.map
113
+ };
@@ -82,5 +82,4 @@ Background.defaultProps = {
82
82
  rectComponent: /*#__PURE__*/_react.default.createElement(_rect.Rect, null),
83
83
  role: "presentation",
84
84
  shapeRendering: "auto"
85
- };
86
- //# sourceMappingURL=background.js.map
85
+ };
@@ -85,5 +85,4 @@ Border.defaultProps = {
85
85
  rectComponent: /*#__PURE__*/_react.default.createElement(_rect.Rect, null),
86
86
  role: "presentation",
87
87
  shapeRendering: "auto"
88
- };
89
- //# sourceMappingURL=border.js.map
88
+ };
@@ -35,5 +35,4 @@ var Circle = function (props) {
35
35
  }, rest));
36
36
  };
37
37
 
38
- exports.Circle = Circle;
39
- //# sourceMappingURL=circle.js.map
38
+ exports.Circle = Circle;
@@ -24,5 +24,4 @@ exports.ClipPath = ClipPath;
24
24
  ClipPath.propTypes = {
25
25
  children: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.node), _propTypes.default.node]),
26
26
  clipId: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string])
27
- };
28
- //# sourceMappingURL=clip-path.js.map
27
+ };
@@ -184,5 +184,4 @@ Object.keys(_whisker).forEach(function (key) {
184
184
  return _whisker[key];
185
185
  }
186
186
  });
187
- });
188
- //# sourceMappingURL=index.js.map
187
+ });
@@ -86,5 +86,4 @@ LineSegment.defaultProps = {
86
86
  lineComponent: /*#__PURE__*/_react.default.createElement(_line.Line, null),
87
87
  role: "presentation",
88
88
  shapeRendering: "auto"
89
- };
90
- //# sourceMappingURL=line-segment.js.map
89
+ };
@@ -35,5 +35,4 @@ var Line = function (props) {
35
35
  }, rest));
36
36
  };
37
37
 
38
- exports.Line = Line;
39
- //# sourceMappingURL=line.js.map
38
+ exports.Line = Line;
@@ -29,5 +29,4 @@ var Path = function (props) {
29
29
  _react.default.createElement("path", rest);
30
30
  };
31
31
 
32
- exports.Path = Path;
33
- //# sourceMappingURL=path.js.map
32
+ exports.Path = Path;
@@ -108,5 +108,4 @@ Point.defaultProps = {
108
108
  pathComponent: /*#__PURE__*/_react.default.createElement(_path.Path, null),
109
109
  role: "presentation",
110
110
  shapeRendering: "auto"
111
- };
112
- //# sourceMappingURL=point.js.map
111
+ };
@@ -35,5 +35,4 @@ var Rect = function (props) {
35
35
  }, rest));
36
36
  };
37
37
 
38
- exports.Rect = Rect;
39
- //# sourceMappingURL=rect.js.map
38
+ exports.Rect = Rect;
@@ -35,5 +35,4 @@ Text.propTypes = {
35
35
  children: _propTypes.default.node,
36
36
  desc: _propTypes.default.string,
37
37
  title: _propTypes.default.string
38
- };
39
- //# sourceMappingURL=text.js.map
38
+ };
@@ -17,5 +17,4 @@ var TSpan = function (props) {
17
17
  );
18
18
  };
19
19
 
20
- exports.TSpan = TSpan;
21
- //# sourceMappingURL=tspan.js.map
20
+ exports.TSpan = TSpan;
@@ -1,2 +1 @@
1
- "use strict";
2
- //# sourceMappingURL=types.js.map
1
+ "use strict";
@@ -112,5 +112,4 @@ Whisker.defaultProps = {
112
112
  lineComponent: /*#__PURE__*/_react.default.createElement(_line.Line, null),
113
113
  role: "presentation",
114
114
  shapeRendering: "auto"
115
- };
116
- //# sourceMappingURL=whisker.js.map
115
+ };
@@ -7,5 +7,4 @@ exports.DEFAULT_WIDTH = exports.DEFAULT_HEIGHT = void 0;
7
7
  var DEFAULT_HEIGHT = 300;
8
8
  exports.DEFAULT_HEIGHT = DEFAULT_HEIGHT;
9
9
  var DEFAULT_WIDTH = 450;
10
- exports.DEFAULT_WIDTH = DEFAULT_WIDTH;
11
- //# sourceMappingURL=defaults.js.map
10
+ exports.DEFAULT_WIDTH = DEFAULT_WIDTH;
@@ -19,5 +19,4 @@ function getAxisData(data, axis) {
19
19
 
20
20
  return acc;
21
21
  }, []);
22
- }
23
- //# sourceMappingURL=get-axis-data.js.map
22
+ }
@@ -95,5 +95,4 @@ function getData() {
95
95
  }
96
96
 
97
97
  return formattedData;
98
- }
99
- //# sourceMappingURL=get-data.js.map
98
+ }
@@ -78,5 +78,4 @@ function getDomain(_ref, axis) {
78
78
 
79
79
 
80
80
  return getDomainFromMinMax(minDomain, maxDomain);
81
- }
82
- //# sourceMappingURL=get-domain.js.map
81
+ }
@@ -42,5 +42,4 @@ function getRange(_ref, axis) {
42
42
  y: [height - padding.top, padding.bottom]
43
43
  };
44
44
  return rangeForAxis[axis];
45
- }
46
- //# sourceMappingURL=get-range.js.map
45
+ }
@@ -70,5 +70,4 @@ function getScale(_ref, axis) {
70
70
  }
71
71
 
72
72
  return DEFAULT_SCALE;
73
- }
74
- //# sourceMappingURL=get-scale.js.map
73
+ }
@@ -28,5 +28,4 @@ Object.keys(_types).forEach(function (key) {
28
28
  return _types[key];
29
29
  }
30
30
  });
31
- });
32
- //# sourceMappingURL=index.js.map
31
+ });
@@ -1,2 +1 @@
1
- "use strict";
2
- //# sourceMappingURL=types.js.map
1
+ "use strict";
@@ -140,5 +140,4 @@ function useVictoryProviderSync(id, props) {
140
140
  setChildProps(id, props);
141
141
  }, []);
142
142
  return props;
143
- }
144
- //# sourceMappingURL=victory-provider.js.map
143
+ }
@@ -265,5 +265,4 @@ var grayscale = {
265
265
  }
266
266
  }, baseProps)
267
267
  };
268
- exports.grayscale = grayscale;
269
- //# sourceMappingURL=grayscale.js.map
268
+ exports.grayscale = grayscale;
@@ -292,5 +292,4 @@ var material = {
292
292
  }
293
293
  }, baseProps)
294
294
  };
295
- exports.material = material;
296
- //# sourceMappingURL=material.js.map
295
+ exports.material = material;
@@ -1,2 +1 @@
1
- "use strict";
2
- //# sourceMappingURL=types.js.map
1
+ "use strict";
@@ -29,5 +29,4 @@ var VictoryTheme = {
29
29
  grayscale: _grayscale.grayscale,
30
30
  material: _material.material
31
31
  };
32
- exports.VictoryTheme = VictoryTheme;
33
- //# sourceMappingURL=victory-theme.js.map
32
+ exports.VictoryTheme = VictoryTheme;
@@ -261,5 +261,4 @@ VictoryTransition.propTypes = {
261
261
  animationWhitelist: _propTypes.default.array,
262
262
  children: _propTypes.default.node
263
263
  };
264
- VictoryTransition.contextType = _timerContext.default;
265
- //# sourceMappingURL=victory-transition.js.map
264
+ VictoryTransition.contextType = _timerContext.default;
@@ -26,7 +26,7 @@ export interface EventsMixinClass<TProps> {
26
26
  getEventState: typeof Events.getEventState;
27
27
  renderData(props: TProps): any;
28
28
  renderContinuousData(props: TProps): any;
29
- animateComponent(props: TProps, defaultAnimationWhitelist: any): any;
29
+ animateComponent(props: TProps, defaultAnimationWhitelist: string[]): React.ReactElement;
30
30
  getComponentProps(component: React.ReactElement, type: string, index: number): TProps;
31
31
  dataKeys: string[];
32
32
  }
@@ -41,14 +41,30 @@ export interface EventMixinCalculatedValues {
41
41
  hasEvents: unknown;
42
42
  events: unknown;
43
43
  }
44
+ /**
45
+ * These are the common roles that we care about internally.
46
+ */
47
+ export declare type VictoryComponentCommonRole = "container" | "group" | "histogram" | "label" | "line" | "portal" | "stack" | "tooltip" | "voronoi";
48
+ /**
49
+ * A component can have any "role",
50
+ * but there are certain ones that we actually care about internally
51
+ */
52
+ export declare type VictoryComponentRole = VictoryComponentCommonRole | string;
53
+ /**
54
+ * Static component fields used by Victory for common behavior
55
+ */
56
+ export interface VictoryComponentConfiguration<TProps> {
57
+ getBaseProps?(props: TProps): EventMixinCalculatedValues["baseProps"];
58
+ role?: VictoryComponentRole;
59
+ expectedComponents?: Array<keyof TProps | string>;
60
+ getChildren?: (props: TProps, childComponents?: Array<React.ReactNode>, calculatedProps?: TProps) => void;
61
+ animationWhitelist?: Array<keyof TProps | string>;
62
+ }
44
63
  /**
45
64
  * This represents the class itself, including static fields
46
65
  */
47
- export interface WrappedComponentClass<TProps> {
66
+ export interface WrappedComponentClass<TProps> extends VictoryComponentConfiguration<TProps> {
48
67
  new (props: TProps): React.Component<TProps>;
49
- getBaseProps?(props: TProps): EventMixinCalculatedValues["baseProps"];
50
- role?: string;
51
- expectedComponents?: string[];
52
68
  }
53
69
  export declare function addEvents<TBase extends WrappedComponentClass<TProps>, TProps extends EventMixinCommonProps>(WrappedComponent: TBase, options?: MixinOptions): {
54
70
  new (props: TProps): {
@@ -76,7 +92,7 @@ export declare function addEvents<TBase extends WrappedComponentClass<TProps>, T
76
92
  getAllEvents(props: any): any;
77
93
  getComponentProps(component: any, type: any, index: any): any;
78
94
  renderContainer(component: any, children: any): React.DetailedReactHTMLElement<any, HTMLElement>;
79
- animateComponent(props: TProps, defaultAnimationWhitelist: string[]): JSX.Element;
95
+ animateComponent(props: TProps, defaultAnimationWhitelist: string[]): React.ReactElement;
80
96
  renderContinuousData(props: TProps): React.DetailedReactHTMLElement<any, HTMLElement>;
81
97
  renderData(props: any, shouldRenderDatum?: (datum: any) => boolean): React.DetailedReactHTMLElement<any, HTMLElement>;
82
98
  context: unknown;
@@ -104,6 +120,8 @@ export declare function addEvents<TBase extends WrappedComponentClass<TProps>, T
104
120
  };
105
121
  getBaseProps?(props: TProps): Record<string, object>;
106
122
  role?: string | undefined;
107
- expectedComponents?: string[] | undefined;
123
+ expectedComponents?: (string | keyof TProps)[] | undefined;
124
+ getChildren?: ((props: TProps, childComponents?: React.ReactNode[] | undefined, calculatedProps?: TProps | undefined) => void) | undefined;
125
+ animationWhitelist?: (string | keyof TProps)[] | undefined;
108
126
  } & TBase;
109
127
  //# sourceMappingURL=add-events.d.ts.map
@@ -431,5 +431,4 @@ function addEvents(WrappedComponent) {
431
431
  }(WrappedComponent);
432
432
 
433
433
  return AddEventsMixin;
434
- }
435
- //# sourceMappingURL=add-events.js.map
434
+ }
@@ -469,5 +469,4 @@ function modifyProps(props, fallbackProps) {
469
469
  return Helpers.modifyProps((0, _assign2.default)({}, props, {
470
470
  theme: theme
471
471
  }), fallbackProps, "axis");
472
- }
473
- //# sourceMappingURL=axis.js.map
472
+ }
@@ -80,5 +80,4 @@ function getMinValue(arr) {
80
80
  var array = arr.concat(values);
81
81
  return containsDates(array) ? new Date(Math.min.apply(Math, _toConsumableArray(array))) // Dates will be coerced to numbers
82
82
  : Math.min.apply(Math, _toConsumableArray(array));
83
- }
84
- //# sourceMappingURL=collection.js.map
83
+ }