victory-core 36.6.1 → 36.6.4

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 (163) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/dist/victory-core.js +2 -2
  3. package/es/index.js +1 -2
  4. package/es/types/callbacks.d.ts +0 -1
  5. package/es/types/callbacks.js +1 -2
  6. package/es/types/prop-types.d.ts +3 -3
  7. package/es/types/prop-types.js +1 -2
  8. package/es/victory-accessible-group/victory-accessible-group.js +1 -2
  9. package/es/victory-animation/util.js +1 -2
  10. package/es/victory-animation/victory-animation.js +1 -2
  11. package/es/victory-clip-container/victory-clip-container.js +1 -2
  12. package/es/victory-container/victory-container.js +1 -2
  13. package/es/victory-label/victory-label.d.ts +5 -4
  14. package/es/victory-label/victory-label.js +1 -2
  15. package/es/victory-portal/portal-context.js +1 -2
  16. package/es/victory-portal/portal.js +1 -2
  17. package/es/victory-portal/victory-portal.js +1 -2
  18. package/es/victory-primitives/arc.js +1 -2
  19. package/es/victory-primitives/background.js +1 -2
  20. package/es/victory-primitives/border.js +1 -2
  21. package/es/victory-primitives/circle.js +1 -2
  22. package/es/victory-primitives/clip-path.js +1 -2
  23. package/es/victory-primitives/index.js +1 -2
  24. package/es/victory-primitives/line-segment.js +1 -2
  25. package/es/victory-primitives/line.js +1 -2
  26. package/es/victory-primitives/path.js +1 -2
  27. package/es/victory-primitives/point.js +1 -2
  28. package/es/victory-primitives/rect.js +1 -2
  29. package/es/victory-primitives/text.js +1 -2
  30. package/es/victory-primitives/tspan.js +1 -2
  31. package/es/victory-primitives/types.js +1 -2
  32. package/es/victory-primitives/whisker.js +1 -2
  33. package/es/victory-state/defaults.js +1 -2
  34. package/es/victory-state/helpers/get-axis-data.js +1 -2
  35. package/es/victory-state/helpers/get-data.js +1 -2
  36. package/es/victory-state/helpers/get-domain.js +1 -2
  37. package/es/victory-state/helpers/get-range.js +1 -2
  38. package/es/victory-state/helpers/get-scale.js +1 -2
  39. package/es/victory-state/index.js +1 -2
  40. package/es/victory-state/types.js +1 -2
  41. package/es/victory-state/victory-provider.js +1 -2
  42. package/es/victory-theme/grayscale.js +1 -2
  43. package/es/victory-theme/material.js +1 -2
  44. package/es/victory-theme/types.js +1 -2
  45. package/es/victory-theme/victory-theme.js +1 -2
  46. package/es/victory-transition/victory-transition.js +1 -2
  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.js +1 -2
  55. package/es/victory-util/helpers.d.ts +3 -2
  56. package/es/victory-util/helpers.js +1 -2
  57. package/es/victory-util/hooks/index.js +1 -2
  58. package/es/victory-util/hooks/use-animation-state.js +1 -2
  59. package/es/victory-util/hooks/use-previous-props.js +1 -2
  60. package/es/victory-util/immutable.js +1 -2
  61. package/es/victory-util/index.js +1 -2
  62. package/es/victory-util/label-helpers.js +1 -2
  63. package/es/victory-util/line-helpers.js +1 -2
  64. package/es/victory-util/log.js +1 -2
  65. package/es/victory-util/point-path-helpers.js +1 -2
  66. package/es/victory-util/prop-types.js +1 -2
  67. package/es/victory-util/scale.js +1 -2
  68. package/es/victory-util/selection.d.ts +1 -1
  69. package/es/victory-util/selection.js +2 -3
  70. package/es/victory-util/style.js +1 -2
  71. package/es/victory-util/textsize.js +1 -2
  72. package/es/victory-util/timer-context.js +1 -2
  73. package/es/victory-util/timer.js +1 -2
  74. package/es/victory-util/transitions.js +1 -2
  75. package/es/victory-util/type-helpers.js +1 -2
  76. package/es/victory-util/user-props.js +1 -2
  77. package/es/victory-util/with-container.d.ts +1 -1
  78. package/es/victory-util/with-container.js +1 -2
  79. package/es/victory-util/wrapper.js +1 -2
  80. package/lib/index.js +1 -2
  81. package/lib/types/callbacks.d.ts +0 -1
  82. package/lib/types/callbacks.js +1 -2
  83. package/lib/types/prop-types.d.ts +3 -3
  84. package/lib/types/prop-types.js +1 -2
  85. package/lib/victory-accessible-group/victory-accessible-group.js +1 -2
  86. package/lib/victory-animation/util.js +1 -2
  87. package/lib/victory-animation/victory-animation.js +1 -2
  88. package/lib/victory-clip-container/victory-clip-container.js +1 -2
  89. package/lib/victory-container/victory-container.js +1 -2
  90. package/lib/victory-label/victory-label.d.ts +5 -4
  91. package/lib/victory-label/victory-label.js +1 -2
  92. package/lib/victory-portal/portal-context.js +1 -2
  93. package/lib/victory-portal/portal.js +1 -2
  94. package/lib/victory-portal/victory-portal.js +1 -2
  95. package/lib/victory-primitives/arc.js +1 -2
  96. package/lib/victory-primitives/background.js +1 -2
  97. package/lib/victory-primitives/border.js +1 -2
  98. package/lib/victory-primitives/circle.js +1 -2
  99. package/lib/victory-primitives/clip-path.js +1 -2
  100. package/lib/victory-primitives/index.js +1 -2
  101. package/lib/victory-primitives/line-segment.js +1 -2
  102. package/lib/victory-primitives/line.js +1 -2
  103. package/lib/victory-primitives/path.js +1 -2
  104. package/lib/victory-primitives/point.js +1 -2
  105. package/lib/victory-primitives/rect.js +1 -2
  106. package/lib/victory-primitives/text.js +1 -2
  107. package/lib/victory-primitives/tspan.js +1 -2
  108. package/lib/victory-primitives/types.js +1 -2
  109. package/lib/victory-primitives/whisker.js +1 -2
  110. package/lib/victory-state/defaults.js +1 -2
  111. package/lib/victory-state/helpers/get-axis-data.js +1 -2
  112. package/lib/victory-state/helpers/get-data.js +1 -2
  113. package/lib/victory-state/helpers/get-domain.js +1 -2
  114. package/lib/victory-state/helpers/get-range.js +1 -2
  115. package/lib/victory-state/helpers/get-scale.js +1 -2
  116. package/lib/victory-state/index.js +1 -2
  117. package/lib/victory-state/types.js +1 -2
  118. package/lib/victory-state/victory-provider.js +1 -2
  119. package/lib/victory-theme/grayscale.js +1 -2
  120. package/lib/victory-theme/material.js +1 -2
  121. package/lib/victory-theme/types.js +1 -2
  122. package/lib/victory-theme/victory-theme.js +1 -2
  123. package/lib/victory-transition/victory-transition.js +1 -2
  124. package/lib/victory-util/add-events.js +1 -2
  125. package/lib/victory-util/axis.js +1 -2
  126. package/lib/victory-util/collection.js +1 -2
  127. package/lib/victory-util/common-props.js +1 -2
  128. package/lib/victory-util/data.js +1 -2
  129. package/lib/victory-util/default-transitions.js +1 -2
  130. package/lib/victory-util/domain.js +1 -2
  131. package/lib/victory-util/events.js +1 -2
  132. package/lib/victory-util/helpers.d.ts +3 -2
  133. package/lib/victory-util/helpers.js +1 -2
  134. package/lib/victory-util/hooks/index.js +1 -2
  135. package/lib/victory-util/hooks/use-animation-state.js +1 -2
  136. package/lib/victory-util/hooks/use-previous-props.js +1 -2
  137. package/lib/victory-util/immutable.js +1 -2
  138. package/lib/victory-util/index.js +1 -2
  139. package/lib/victory-util/label-helpers.js +1 -2
  140. package/lib/victory-util/line-helpers.js +1 -2
  141. package/lib/victory-util/log.js +1 -2
  142. package/lib/victory-util/point-path-helpers.js +1 -2
  143. package/lib/victory-util/prop-types.js +1 -2
  144. package/lib/victory-util/scale.js +1 -2
  145. package/lib/victory-util/selection.d.ts +1 -1
  146. package/lib/victory-util/selection.js +7 -4
  147. package/lib/victory-util/style.js +1 -2
  148. package/lib/victory-util/textsize.js +1 -2
  149. package/lib/victory-util/timer-context.js +1 -2
  150. package/lib/victory-util/timer.js +1 -2
  151. package/lib/victory-util/transitions.js +1 -2
  152. package/lib/victory-util/type-helpers.js +1 -2
  153. package/lib/victory-util/user-props.js +1 -2
  154. package/lib/victory-util/with-container.d.ts +1 -1
  155. package/lib/victory-util/with-container.js +1 -2
  156. package/lib/victory-util/wrapper.js +1 -2
  157. package/package.json +12 -4
  158. package/src/types/callbacks.ts +0 -2
  159. package/src/types/prop-types.ts +4 -3
  160. package/src/victory-label/victory-label.tsx +4 -4
  161. package/src/victory-util/helpers.ts +3 -2
  162. package/src/victory-util/selection.ts +3 -1
  163. package/src/victory-util/with-container.tsx +2 -2
