victory-core 37.0.1-next.2 → 37.0.2

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 (145) hide show
  1. package/CHANGELOG.md +4 -2
  2. package/dist/victory-core.js +104 -107
  3. package/dist/victory-core.min.js +1 -1
  4. package/es/index.d.ts +17 -17
  5. package/es/types/callbacks.d.ts +36 -36
  6. package/es/types/prop-types.d.ts +129 -129
  7. package/es/victory-accessible-group/victory-accessible-group.d.ts +10 -10
  8. package/es/victory-animation/util.d.ts +66 -66
  9. package/es/victory-animation/victory-animation.d.ts +34 -34
  10. package/es/victory-clip-container/victory-clip-container.d.ts +46 -46
  11. package/es/victory-container/victory-container.d.ts +68 -68
  12. package/es/victory-label/victory-label.d.ts +58 -58
  13. package/es/victory-label/victory-label.js +1 -4
  14. package/es/victory-portal/portal-context.d.ts +11 -11
  15. package/es/victory-portal/portal.d.ts +20 -20
  16. package/es/victory-portal/victory-portal.d.ts +26 -26
  17. package/es/victory-primitives/arc.d.ts +14 -14
  18. package/es/victory-primitives/arc.js +2 -4
  19. package/es/victory-primitives/background.d.ts +13 -13
  20. package/es/victory-primitives/background.js +2 -4
  21. package/es/victory-primitives/border.d.ts +10 -10
  22. package/es/victory-primitives/border.js +2 -4
  23. package/es/victory-primitives/circle.d.ts +3 -3
  24. package/es/victory-primitives/clip-path.d.ts +7 -7
  25. package/es/victory-primitives/index.d.ts +14 -14
  26. package/es/victory-primitives/line-segment.d.ts +11 -11
  27. package/es/victory-primitives/line-segment.js +2 -4
  28. package/es/victory-primitives/line.d.ts +3 -3
  29. package/es/victory-primitives/path.d.ts +3 -3
  30. package/es/victory-primitives/point.d.ts +13 -13
  31. package/es/victory-primitives/point.js +2 -4
  32. package/es/victory-primitives/rect.d.ts +3 -3
  33. package/es/victory-primitives/text.d.ts +8 -8
  34. package/es/victory-primitives/tspan.d.ts +3 -3
  35. package/es/victory-primitives/types.d.ts +7 -7
  36. package/es/victory-primitives/whisker.d.ts +15 -15
  37. package/es/victory-primitives/whisker.js +2 -4
  38. package/es/victory-theme/grayscale.d.ts +2 -2
  39. package/es/victory-theme/material.d.ts +2 -2
  40. package/es/victory-theme/types.d.ts +238 -238
  41. package/es/victory-theme/victory-theme.d.ts +5 -5
  42. package/es/victory-transition/victory-transition.d.ts +53 -53
  43. package/es/victory-util/add-events.d.ts +126 -126
  44. package/es/victory-util/axis.d.ts +50 -50
  45. package/es/victory-util/collection.d.ts +15 -15
  46. package/es/victory-util/common-props.d.ts +79 -79
  47. package/es/victory-util/data.d.ts +74 -74
  48. package/es/victory-util/default-transitions.d.ts +4 -4
  49. package/es/victory-util/domain.d.ts +90 -90
  50. package/es/victory-util/events.d.ts +64 -64
  51. package/es/victory-util/helpers.d.ts +96 -96
  52. package/es/victory-util/hooks/index.d.ts +2 -2
  53. package/es/victory-util/hooks/use-animation-state.d.ts +21 -21
  54. package/es/victory-util/hooks/use-previous-props.d.ts +1 -1
  55. package/es/victory-util/immutable.d.ts +11 -11
  56. package/es/victory-util/index.d.ts +26 -26
  57. package/es/victory-util/label-helpers.d.ts +26 -26
  58. package/es/victory-util/line-helpers.d.ts +4 -4
  59. package/es/victory-util/log.d.ts +1 -1
  60. package/es/victory-util/point-path-helpers.d.ts +9 -9
  61. package/es/victory-util/scale.d.ts +9 -9
  62. package/es/victory-util/selection.d.ts +28 -28
  63. package/es/victory-util/style.d.ts +18 -18
  64. package/es/victory-util/textsize.d.ts +35 -35
  65. package/es/victory-util/timer-context.d.ts +11 -11
  66. package/es/victory-util/timer.d.ts +16 -16
  67. package/es/victory-util/transitions.d.ts +48 -48
  68. package/es/victory-util/type-helpers.d.ts +9 -9
  69. package/es/victory-util/user-props.d.ts +26 -26
  70. package/es/victory-util/wrapper.d.ts +33 -33
  71. package/lib/index.d.ts +17 -17
  72. package/lib/types/callbacks.d.ts +36 -36
  73. package/lib/types/prop-types.d.ts +129 -129
  74. package/lib/victory-accessible-group/victory-accessible-group.d.ts +10 -10
  75. package/lib/victory-animation/util.d.ts +66 -66
  76. package/lib/victory-animation/victory-animation.d.ts +34 -34
  77. package/lib/victory-clip-container/victory-clip-container.d.ts +46 -46
  78. package/lib/victory-container/victory-container.d.ts +68 -68
  79. package/lib/victory-label/victory-label.d.ts +58 -58
  80. package/lib/victory-label/victory-label.js +1 -4
  81. package/lib/victory-portal/portal-context.d.ts +11 -11
  82. package/lib/victory-portal/portal.d.ts +20 -20
  83. package/lib/victory-portal/victory-portal.d.ts +26 -26
  84. package/lib/victory-primitives/arc.d.ts +14 -14
  85. package/lib/victory-primitives/arc.js +2 -4
  86. package/lib/victory-primitives/background.d.ts +13 -13
  87. package/lib/victory-primitives/background.js +2 -4
  88. package/lib/victory-primitives/border.d.ts +10 -10
  89. package/lib/victory-primitives/border.js +2 -4
  90. package/lib/victory-primitives/circle.d.ts +3 -3
  91. package/lib/victory-primitives/clip-path.d.ts +7 -7
  92. package/lib/victory-primitives/index.d.ts +14 -14
  93. package/lib/victory-primitives/line-segment.d.ts +11 -11
  94. package/lib/victory-primitives/line-segment.js +2 -4
  95. package/lib/victory-primitives/line.d.ts +3 -3
  96. package/lib/victory-primitives/path.d.ts +3 -3
  97. package/lib/victory-primitives/point.d.ts +13 -13
  98. package/lib/victory-primitives/point.js +2 -4
  99. package/lib/victory-primitives/rect.d.ts +3 -3
  100. package/lib/victory-primitives/text.d.ts +8 -8
  101. package/lib/victory-primitives/tspan.d.ts +3 -3
  102. package/lib/victory-primitives/types.d.ts +7 -7
  103. package/lib/victory-primitives/whisker.d.ts +15 -15
  104. package/lib/victory-primitives/whisker.js +2 -4
  105. package/lib/victory-theme/grayscale.d.ts +2 -2
  106. package/lib/victory-theme/material.d.ts +2 -2
  107. package/lib/victory-theme/types.d.ts +238 -238
  108. package/lib/victory-theme/victory-theme.d.ts +5 -5
  109. package/lib/victory-transition/victory-transition.d.ts +53 -53
  110. package/lib/victory-util/add-events.d.ts +126 -126
  111. package/lib/victory-util/axis.d.ts +50 -50
  112. package/lib/victory-util/collection.d.ts +15 -15
  113. package/lib/victory-util/common-props.d.ts +79 -79
  114. package/lib/victory-util/data.d.ts +74 -74
  115. package/lib/victory-util/default-transitions.d.ts +4 -4
  116. package/lib/victory-util/domain.d.ts +90 -90
  117. package/lib/victory-util/events.d.ts +64 -64
  118. package/lib/victory-util/helpers.d.ts +96 -96
  119. package/lib/victory-util/hooks/index.d.ts +2 -2
  120. package/lib/victory-util/hooks/use-animation-state.d.ts +21 -21
  121. package/lib/victory-util/hooks/use-previous-props.d.ts +1 -1
  122. package/lib/victory-util/immutable.d.ts +11 -11
  123. package/lib/victory-util/index.d.ts +26 -26
  124. package/lib/victory-util/label-helpers.d.ts +26 -26
  125. package/lib/victory-util/line-helpers.d.ts +4 -4
  126. package/lib/victory-util/log.d.ts +1 -1
  127. package/lib/victory-util/point-path-helpers.d.ts +9 -9
  128. package/lib/victory-util/scale.d.ts +9 -9
  129. package/lib/victory-util/selection.d.ts +28 -28
  130. package/lib/victory-util/style.d.ts +18 -18
  131. package/lib/victory-util/textsize.d.ts +35 -35
  132. package/lib/victory-util/timer-context.d.ts +11 -11
  133. package/lib/victory-util/timer.d.ts +16 -16
  134. package/lib/victory-util/transitions.d.ts +48 -48
  135. package/lib/victory-util/type-helpers.d.ts +9 -9
  136. package/lib/victory-util/user-props.d.ts +26 -26
  137. package/lib/victory-util/wrapper.d.ts +33 -33
  138. package/package.json +5 -2
  139. package/src/victory-label/victory-label.tsx +1 -1
  140. package/src/victory-primitives/arc.tsx +3 -1
  141. package/src/victory-primitives/background.tsx +3 -1
  142. package/src/victory-primitives/border.tsx +3 -1
  143. package/src/victory-primitives/line-segment.tsx +3 -1
  144. package/src/victory-primitives/point.tsx +3 -1
  145. package/src/victory-primitives/whisker.tsx +3 -1