@@ -93,5 +93,4 @@ function star(x, y, size) {
93
93
  return "".concat(length * Math.sin(angle * (index + 1)) + x, ",\n ").concat(length * Math.cos(angle * (index + 1)) + y);
94
94
  });
95
95
  return "M ".concat(starCoords.join("L"), " z");
96
- }
97
- //# sourceMappingURL=point-path-helpers.js.map
96
+ }
@@ -266,5 +266,4 @@ var regExp = makeChainable(function (props, propName, componentName) {
266
266
 
267
267
  return null;
268
268
  });
269
- exports.regExp = regExp;
270
- //# sourceMappingURL=prop-types.js.map
269
+ exports.regExp = regExp;
@@ -170,5 +170,4 @@ function getType(scale) {
170
170
  return scale[type.method] !== undefined;
171
171
  })[0];
172
172
  return scaleType ? scaleType.name : undefined;
173
- }
174
- //# sourceMappingURL=scale.js.map
173
+ }
@@ -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;
@@ -9,7 +9,11 @@ exports.getDomainCoordinates = getDomainCoordinates;
9
9
  exports.getParentSVG = getParentSVG;
10
10
  exports.getSVGEventCoordinates = getSVGEventCoordinates;
11
11
 
12
- var _index = require("./index");
12
+ var Collection = _interopRequireWildcard(require("./collection"));
13
+
14
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
15
+
16
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
13
17
 