@@ -1,17 +1,17 @@
1
- declare type TimerCallback = (elapsed: number, duration: number) => void;
2
- export default class Timer {
3
- private shouldAnimate;
4
- private readonly subscribers;
5
- private activeSubscriptions;
6
- private timer;
7
- constructor();
8
- bypassAnimation(): void;
9
- resumeAnimation(): void;
10
- loop: () => void;
11
- start(): void;
12
- stop(): void;
13
- subscribe(callback: TimerCallback, duration: number): number;
14
- unsubscribe(id: any): void;
15
- }
16
- export {};
1
+ declare type TimerCallback = (elapsed: number, duration: number) => void;
2
+ export default class Timer {
3
+ private shouldAnimate;
4
+ private readonly subscribers;
5
+ private activeSubscriptions;
6
+ private timer;
7
+ constructor();
8
+ bypassAnimation(): void;
9
+ resumeAnimation(): void;
10
+ loop: () => void;
11
+ start(): void;
12
+ stop(): void;
13
+ subscribe(callback: TimerCallback, duration: number): number;
14
+ unsubscribe(id: any): void;
15
+ }
16
+ export {};
17
17
  //# sourceMappingURL=timer.d.ts.map
@@ -1,49 +1,49 @@
1
- import { AnimatePropTypeInterface } from "../types/prop-types";
2
- /**
3
- * If a parent component has animation enabled, calculate the transitions
4
- * for any data of any child component that supports data transitions.
5
- * Data transitions are defined as any two datasets where data nodes exist
6
- * in the first set and not the second, in the second and not the first,
7
- * or both.
8
- *
9
- * @param {Children} oldChildren this.props.children from old props
10
- * @param {Children} nextChildren this.props.children from next props
11
- *
12
- * @return {Object} Object with the following properties:
13
- * - nodesWillExit
14
- * - nodesWillEnter
15
- * - childrenTransitions
16
- * - nodesShouldEnter
17
- */
18
- export declare function getInitialTransitionState(oldChildren: any, nextChildren: any): {
19
- nodesWillExit: boolean;
20
- nodesWillEnter: boolean;
21
- childrenTransitions: any;
22
- nodesShouldEnter: boolean;
23
- };
24
- declare type TransitionProps = {
25
- data: any;
26
- animate?: AnimatePropTypeInterface;
27
- clipWidth?: number;
28
- };
29
- /**
30
- * getTransitionPropsFactory - putting the Java in JavaScript. This will return a
31
- * function that returns prop transformations for a child, given that child's props
32
- * and its index in the parent's children array.
33
- *
34
- * In particular, this will include an `animate` object that is set appropriately
35
- * so that each child will be synchronized for each stage of a transition
36
- * animation. It will also include a transformed `data` object, where each datum
37
- * is transformed by `animate.onExit` and `animate.onEnter` `before` and `after`
38
- * functions.
39
- *
40
- * @param {Object} props `this.props` for the parent component.
41
- * @param {Object} state `this.state` for the parent component.
42
- * @param {Function} setState Function that, when called, will `this.setState` on
43
- * the parent component with the provided object.
44
- *
45
- * @return {Function} Child-prop transformation function.
46
- */
47
- export declare function getTransitionPropsFactory(props: any, state: any, setState: any): (child: any, index: any) => TransitionProps;
48
- export {};
1
+ import { AnimatePropTypeInterface } from "../types/prop-types";
2
+ /**
3
+ * If a parent component has animation enabled, calculate the transitions
4
+ * for any data of any child component that supports data transitions.
5
+ * Data transitions are defined as any two datasets where data nodes exist
6
+ * in the first set and not the second, in the second and not the first,
7
+ * or both.
8
+ *
9
+ * @param {Children} oldChildren this.props.children from old props
10
+ * @param {Children} nextChildren this.props.children from next props
11
+ *
12
+ * @return {Object} Object with the following properties:
13
+ * - nodesWillExit
14
+ * - nodesWillEnter
15
+ * - childrenTransitions
16
+ * - nodesShouldEnter
17
+ */
18
+ export declare function getInitialTransitionState(oldChildren: any, nextChildren: any): {
19
+ nodesWillExit: boolean;
20
+ nodesWillEnter: boolean;
21
+ childrenTransitions: any;
22
+ nodesShouldEnter: boolean;
23
+ };
24
+ declare type TransitionProps = {
25
+ data: any;
26
+ animate?: AnimatePropTypeInterface;
27
+ clipWidth?: number;
28
+ };
29
+ /**
30
+ * getTransitionPropsFactory - putting the Java in JavaScript. This will return a
31
+ * function that returns prop transformations for a child, given that child's props
32
+ * and its index in the parent's children array.
33
+ *
34
+ * In particular, this will include an `animate` object that is set appropriately
35
+ * so that each child will be synchronized for each stage of a transition
36
+ * animation. It will also include a transformed `data` object, where each datum
37
+ * is transformed by `animate.onExit` and `animate.onEnter` `before` and `after`
38
+ * functions.
39
+ *
40
+ * @param {Object} props `this.props` for the parent component.
41
+ * @param {Object} state `this.state` for the parent component.
42
+ * @param {Function} setState Function that, when called, will `this.setState` on
43
+ * the parent component with the provided object.
44
+ *
45
+ * @return {Function} Child-prop transformation function.
46
+ */
47
+ export declare function getTransitionPropsFactory(props: any, state: any, setState: any): (child: any, index: any) => TransitionProps;
48
+ export {};
49
49
  //# sourceMappingURL=transitions.d.ts.map