14
18
  // Private Functions
15
19
  function transformTarget(target, matrix, dimension) {
@@ -119,12 +123,11 @@ function getBounds(props) {
119
123
  var point2 = getDataCoordinates(props, scale, x2, y2);
120
124
 
121
125
  var makeBound = function (a, b) {
122
- return [_index.Collection.getMinValue([a, b]), _index.Collection.getMaxValue([a, b])];
126
+ return [Collection.getMinValue([a, b]), Collection.getMaxValue([a, b])];
123
127
  };
124
128
 
125
129
  return {
126
130
  x: makeBound(point1.x, point2.x),
127
131
  y: makeBound(point1.y, point2.y)
128
132
  };
129
- }
130
- //# sourceMappingURL=selection.js.map
133
+ }
@@ -64,5 +64,4 @@ function getColorScale(name) {
64
64
  green: ["#354722", "#466631", "#649146", "#8AB25C", "#A9C97E"]
65
65
  };
66
66
  return name ? scales[name] : scales.grayscale;
67
- }
68
- //# sourceMappingURL=style.js.map
67
+ }
@@ -298,5 +298,4 @@ var approximateTextSize = function (text, style) {
298
298
  return _approximateTextSizeInternal.impl(text, style);
299
299
  };
300
300
 
301
- exports.approximateTextSize = approximateTextSize;
302
- //# sourceMappingURL=textsize.js.map
301
+ exports.approximateTextSize = approximateTextSize;
@@ -22,5 +22,4 @@ var TimerContext = /*#__PURE__*/_react.default.createContext({
22
22
 
23
23
  TimerContext.displayName = "TimerContext";
24
24
  var _default = TimerContext;
25
- exports.default = _default;
26
- //# sourceMappingURL=timer-context.js.map
25
+ exports.default = _default;
@@ -91,5 +91,4 @@ var Timer = /*#__PURE__*/function () {
91
91
  return Timer;
92
92
  }();
93
93
 
94
- exports.default = Timer;
95
- //# sourceMappingURL=timer.js.map
94
+ exports.default = Timer;
@@ -416,5 +416,4 @@ function getTransitionPropsFactory(props, state, setState) {
416
416
  data: data
417
417
  };
418
418
  };
419
- }
420
- //# sourceMappingURL=transitions.js.map
419
+ }
@@ -41,5 +41,4 @@ function isDate(value) {
41
41
 
42
42
  function isKeyValueObject(datum) {
43
43
  return typeof datum === "object" && !Array.isArray(datum) && !(datum instanceof Date);
44
- }
45
- //# sourceMappingURL=type-helpers.js.map
44
+ }
@@ -138,5 +138,4 @@ var withSafeUserProps = function (component, props) {
138
138
  return /*#__PURE__*/React.cloneElement(component, getSafeUserProps(props));
139
139
  };
140
140
 
141
- exports.withSafeUserProps = withSafeUserProps;
142
- //# sourceMappingURL=user-props.js.map
141
+ exports.withSafeUserProps = withSafeUserProps;
@@ -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
@@ -42,5 +42,4 @@ function withContainer(WrappedComponent) {
42
42
 
43
43
  return /*#__PURE__*/_react.default.createElement(WrappedComponent, props);
44
44
  };
45
- }
46
- //# sourceMappingURL=with-container.js.map
45
+ }
@@ -503,5 +503,4 @@ function getCategories(props, childComponents, allStrings) {
503
503
  x: xCategories.length > 0 ? xCategories : undefined,
504
504
  y: yCategories.length > 0 ? yCategories : undefined
505
505
  };
506
- }
507
- //# sourceMappingURL=wrapper.js.map
506
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "victory-core",
3
- "version": "36.6.1",
3
+ "version": "36.6.4",
4
4
  "description": "Victory Core",
5
5
  "keywords": [
6
6
  "data visualization",
@@ -23,7 +23,7 @@
23
23
  "lodash": "^4.17.21",
24
24
  "prop-types": "^15.8.1",
25
25
  "react-fast-compare": "^3.2.0",
26
- "victory-vendor": "^36.6.1"
26
+ "victory-vendor": "^36.6.4"
27
27
  },