@@ -1,10 +1,10 @@
1
- import { ForAxes, AxisType, Tuple, Datum, DatumValue } from "../types/prop-types";
2
- export declare function hasValueForAxis<T = unknown>(value: unknown | ForAxes<T>, axis: AxisType): value is ForAxes<T>;
3
- export declare function isTuple<T = unknown>(value: unknown): value is Tuple<T>;
4
- export declare function getValueForAxis<T = unknown>(value: T | ForAxes<T> | undefined, axis: AxisType): T | undefined;
5
- export declare function isFunction<T = Function>(func?: unknown): func is T;
6
- export declare function isDate(value: unknown): value is Date;
7
- export declare function isKeyValueObject(datum: Datum): datum is {
8
- [key: string]: DatumValue;
9
- };
1
+ import { ForAxes, AxisType, Tuple, Datum, DatumValue } from "../types/prop-types";
2
+ export declare function hasValueForAxis<T = unknown>(value: unknown | ForAxes<T>, axis: AxisType): value is ForAxes<T>;
3
+ export declare function isTuple<T = unknown>(value: unknown): value is Tuple<T>;
4
+ export declare function getValueForAxis<T = unknown>(value: T | ForAxes<T> | undefined, axis: AxisType): T | undefined;
5
+ export declare function isFunction<T = Function>(func?: unknown): func is T;
6
+ export declare function isDate(value: unknown): value is Date;
7
+ export declare function isKeyValueObject(datum: Datum): datum is {
8
+ [key: string]: DatumValue;
9
+ };
10
10
  //# sourceMappingURL=type-helpers.d.ts.map