28
28
  "peerDependencies": {
29
29
  "react": ">=16.6.0"
@@ -55,7 +55,9 @@
55
55
  "files": [
56
56
  "src/**",
57
57
  "!src/**/*.test.*",
58
- "../../.babelrc.build.js"
58
+ "../../.babelrc.build.js",
59
+ "../../.babelrc.js",
60
+ "../../package-scripts.js"
59
61
  ],
60
62
  "output": [
61
63
  "es/**/*.js",
@@ -73,7 +75,9 @@
73
75
  "files": [
74
76
  "src/**",
75
77
  "!src/**/*.test.*",
76
- "../../.babelrc.build.js"
78
+ "../../.babelrc.build.js",
79
+ "../../.babelrc.js",
80
+ "../../package-scripts.js"
77
81
  ],
78
82
  "output": [
79
83
  "lib/**/*.js",
@@ -98,6 +102,8 @@
98
102
  "src/**",
99
103
  "!src/**/*.test.*",
100
104
  "../../.babelrc.build.js",
105
+ "../../.babelrc.js",
106
+ "../../package-scripts.js",
101
107
  "../../config/webpack.config.js",
102
108
  "../../config/webpack.config.dev.js"
103
109
  ],
@@ -118,6 +124,8 @@
118
124
  "src/**",
119
125
  "!src/**/*.test.*",
120
126
  "../../.babelrc.build.js",
127
+ "../../.babelrc.js",
128
+ "../../package-scripts.js",
121
129
  "../../config/webpack.config.js"
122
130
  ],
123
131
  "output": [
@@ -51,5 +51,3 @@ export type PaddingOrCallback = number | BlockProps | VictoryPaddingCallback;
51
51
  export type OrientationOrCallback =
52
52
  | OrientationTypes
53
53
  | VictoryOrientationCallback;
54
-
55
- export type ValueOrCallback<TValue> = TValue | ((args: CallbackArgs) => TValue);
@@ -9,14 +9,14 @@ import {
9
9
  AnimationEasing,
10
10
  AnimationStyle,
11
11
  } from "../victory-animation/victory-animation";
12
- import { StringOrNumberOrCallback } from "./callbacks";
12
+ import { CallbackArgs, StringOrNumberOrCallback } from "./callbacks";
13
13
 
14
14
  export type AxisType = "x" | "y";
15
15
  export type DatumValue = number | string | Date | null | undefined;
16
16
  export type Datum = any;
17
17
  export type ForAxes<T> = T | { x?: T; y?: T };
18
18
  export type ID = number | string;
19
- export type ValueOrAccessor<ValueType = unknown, PropsType = object> =
19
+ export type ValueOrAccessor<ValueType, PropsType = CallbackArgs> =
20
20
  | ValueType
21
21
  | ((props: PropsType) => ValueType);
22
22
  export type Tuple<T> = [T, T];
@@ -137,7 +137,8 @@ export type CategoryPropType =
137
137
  };
138
138
 
139
139
  export type DataGetterPropType = ValueOrAccessor<
140
- string | string[] | number | number[]
140
+ string | string[] | number | number[],
141
+ any // The arg will be the `datum`, which can have any type
141
142
  >;
142
143
 
143
144
  export type InterpolationPropType =
@@ -17,8 +17,8 @@ import {
17
17
  NumberOrCallback,
18
18
  StringOrCallback,
19
19
  StringOrNumberOrCallback,
20
- ValueOrCallback,
21
20
  } from "../types/callbacks";
21
+ import { ValueOrAccessor } from "../types/prop-types";
22
22
  import {
23
23
  PaddingProps,
24
24
  VerticalAnchorType,
@@ -56,11 +56,11 @@ export interface VictoryLabelProps {
56
56
  tabIndex?: NumberOrCallback;
57
57
  text?: string[] | StringOrNumberOrCallback;
58
58
  textComponent?: React.ReactElement;
59
- textAnchor?: ValueOrCallback<TextAnchorType>;
59
+ textAnchor?: ValueOrAccessor<TextAnchorType>;
60
60
  title?: string;
61
- transform?: ValueOrCallback<string | object>;
61
+ transform?: ValueOrAccessor<string | object>;
62
62
  tspanComponent?: React.ReactElement;
63
- verticalAnchor?: ValueOrCallback<VerticalAnchorType>;
63
+ verticalAnchor?: ValueOrAccessor<VerticalAnchorType>;
64
64
  x?: number;
65
65
  y?: number;
66
66
  dx?: StringOrNumberOrCallback;
@@ -1,7 +1,8 @@
1
1
  /* eslint-disable no-use-before-define */
2
2
  import React from "react";
3
3
  import { defaults, isFunction, property, pick, assign, keys } from "lodash";
4
- import { CallbackArgs, ValueOrCallback } from "../types/callbacks";
4
+ import { CallbackArgs } from "../types/callbacks";
5
+ import { ValueOrAccessor } from "../types/prop-types";
5
6
 
6
7
  // Private Functions
7
8
 
@@ -128,7 +129,7 @@ export function getStyles(style, defaultStyles) {
128
129
  }
129
130
 
130
131
  export function evaluateProp<TValue>(
131
- prop: ValueOrCallback<TValue>,
132
+ prop: ValueOrAccessor<TValue, CallbackArgs>,
132
133
  props: CallbackArgs,
133
134
  ): TValue {
134
135
  return isFunction(prop) ? prop(props) : prop;
@@ -1,5 +1,7 @@
1
1
  import React from "react";
2
- import { Collection, VictoryCommonProps } from "./index";
2
+ import * as Collection from "./collection";
3
+ import { VictoryCommonProps } from "./common-props";
4
+
3
5
  import type { DomainPropType, ScaleXYPropType } from "../types/prop-types";
4
6
 
5
7
  // Private Functions
@@ -11,9 +11,9 @@ const defaultProviderProps = {
11
11
  };
12
12
 
13
13
  export function withContainer<Props extends VictoryCommonProps>(
14
- WrappedComponent: (props: Props) => React.ReactElement,
14
+ WrappedComponent: React.FC<Props>,
15
15
  initialProviderProps: Partial<VictoryProviderProps> = {},
16
- ) {
16
+ ): React.FC<Props> {
17
17
  return (props: Props) => {
18
18
  const providerProps = {
19
19
  ...defaultProviderProps,