@@ -1,27 +1,27 @@
1
- import * as React from "react";
2
- declare type SafeAttribute = string;
3
- /**
4
- * Asserts that value is not null or undefined, throwing an error if it is.
5
- * @param value The value to assert
6
- * @param message The error message to throw
7
- */
8
- export declare function assert<T>(value: T, message?: string): asserts value is NonNullable<T>;
9
- /**
10
- * getSafeUserProps - function that takes in a props object and removes any
11
- * key-value entries that do not match filter strings in the USER_PROPS_SAFELIST
12
- * object.
13
- *
14
- * @param {Object} props: props to be filtered against USER_PROPS_SAFELIST
15
- * @returns {Object}: object containing remaining acceptable props
16
- */
17
- export declare const getSafeUserProps: <T>(props: T) => Record<SafeAttribute, string>;
18
- /**
19
- * Wraps a component and adds safe user props
20
- *
21
- * @param {ReactElement} component: parent component
22
- * @param {Object} props: props to be filtered
23
- * @returns {ReactElement} modified component
24
- */
25
- export declare const withSafeUserProps: (component: React.ReactElement, props: any) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
26
- export {};
1
+ import * as React from "react";
2
+ declare type SafeAttribute = string;
3
+ /**
4
+ * Asserts that value is not null or undefined, throwing an error if it is.
5
+ * @param value The value to assert
6
+ * @param message The error message to throw
7
+ */
8
+ export declare function assert<T>(value: T, message?: string): asserts value is NonNullable<T>;
9
+ /**
10
+ * getSafeUserProps - function that takes in a props object and removes any
11
+ * key-value entries that do not match filter strings in the USER_PROPS_SAFELIST
12
+ * object.
13
+ *
14
+ * @param {Object} props: props to be filtered against USER_PROPS_SAFELIST
15
+ * @returns {Object}: object containing remaining acceptable props
16
+ */
17
+ export declare const getSafeUserProps: <T>(props: T) => Record<SafeAttribute, string>;
18
+ /**
19
+ * Wraps a component and adds safe user props
20
+ *
21
+ * @param {ReactElement} component: parent component
22
+ * @param {Object} props: props to be filtered
23
+ * @returns {ReactElement} modified component
24
+ */
25
+ export declare const withSafeUserProps: (component: React.ReactElement, props: any) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
26
+ export {};
27
27
  //# sourceMappingURL=user-props.d.ts.map
@@ -1,34 +1,34 @@
1
- export declare function addBinsToParentPropsIfHistogram({ children, props, childComponents, parentProps, }: {
2
- children: any;
3
- props: any;
4
- childComponents: any;
5
- parentProps: any;
6
- }): any;
7
- export declare function getDataFromChildren(props: any, childComponents: any): any[][];
8
- export declare function getData(props: any, childComponents: any): any;
9
- export declare function getWidth(props: any, groupLength?: any, seriesLength?: any): number;
10
- export declare function getDefaultDomainPadding(props: any, axis: any, childComponents: any): {
11
- x: number;
12
- } | undefined;
13
- export declare function getDomainFromChildren(props: any, axis: any, childComponents: any): (number | Date)[];
14
- export declare function getDomain(props: any, axis: any, childComponents: any): any;
15
- export declare function getScale(props: any, axis: any, childComponents?: any): import("..").D3Scale<any>;
16
- export declare function getAllEvents(props: any): any;
17
- export declare function getColor(calculatedProps: any, child: any, index: any): any;
18
- export declare function getStyle(theme: any, style: any, role: any): any;
19
- export declare function getChildStyle(child: any, index: any, calculatedProps: any): any;
20
- export declare function getStringsFromCategories(childComponents: any, axis: any): any[];
21
- export declare function getStringsFromData(childComponents: any): {
22
- x: number[];
23
- y: number[];
24
- };
25
- export declare function getCategoryAndAxisStringsFromChildren(props: any, axis: any, childComponents: any): any[];
26
- export declare function getStringsFromChildren(props: any, childComponents: any): {
27
- x: any[];
28
- y: any[];
29
- };
30
- export declare function getCategories(props: any, childComponents: any, allStrings?: any): {
31
- x: any;
32
- y: any;
33
- };
1
+ export declare function addBinsToParentPropsIfHistogram({ children, props, childComponents, parentProps, }: {
2
+ children: any;
3
+ props: any;
4
+ childComponents: any;
5
+ parentProps: any;
6
+ }): any;
7
+ export declare function getDataFromChildren(props: any, childComponents: any): any[][];
8
+ export declare function getData(props: any, childComponents: any): any;
9
+ export declare function getWidth(props: any, groupLength?: any, seriesLength?: any): number;
10
+ export declare function getDefaultDomainPadding(props: any, axis: any, childComponents: any): {
11
+ x: number;
12
+ } | undefined;
13
+ export declare function getDomainFromChildren(props: any, axis: any, childComponents: any): (number | Date)[];
14
+ export declare function getDomain(props: any, axis: any, childComponents: any): any;
15
+ export declare function getScale(props: any, axis: any, childComponents?: any): import("..").D3Scale<any>;
16
+ export declare function getAllEvents(props: any): any;
17
+ export declare function getColor(calculatedProps: any, child: any, index: any): any;
18
+ export declare function getStyle(theme: any, style: any, role: any): any;
19
+ export declare function getChildStyle(child: any, index: any, calculatedProps: any): any;
20
+ export declare function getStringsFromCategories(childComponents: any, axis: any): any[];
21
+ export declare function getStringsFromData(childComponents: any): {
22
+ x: number[];
23
+ y: number[];
24
+ };
25
+ export declare function getCategoryAndAxisStringsFromChildren(props: any, axis: any, childComponents: any): any[];
26
+ export declare function getStringsFromChildren(props: any, childComponents: any): {
27
+ x: any[];
28
+ y: any[];
29
+ };
30
+ export declare function getCategories(props: any, childComponents: any, allStrings?: any): {
31
+ x: any;
32
+ y: any;
33
+ };
34
34
  //# sourceMappingURL=wrapper.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "victory-core",
3
- "version": "37.0.1-next.2",
3
+ "version": "37.0.2",
4
4
  "description": "Victory Core",
5
5
  "keywords": [
6
6
  "data visualization",
@@ -22,11 +22,14 @@
22
22
  "dependencies": {
23
23
  "lodash": "^4.17.21",
24
24
  "react-fast-compare": "^3.2.0",
25
- "victory-vendor": "^37.0.1-next.2"
25
+ "victory-vendor": "^37.0.2"
26
26
  },
27
27
  "peerDependencies": {
28
28
  "react": ">=16.6.0"
29
29
  },
30
+ "publishConfig": {
31
+ "provenance": true
32
+ },
30
33
  "wireit": {
31
34
  "### THESE WIREIT CONFIGS ARE GENERATED ####": {},
32
35
  "### DO NOT MODIFY THESE MANUALLY ####": {},
@@ -584,7 +584,7 @@ export const VictoryLabel: {
584
584
  role: string;
585
585
  defaultStyles: typeof defaultStyles;
586
586
  } & React.FC<VictoryLabelProps> = (initialProps) => {
587
- const props = evaluateProps({ ...defaultProps, ...initialProps });
587
+ const props = evaluateProps(defaults({}, initialProps, defaultProps));
588
588
 
589
589
  if (props.text === null || props.text === undefined) {
590
590
  return null;
@@ -1,5 +1,7 @@
1
1
  /* eslint no-magic-numbers: ["error", { "ignore": [0, 1, 2, 180] }]*/
2
2
  import React from "react";
3
+ import { defaults } from "lodash";
4
+
3
5
  import * as Helpers from "../victory-util/helpers";
4
6
  import { VictoryCommonPrimitiveProps } from "../victory-util/common-props";
5
7
  import { Path } from "./path";
@@ -65,7 +67,7 @@ const defaultProps = {
65
67
  };
66
68
 
67
69
  export const Arc = (initialProps: ArcProps) => {
68
- const props = evaluateProps({ ...defaultProps, ...initialProps });
70
+ const props = evaluateProps(defaults({}, initialProps, defaultProps));
69
71
 
70
72
  return React.cloneElement(props.pathComponent!, {
71
73
  ...props.events,
@@ -1,4 +1,6 @@
1
1
  import React from "react";
2
+ import { defaults } from "lodash";
3
+
2
4
  import * as Helpers from "../victory-util/helpers";
3
5
  import { VictoryCommonPrimitiveProps } from "../victory-util/common-props";
4
6
  import { Rect } from "./rect";
@@ -33,7 +35,7 @@ const defaultProps = {
33
35
  };
34
36
 
35
37
  export const Background = (initialProps: BackgroundProps) => {
36
- const props = evaluateProps({ ...defaultProps, ...initialProps });
38
+ const props = evaluateProps(defaults({}, initialProps, defaultProps));
37
39
 
38
40
  return props.polar
39
41
  ? React.cloneElement(props.circleComponent!, {
@@ -1,4 +1,6 @@
1
1
  import React from "react";
2
+ import { defaults } from "lodash";
3
+
2
4
  import * as Helpers from "../victory-util/helpers";
3
5
  import { VictoryCommonPrimitiveProps } from "../victory-util/common-props";
4
6
  import { Rect } from "./rect";
@@ -39,7 +41,7 @@ const defaultProps = {
39
41
  };
40
42
 
41
43
  export const Border = (initialProps: BorderProps) => {
42
- const props = evaluateProps({ ...defaultProps, ...initialProps });
44
+ const props = evaluateProps(defaults({}, initialProps, defaultProps));
43
45
 
44
46
  return React.cloneElement(props.rectComponent!, {
45
47
  ...props.events,
@@ -1,4 +1,6 @@
1
1
  import React from "react";
2
+ import { defaults } from "lodash";
3
+
2
4
  import * as Helpers from "../victory-util/helpers";
3
5
  import { VictoryCommonPrimitiveProps } from "../victory-util/common-props";
4
6
  import { Line } from "./line";
@@ -40,7 +42,7 @@ const defaultProps = {
40
42
  };
41
43
 
42
44
  export const LineSegment = (initialProps: LineSegmentProps) => {
43
- const props = evaluateProps({ ...defaultProps, ...initialProps });
45
+ const props = evaluateProps(defaults({}, initialProps, defaultProps));
44
46
 
45
47
  return React.cloneElement(props.lineComponent!, {
46
48
  ...props.events,
@@ -1,4 +1,6 @@
1
1
  import React from "react";
2
+ import { defaults } from "lodash";
3
+
2
4
  import * as Helpers from "../victory-util/helpers";
3
5
  import * as pathHelpers from "../victory-util/point-path-helpers";
4
6
  import { VictoryCommonPrimitiveProps } from "../victory-util/common-props";
@@ -68,7 +70,7 @@ const defaultProps = {
68
70
  };
69
71
 
70
72
  export const Point = (initialProps: PointProps) => {
71
- const props = evaluateProps({ ...defaultProps, ...initialProps });
73
+ const props = evaluateProps(defaults({}, initialProps, defaultProps));
72
74
  const userProps = UserProps.getSafeUserProps(props);
73
75
 
74
76
  return React.cloneElement(props.pathComponent!, {
@@ -1,4 +1,6 @@
1
1
  import React from "react";
2
+ import { defaults } from "lodash";
3
+
2
4
  import * as Helpers from "../victory-util/helpers";
3
5
  import { VictoryCommonPrimitiveProps } from "../victory-util/common-props";
4
6
  import { Line } from "./line";
@@ -43,7 +45,7 @@ const defaultProps = {
43
45
  };
44
46
 
45
47
  export const Whisker = (initialProps: WhiskerProps) => {
46
- const props = evaluateProps({ ...defaultProps, ...initialProps });
48
+ const props = evaluateProps(defaults({}, initialProps, defaultProps));
47
49
  const {
48
50
  ariaLabel,
49
51
  groupComponent,