victory-core 36.4.1 → 36.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (227) hide show
  1. package/dist/victory-core.js +874 -879
  2. package/dist/victory-core.min.js +1 -1
  3. package/es/index.d.ts +38 -941
  4. package/es/index.js +19 -28
  5. package/es/types.d.ts +33 -0
  6. package/es/types.js +1 -0
  7. package/es/victory-accessible-group/victory-accessible-group.d.ts +25 -0
  8. package/es/victory-accessible-group/victory-accessible-group.js +8 -16
  9. package/es/victory-animation/util.d.ts +66 -0
  10. package/es/victory-animation/util.js +2 -1
  11. package/es/victory-animation/victory-animation.d.ts +69 -0
  12. package/es/victory-animation/victory-animation.js +59 -67
  13. package/es/victory-clip-container/victory-clip-container.d.ts +76 -0
  14. package/es/victory-clip-container/victory-clip-container.js +15 -21
  15. package/es/victory-container/victory-container.d.ts +99 -0
  16. package/es/victory-container/victory-container.js +31 -31
  17. package/es/victory-label/victory-label.d.ts +61 -0
  18. package/es/victory-label/victory-label.js +13 -8
  19. package/es/victory-portal/portal-context.d.ts +11 -0
  20. package/es/victory-portal/portal-context.js +3 -4
  21. package/es/victory-portal/portal.d.ts +28 -0
  22. package/es/victory-portal/portal.js +25 -33
  23. package/es/victory-portal/victory-portal.d.ts +31 -0
  24. package/es/victory-portal/victory-portal.js +23 -22
  25. package/es/victory-primitives/arc.d.ts +21 -0
  26. package/es/victory-primitives/arc.js +3 -5
  27. package/es/victory-primitives/background.d.ts +22 -0
  28. package/es/victory-primitives/background.js +4 -6
  29. package/es/victory-primitives/border.d.ts +18 -0
  30. package/es/victory-primitives/border.js +3 -5
  31. package/es/victory-primitives/circle.d.ts +2 -0
  32. package/es/victory-primitives/circle.js +11 -8
  33. package/es/victory-primitives/clip-path.d.ts +14 -0
  34. package/es/victory-primitives/clip-path.js +6 -6
  35. package/es/victory-primitives/index.d.ts +14 -0
  36. package/es/victory-primitives/index.js +14 -0
  37. package/es/victory-primitives/line-segment.d.ts +19 -0
  38. package/es/victory-primitives/line-segment.js +3 -5
  39. package/es/victory-primitives/line.d.ts +2 -0
  40. package/es/victory-primitives/line.js +11 -8
  41. package/es/victory-primitives/path.d.ts +2 -0
  42. package/es/victory-primitives/path.js +9 -6
  43. package/es/victory-primitives/point.d.ts +21 -0
  44. package/es/victory-primitives/point.js +9 -19
  45. package/es/victory-primitives/rect.d.ts +2 -0
  46. package/es/victory-primitives/rect.js +11 -8
  47. package/es/victory-primitives/text.d.ts +16 -0
  48. package/es/victory-primitives/text.js +7 -6
  49. package/es/victory-primitives/tspan.d.ts +2 -0
  50. package/es/victory-primitives/tspan.js +7 -6
  51. package/es/victory-primitives/types.d.ts +7 -0
  52. package/es/victory-primitives/types.js +1 -0
  53. package/es/victory-primitives/whisker.d.ts +24 -0
  54. package/es/victory-primitives/whisker.js +3 -5
  55. package/es/victory-theme/grayscale.d.ts +2 -0
  56. package/es/victory-theme/grayscale.js +1 -1
  57. package/es/victory-theme/material.d.ts +2 -0
  58. package/es/victory-theme/material.js +1 -1
  59. package/es/victory-theme/victory-theme-definition.d.ts +244 -0
  60. package/es/victory-theme/victory-theme-definition.js +1 -0
  61. package/es/victory-theme/victory-theme.d.ts +5 -0
  62. package/es/victory-theme/victory-theme.js +6 -5
  63. package/es/victory-transition/victory-transition.d.ts +59 -0
  64. package/es/victory-transition/victory-transition.js +19 -23
  65. package/es/victory-util/add-events.js +6 -3
  66. package/es/victory-util/axis.js +0 -1
  67. package/es/victory-util/collection.js +0 -2
  68. package/es/victory-util/data.js +0 -2
  69. package/es/victory-util/default-transitions.js +0 -1
  70. package/es/victory-util/domain.js +0 -2
  71. package/es/victory-util/helpers.js +0 -2
  72. package/es/victory-util/immutable.js +0 -1
  73. package/es/victory-util/label-helpers.js +0 -2
  74. package/es/victory-util/log.js +0 -1
  75. package/es/victory-util/point-path-helpers.d.ts +9 -0
  76. package/es/victory-util/point-path-helpers.js +59 -61
  77. package/es/victory-util/selection.d.ts +23 -0
  78. package/es/victory-util/selection.js +0 -2
  79. package/es/victory-util/style.js +0 -2
  80. package/es/victory-util/textsize.d.ts +8 -0
  81. package/es/victory-util/timer-context.d.ts +11 -0
  82. package/es/victory-util/timer.d.ts +16 -0
  83. package/es/victory-util/timer.js +13 -8
  84. package/es/victory-util/types.d.ts +188 -0
  85. package/es/victory-util/types.js +1 -0
  86. package/lib/index.d.ts +38 -941
  87. package/lib/index.js +195 -193
  88. package/lib/types.d.ts +33 -0
  89. package/lib/types.js +1 -0
  90. package/lib/victory-accessible-group/victory-accessible-group.d.ts +25 -0
  91. package/lib/victory-accessible-group/victory-accessible-group.js +9 -15
  92. package/lib/victory-animation/util.d.ts +66 -0
  93. package/lib/victory-animation/util.js +2 -1
  94. package/lib/victory-animation/victory-animation.d.ts +69 -0
  95. package/lib/victory-animation/victory-animation.js +60 -65
  96. package/lib/victory-clip-container/victory-clip-container.d.ts +76 -0
  97. package/lib/victory-clip-container/victory-clip-container.js +19 -22
  98. package/lib/victory-container/victory-container.d.ts +99 -0
  99. package/lib/victory-container/victory-container.js +34 -31
  100. package/lib/victory-label/victory-label.d.ts +61 -0
  101. package/lib/victory-label/victory-label.js +19 -13
  102. package/lib/victory-portal/portal-context.d.ts +11 -0
  103. package/lib/victory-portal/portal-context.js +3 -4
  104. package/lib/victory-portal/portal.d.ts +28 -0
  105. package/lib/victory-portal/portal.js +26 -31
  106. package/lib/victory-portal/victory-portal.d.ts +31 -0
  107. package/lib/victory-portal/victory-portal.js +24 -20
  108. package/lib/victory-primitives/arc.d.ts +21 -0
  109. package/lib/victory-primitives/arc.js +5 -6
  110. package/lib/victory-primitives/background.d.ts +22 -0
  111. package/lib/victory-primitives/background.js +7 -8
  112. package/lib/victory-primitives/border.d.ts +18 -0
  113. package/lib/victory-primitives/border.js +5 -6
  114. package/lib/victory-primitives/circle.d.ts +2 -0
  115. package/lib/victory-primitives/circle.js +11 -6
  116. package/lib/victory-primitives/clip-path.d.ts +14 -0
  117. package/lib/victory-primitives/clip-path.js +7 -5
  118. package/lib/victory-primitives/index.d.ts +14 -0
  119. package/lib/victory-primitives/index.js +187 -0
  120. package/lib/victory-primitives/line-segment.d.ts +19 -0
  121. package/lib/victory-primitives/line-segment.js +5 -6
  122. package/lib/victory-primitives/line.d.ts +2 -0
  123. package/lib/victory-primitives/line.js +11 -6
  124. package/lib/victory-primitives/path.d.ts +2 -0
  125. package/lib/victory-primitives/path.js +9 -4
  126. package/lib/victory-primitives/point.d.ts +21 -0
  127. package/lib/victory-primitives/point.js +13 -21
  128. package/lib/victory-primitives/rect.d.ts +2 -0
  129. package/lib/victory-primitives/rect.js +11 -6
  130. package/lib/victory-primitives/text.d.ts +16 -0
  131. package/lib/victory-primitives/text.js +8 -5
  132. package/lib/victory-primitives/tspan.d.ts +2 -0
  133. package/lib/victory-primitives/tspan.js +7 -4
  134. package/lib/victory-primitives/types.d.ts +7 -0
  135. package/lib/victory-primitives/types.js +1 -0
  136. package/lib/victory-primitives/whisker.d.ts +24 -0
  137. package/lib/victory-primitives/whisker.js +5 -6
  138. package/lib/victory-theme/grayscale.d.ts +2 -0
  139. package/lib/victory-theme/grayscale.js +3 -3
  140. package/lib/victory-theme/material.d.ts +2 -0
  141. package/lib/victory-theme/material.js +3 -3
  142. package/lib/victory-theme/victory-theme-definition.d.ts +244 -0
  143. package/lib/victory-theme/victory-theme-definition.js +1 -0
  144. package/lib/victory-theme/victory-theme.d.ts +5 -0
  145. package/lib/victory-theme/victory-theme.js +22 -8
  146. package/lib/victory-transition/victory-transition.d.ts +59 -0
  147. package/lib/victory-transition/victory-transition.js +21 -23
  148. package/lib/victory-util/add-events.js +8 -4
  149. package/lib/victory-util/collection.js +0 -2
  150. package/lib/victory-util/default-transitions.js +0 -1
  151. package/lib/victory-util/helpers.js +0 -2
  152. package/lib/victory-util/immutable.js +0 -2
  153. package/lib/victory-util/label-helpers.js +0 -2
  154. package/lib/victory-util/log.js +0 -1
  155. package/lib/victory-util/point-path-helpers.d.ts +9 -0
  156. package/lib/victory-util/point-path-helpers.js +86 -73
  157. package/lib/victory-util/selection.d.ts +23 -0
  158. package/lib/victory-util/selection.js +0 -2
  159. package/lib/victory-util/style.js +0 -2
  160. package/lib/victory-util/textsize.d.ts +8 -0
  161. package/lib/victory-util/timer-context.d.ts +11 -0
  162. package/lib/victory-util/timer.d.ts +16 -0
  163. package/lib/victory-util/timer.js +13 -8
  164. package/lib/victory-util/types.d.ts +188 -0
  165. package/lib/victory-util/types.js +1 -0
  166. package/package.json +4 -4
  167. package/src/index.ts +42 -0
  168. package/src/types.ts +45 -0
  169. package/src/victory-accessible-group/{victory-accessible-group.js → victory-accessible-group.tsx} +10 -3
  170. package/src/victory-animation/{util.js → util.ts} +4 -3
  171. package/src/victory-animation/{victory-animation.js → victory-animation.tsx} +89 -12
  172. package/src/victory-clip-container/{victory-clip-container.js → victory-clip-container.tsx} +29 -5
  173. package/src/victory-container/{victory-container.js → victory-container.tsx} +70 -26
  174. package/src/victory-label/{victory-label.js → victory-label.tsx} +71 -14
  175. package/src/victory-portal/portal-context.ts +14 -0
  176. package/src/victory-portal/{portal.js → portal.tsx} +23 -12
  177. package/src/victory-portal/{victory-portal.js → victory-portal.tsx} +21 -6
  178. package/src/victory-primitives/{arc.js → arc.tsx} +15 -5
  179. package/src/victory-primitives/{background.js → background.tsx} +17 -7
  180. package/src/victory-primitives/{border.js → border.tsx} +12 -5
  181. package/src/victory-primitives/{circle.js → circle.tsx} +4 -3
  182. package/src/victory-primitives/clip-path.tsx +25 -0
  183. package/src/victory-primitives/index.ts +14 -0
  184. package/src/victory-primitives/{line-segment.js → line-segment.tsx} +13 -5
  185. package/src/victory-primitives/{line.js → line.tsx} +4 -3
  186. package/src/victory-primitives/{path.js → path.tsx} +4 -3
  187. package/src/victory-primitives/{point.js → point.tsx} +25 -20
  188. package/src/victory-primitives/{rect.js → rect.tsx} +4 -2
  189. package/src/victory-primitives/{text.js → text.tsx} +9 -3
  190. package/src/victory-primitives/tspan.tsx +7 -0
  191. package/src/victory-primitives/types.ts +19 -0
  192. package/src/victory-primitives/{whisker.js → whisker.tsx} +20 -7
  193. package/src/victory-theme/{grayscale.js → grayscale.tsx} +2 -1
  194. package/src/victory-theme/{material.js → material.tsx} +2 -1
  195. package/src/victory-theme/victory-theme-definition.ts +261 -0
  196. package/src/victory-theme/victory-theme.tsx +5 -0
  197. package/src/victory-transition/{victory-transition.js → victory-transition.tsx} +68 -19
  198. package/src/victory-util/add-events.js +6 -1
  199. package/src/victory-util/axis.js +0 -1
  200. package/src/victory-util/collection.js +0 -1
  201. package/src/victory-util/data.js +0 -1
  202. package/src/victory-util/default-transitions.js +0 -1
  203. package/src/victory-util/domain.js +0 -1
  204. package/src/victory-util/events.js +1 -1
  205. package/src/victory-util/helpers.js +0 -1
  206. package/src/victory-util/immutable.js +0 -1
  207. package/src/victory-util/label-helpers.js +0 -1
  208. package/src/victory-util/log.js +0 -1
  209. package/src/victory-util/point-path-helpers.ts +119 -0
  210. package/src/victory-util/prop-types.js +0 -1
  211. package/src/victory-util/scale.js +0 -1
  212. package/src/victory-util/selection.d.ts +23 -0
  213. package/src/victory-util/selection.js +0 -1
  214. package/src/victory-util/style.js +0 -1
  215. package/src/victory-util/textsize.d.ts +8 -0
  216. package/src/victory-util/{timer-context.js → timer-context.ts} +0 -0
  217. package/src/victory-util/{timer.js → timer.ts} +19 -4
  218. package/src/victory-util/transitions.js +0 -1
  219. package/src/victory-util/types.ts +247 -0
  220. package/src/victory-util/wrapper.js +0 -1
  221. package/src/index.d.ts +0 -941
  222. package/src/index.js +0 -51
  223. package/src/victory-portal/portal-context.js +0 -10
  224. package/src/victory-primitives/clip-path.js +0 -18
  225. package/src/victory-primitives/tspan.js +0 -5
  226. package/src/victory-theme/victory-theme.js +0 -7
  227. package/src/victory-util/point-path-helpers.js +0 -121
@@ -1,7 +1,8 @@
1
1
  import React from "react";
2
-
3
- var TSpan = function (props) {
4
- return /*#__PURE__*/React.createElement("tspan", props);
5
- };
6
-
7
- export default TSpan;
2
+ export var TSpan = function (props) {
3
+ return (
4
+ /*#__PURE__*/
5
+ // @ts-expect-error FIXME: "id cannot be a number"
6
+ React.createElement("tspan", props)
7
+ );
8
+ };
@@ -0,0 +1,7 @@
1
+ import { VictoryCommonPrimitiveProps } from "../victory-util/types";
2
+ export declare type ScatterSymbolType = "circle" | "cross" | "diamond" | "plus" | "minus" | "square" | "star" | "triangleDown" | "triangleUp";
3
+ export interface VictoryPrimitiveShapeProps extends VictoryCommonPrimitiveProps {
4
+ desc?: string;
5
+ rx?: number;
6
+ ry?: number;
7
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,24 @@
1
+ import React from "react";
2
+ import { VictoryCommonPrimitiveProps } from "../victory-util/types";
3
+ export declare type WhiskerAxes = {
4
+ x1?: number;
5
+ x2?: number;
6
+ y1?: number;
7
+ y2?: number;
8
+ };
9
+ export interface WhiskerProps extends VictoryCommonPrimitiveProps {
10
+ groupComponent?: React.ReactElement;
11
+ lineComponent?: React.ReactElement;
12
+ majorWhisker?: WhiskerAxes;
13
+ minorWhisker?: WhiskerAxes;
14
+ }
15
+ export declare const Whisker: {
16
+ (props: WhiskerProps): React.ReactElement<any, string | React.JSXElementConstructor<any>>;
17
+ propTypes: any;
18
+ defaultProps: {
19
+ groupComponent: JSX.Element;
20
+ lineComponent: JSX.Element;
21
+ role: string;
22
+ shapeRendering: string;
23
+ };
24
+ };
@@ -10,7 +10,7 @@ import React from "react";
10
10
  import PropTypes from "prop-types";
11
11
  import * as Helpers from "../victory-util/helpers";
12
12
  import * as CommonProps from "../victory-util/common-props";
13
- import Line from "./line";
13
+ import { Line } from "./line";
14
14
 
15
15
  var evaluateProps = function (props) {
16
16
  /**
@@ -35,7 +35,7 @@ var evaluateProps = function (props) {
35
35
  });
36
36
  };
37
37
 
38
- var Whisker = function (props) {
38
+ export var Whisker = function (props) {
39
39
  props = evaluateProps(props);
40
40
  var _props = props,
41
41
  ariaLabel = _props.ariaLabel,
@@ -72,7 +72,6 @@ var Whisker = function (props) {
72
72
  "aria-label": ariaLabel
73
73
  }, baseProps, minorWhisker))]);
74
74
  };
75
-
76
75
  Whisker.propTypes = _objectSpread(_objectSpread({}, CommonProps.primitiveProps), {}, {
77
76
  groupComponent: PropTypes.element,
78
77
  lineComponent: PropTypes.element,
@@ -94,5 +93,4 @@ Whisker.defaultProps = {
94
93
  lineComponent: /*#__PURE__*/React.createElement(Line, null),
95
94
  role: "presentation",
96
95
  shapeRendering: "auto"
97
- };
98
- export default Whisker;
96
+ };
@@ -0,0 +1,2 @@
1
+ import { VictoryThemeDefinition } from "./victory-theme-definition";
2
+ export declare const grayscale: VictoryThemeDefinition;
@@ -41,7 +41,7 @@ var centeredLabelStyles = _assign({
41
41
 
42
42
  var strokeLinecap = "round";
43
43
  var strokeLinejoin = "round";
44
- export default {
44
+ export var grayscale = {
45
45
  area: _assign({
46
46
  style: {
47
47
  data: {
@@ -0,0 +1,2 @@
1
+ import { VictoryThemeDefinition } from "./victory-theme-definition";
2
+ export declare const material: VictoryThemeDefinition;
@@ -51,7 +51,7 @@ var centeredLabelStyles = _assign({
51
51
  var strokeDasharray = "10, 5";
52
52
  var strokeLinecap = "round";
53
53
  var strokeLinejoin = "round";
54
- export default {
54
+ export var material = {
55
55
  area: _assign({
56
56
  style: {
57
57
  data: {
@@ -0,0 +1,244 @@
1
+ import * as React from "react";
2
+ import { VictoryCommonThemeProps, VictoryDatableProps } from "../index";
3
+ import { CallbackArgs, StringOrNumberOrCallback } from "../types";
4
+ export declare type BlockProps = {
5
+ top?: number;
6
+ bottom?: number;
7
+ left?: number;
8
+ right?: number;
9
+ };
10
+ export declare type PaddingProps = number | BlockProps;
11
+ export declare type OrientationTypes = "top" | "bottom" | "left" | "right";
12
+ export declare type VictoryNumberCallback = (args: CallbackArgs) => number;
13
+ export declare type VictoryPaddingCallback = (args: CallbackArgs) => number | BlockProps;
14
+ export declare type VictoryOrientationCallback = (args: CallbackArgs) => OrientationTypes;
15
+ export declare type NumberOrCallback = number | VictoryNumberCallback;
16
+ export declare type PaddingOrCallback = number | BlockProps | VictoryPaddingCallback;
17
+ export declare type OrientationOrCallback = OrientationTypes | VictoryOrientationCallback;
18
+ export declare type VictoryStyleObject = {
19
+ [K in keyof React.CSSProperties]: StringOrNumberOrCallback;
20
+ };
21
+ export declare type LabelProps = React.CSSProperties & {
22
+ angle?: number;
23
+ verticalAnchor?: VerticalAnchorType;
24
+ };
25
+ export declare type VictoryLabelStyleObject = {
26
+ [K in keyof LabelProps]: StringOrNumberOrCallback;
27
+ };
28
+ /**
29
+ * Style interface used in components/themeing
30
+ */
31
+ export interface VictoryStyleInterface {
32
+ parent?: VictoryStyleObject;
33
+ data?: VictoryStyleObject;
34
+ labels?: VictoryLabelStyleObject | VictoryLabelStyleObject[];
35
+ border?: VictoryStyleObject;
36
+ }
37
+ export declare type TickProps = React.CSSProperties & {
38
+ size?: number;
39
+ };
40
+ export declare type VictoryTickStyleObject = {
41
+ [K in keyof TickProps]: StringOrNumberOrCallback;
42
+ };
43
+ export interface VictoryAxisCommonProps {
44
+ axisComponent?: React.ReactElement;
45
+ axisLabelComponent?: React.ReactElement;
46
+ axisValue?: number | string | object | Date;
47
+ dependentAxis?: boolean;
48
+ disableInlineStyles?: boolean;
49
+ gridComponent?: React.ReactElement;
50
+ invertAxis?: boolean;
51
+ style?: {
52
+ parent?: VictoryStyleObject;
53
+ axis?: VictoryStyleObject;
54
+ axisLabel?: VictoryLabelStyleObject | VictoryLabelStyleObject[];
55
+ grid?: VictoryStyleObject;
56
+ ticks?: VictoryTickStyleObject;
57
+ tickLabels?: VictoryLabelStyleObject | VictoryLabelStyleObject[];
58
+ };
59
+ tickComponent?: React.ReactElement;
60
+ tickCount?: number;
61
+ tickLabelComponent?: React.ReactElement;
62
+ tickFormat?: any[] | {
63
+ (tick: any, index: number, ticks: any[]): string | number;
64
+ };
65
+ tickValues?: any[];
66
+ }
67
+ export declare type VerticalAnchorType = "start" | "middle" | "end";
68
+ export interface VictoryThemeDefinition {
69
+ area?: {
70
+ style?: {
71
+ data?: VictoryStyleObject;
72
+ labels?: VictoryLabelStyleObject | VictoryLabelStyleObject[];
73
+ };
74
+ } & VictoryCommonThemeProps & VictoryDatableProps;
75
+ axis?: {
76
+ style?: {
77
+ axis?: VictoryStyleObject;
78
+ axisLabel?: VictoryLabelStyleObject | VictoryLabelStyleObject[];
79
+ grid?: VictoryStyleObject;
80
+ ticks?: VictoryTickStyleObject;
81
+ tickLabels?: VictoryLabelStyleObject | VictoryLabelStyleObject[];
82
+ };
83
+ offsetX?: number;
84
+ offsetY?: number;
85
+ } & VictoryCommonThemeProps;
86
+ bar?: {
87
+ style?: {
88
+ data?: VictoryStyleObject;
89
+ labels?: VictoryLabelStyleObject | VictoryLabelStyleObject[];
90
+ };
91
+ } & VictoryCommonThemeProps & VictoryDatableProps;
92
+ boxplot?: {
93
+ style?: {
94
+ max?: VictoryStyleObject;
95
+ maxLabels?: VictoryLabelStyleObject | VictoryLabelStyleObject[];
96
+ median?: VictoryStyleObject;
97
+ medianLabels?: VictoryLabelStyleObject | VictoryLabelStyleObject[];
98
+ min?: VictoryStyleObject;
99
+ minLabels?: VictoryLabelStyleObject | VictoryLabelStyleObject[];
100
+ q1?: VictoryStyleObject;
101
+ q1Labels?: VictoryLabelStyleObject | VictoryLabelStyleObject[];
102
+ q3?: VictoryStyleObject;
103
+ q3Labels?: VictoryLabelStyleObject | VictoryLabelStyleObject[];
104
+ };
105
+ boxWidth?: number;
106
+ } & VictoryCommonThemeProps;
107
+ candlestick?: {
108
+ style?: {
109
+ data?: VictoryStyleObject;
110
+ labels?: VictoryLabelStyleObject | VictoryLabelStyleObject[];
111
+ };
112
+ candleColors?: {
113
+ positive?: string;
114
+ negative?: string;
115
+ };
116
+ } & VictoryCommonThemeProps;
117
+ chart?: VictoryCommonThemeProps;
118
+ dependentAxis?: {
119
+ style?: {
120
+ axis?: VictoryStyleObject;
121
+ axisLabel?: VictoryLabelStyleObject | VictoryLabelStyleObject[];
122
+ grid?: VictoryStyleObject;
123
+ ticks?: VictoryTickStyleObject;
124
+ tickLabels?: VictoryLabelStyleObject | VictoryLabelStyleObject[];
125
+ };
126
+ offsetX?: number;
127
+ offsetY?: number;
128
+ orientation?: OrientationTypes;
129
+ } & VictoryCommonThemeProps;
130
+ errorbar?: {
131
+ borderWidth?: number;
132
+ style?: {
133
+ data?: VictoryStyleObject;
134
+ labels?: VictoryLabelStyleObject | VictoryLabelStyleObject[];
135
+ };
136
+ } & VictoryCommonThemeProps;
137
+ group?: {
138
+ style?: {
139
+ data?: VictoryStyleObject;
140
+ labels?: VictoryLabelStyleObject | VictoryLabelStyleObject[];
141
+ };
142
+ } & VictoryCommonThemeProps;
143
+ histogram?: {
144
+ style?: {
145
+ data?: VictoryStyleObject;
146
+ labels?: VictoryLabelStyleObject | VictoryLabelStyleObject[];
147
+ };
148
+ } & VictoryCommonThemeProps;
149
+ independentAxis?: {
150
+ style?: {
151
+ axis?: VictoryStyleObject;
152
+ axisLabel?: VictoryLabelStyleObject | VictoryLabelStyleObject[];
153
+ grid?: VictoryStyleObject;
154
+ ticks?: VictoryTickStyleObject;
155
+ tickLabels?: VictoryLabelStyleObject | VictoryLabelStyleObject[];
156
+ };
157
+ offsetX?: number;
158
+ offsetY?: number;
159
+ orientation?: OrientationTypes;
160
+ } & VictoryCommonThemeProps;
161
+ legend?: {
162
+ gutter?: number | BlockProps;
163
+ rowGutter?: number | BlockProps;
164
+ orientation?: string;
165
+ titleOrientation?: string;
166
+ style?: {
167
+ data?: VictoryStyleObject & {
168
+ type?: string;
169
+ };
170
+ border?: VictoryStyleObject;
171
+ labels?: VictoryLabelStyleObject | VictoryLabelStyleObject[];
172
+ title?: VictoryLabelStyleObject;
173
+ };
174
+ itemsPerRow?: number;
175
+ x?: number;
176
+ y?: number;
177
+ centerTitle?: boolean;
178
+ borderPadding?: number | BlockProps;
179
+ } & VictoryCommonThemeProps;
180
+ line?: {
181
+ style?: {
182
+ data?: VictoryStyleObject;
183
+ labels?: VictoryLabelStyleObject | VictoryLabelStyleObject[];
184
+ };
185
+ } & VictoryCommonThemeProps & VictoryDatableProps;
186
+ pie?: {
187
+ style?: {
188
+ data?: VictoryStyleObject;
189
+ labels?: VictoryLabelStyleObject | VictoryLabelStyleObject[];
190
+ };
191
+ } & VictoryCommonThemeProps & VictoryDatableProps;
192
+ polarAxis?: {
193
+ style?: {
194
+ axis?: VictoryStyleObject;
195
+ axisLabel?: VictoryLabelStyleObject | VictoryLabelStyleObject[];
196
+ grid?: VictoryStyleObject;
197
+ ticks?: VictoryTickStyleObject;
198
+ tickLabels?: VictoryLabelStyleObject | VictoryLabelStyleObject[];
199
+ };
200
+ } & VictoryCommonThemeProps;
201
+ polarDependentAxis?: {
202
+ style?: {
203
+ axis?: VictoryStyleObject;
204
+ axisLabel?: VictoryLabelStyleObject | VictoryLabelStyleObject[];
205
+ grid?: VictoryStyleObject;
206
+ ticks?: VictoryTickStyleObject;
207
+ tickLabels?: VictoryLabelStyleObject | VictoryLabelStyleObject[];
208
+ };
209
+ } & VictoryCommonThemeProps;
210
+ polarIndependentAxis?: {
211
+ style?: {
212
+ axis?: VictoryStyleObject;
213
+ axisLabel?: VictoryLabelStyleObject | VictoryLabelStyleObject[];
214
+ grid?: VictoryStyleObject;
215
+ ticks?: VictoryTickStyleObject;
216
+ tickLabels?: VictoryLabelStyleObject | VictoryLabelStyleObject[];
217
+ };
218
+ } & VictoryCommonThemeProps;
219
+ scatter?: {
220
+ style?: {
221
+ data?: VictoryStyleObject;
222
+ labels?: VictoryLabelStyleObject | VictoryLabelStyleObject[];
223
+ };
224
+ } & VictoryCommonThemeProps & VictoryDatableProps;
225
+ stack?: VictoryCommonThemeProps;
226
+ tooltip?: {
227
+ style?: VictoryLabelStyleObject | VictoryLabelStyleObject[];
228
+ flyoutStyle?: VictoryStyleObject;
229
+ cornerRadius?: NumberOrCallback;
230
+ pointerLength?: NumberOrCallback;
231
+ flyoutPadding?: PaddingOrCallback;
232
+ flyoutWidth?: NumberOrCallback;
233
+ flyoutHeight?: NumberOrCallback;
234
+ orientation?: OrientationOrCallback;
235
+ pointerOrientation?: OrientationOrCallback;
236
+ };
237
+ voronoi?: {
238
+ style?: {
239
+ data?: VictoryStyleObject;
240
+ labels?: VictoryLabelStyleObject | VictoryLabelStyleObject[];
241
+ flyout?: VictoryStyleObject;
242
+ };
243
+ } & VictoryCommonThemeProps & VictoryDatableProps;
244
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,5 @@
1
+ export * from "./victory-theme-definition";
2
+ export declare const VictoryTheme: {
3
+ grayscale: import("./victory-theme-definition").VictoryThemeDefinition;
4
+ material: import("./victory-theme-definition").VictoryThemeDefinition;
5
+ };
@@ -1,6 +1,7 @@
1
- import materialTheme from "./material";
2
- import grayscaleTheme from "./grayscale";
3
- export default {
4
- material: materialTheme,
5
- grayscale: grayscaleTheme
1
+ import { grayscale } from "./grayscale";
2
+ import { material } from "./material";
3
+ export * from "./victory-theme-definition";
4
+ export var VictoryTheme = {
5
+ grayscale: grayscale,
6
+ material: material
6
7
  };
@@ -0,0 +1,59 @@
1
+ import React from "react";
2
+ import PropTypes from "prop-types";
3
+ import TimerContext from "../victory-util/timer-context";
4
+ import Timer from "../victory-util/timer";
5
+ declare type VictoryTransitionChild = React.ReactElement<{
6
+ polar?: boolean;
7
+ domain?: number[] | {
8
+ x: number[];
9
+ y: number[];
10
+ };
11
+ groupComponent?: React.ReactElement;
12
+ }, {
13
+ new (props: any): React.Component<any, any>;
14
+ continuous?: boolean;
15
+ }>;
16
+ interface VictoryTransitionProps {
17
+ animate?: boolean | any;
18
+ animationWhitelist?: string[];
19
+ children: VictoryTransitionChild;
20
+ }
21
+ interface VictoryTransitionState {
22
+ oldProps?: VictoryTransitionProps | null;
23
+ nextProps?: VictoryTransitionProps;
24
+ nodesShouldLoad?: boolean;
25
+ nodesDoneLoad?: boolean;
26
+ nodesWillExit?: boolean;
27
+ nodesWillEnter?: boolean;
28
+ nodesShouldEnter?: boolean;
29
+ childrenTransitions?: unknown;
30
+ }
31
+ export interface VictoryTransition {
32
+ context: React.ContextType<typeof TimerContext>;
33
+ }
34
+ export declare class VictoryTransition extends React.Component<VictoryTransitionProps, VictoryTransitionState> {
35
+ static displayName: string;
36
+ static propTypes: {
37
+ animate: PropTypes.Requireable<boolean | object>;
38
+ animationWhitelist: PropTypes.Requireable<any[]>;
39
+ children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
40
+ };
41
+ static contextType: React.Context<{
42
+ transitionTimer: Timer;
43
+ animationTimer: Timer;
44
+ }>;
45
+ private continuous;
46
+ private timer;
47
+ private transitionProps;
48
+ constructor(props: any, context: any);
49
+ componentDidMount(): void;
50
+ shouldComponentUpdate(nextProps: VictoryTransitionProps): boolean;
51
+ componentWillUnmount(): void;
52
+ private getTransitionState;
53
+ private getDomainFromChildren;
54
+ pickProps(): Readonly<VictoryTransitionProps>;
55
+ private pickDomainProps;
56
+ getClipWidth(props: any, child: any): any;
57
+ render(): JSX.Element;
58
+ }
59
+ export {};
@@ -1,9 +1,8 @@
1
- import _isObject from "lodash/isObject";
2
1
  import _pick from "lodash/pick";
3
2
  import _isFunction from "lodash/isFunction";
4
3
  import _defaults from "lodash/defaults";
5
4
 
6
- function _extends() { _extends = Object.assign || 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); }
5
+ 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); }
7
6
 
8
7
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
9
8
 
@@ -13,7 +12,7 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
13
12
 
14
13
  function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
15
14
 
16
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
15
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
17
16
 
18
17
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
19
18
 
@@ -23,20 +22,17 @@ function _assertThisInitialized(self) { if (self === void 0) { throw new Referen
23
22
 
24
23
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
25
24
 
26
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
27
-
28
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
25
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
29
26
 
30
27
  import React from "react";
31
28
  import PropTypes from "prop-types";
32
- import VictoryAnimation from "../victory-animation/victory-animation";
29
+ import { VictoryAnimation } from "../victory-animation/victory-animation";
33
30
  import * as Collection from "../victory-util/collection";
34
31
  import * as Helpers from "../victory-util/helpers";
35
32
  import TimerContext from "../victory-util/timer-context";
36
33
  import * as Transitions from "../victory-util/transitions";
37
34
  import isEqual from "react-fast-compare";
38
-
39
- var VictoryTransition = /*#__PURE__*/function (_React$Component) {
35
+ export var VictoryTransition = /*#__PURE__*/function (_React$Component) {
40
36
  _inherits(VictoryTransition, _React$Component);
41
37
 
42
38
  var _super = _createSuper(VictoryTransition);
@@ -47,6 +43,9 @@ var VictoryTransition = /*#__PURE__*/function (_React$Component) {
47
43
  _classCallCheck(this, VictoryTransition);
48
44
 
49
45
  _this = _super.call(this, props, context);
46
+ _this.continuous = void 0;
47
+ _this.timer = void 0;
48
+ _this.transitionProps = void 0;
50
49
  _this.state = {
51
50
  nodesShouldLoad: false,
52
51
  nodesDoneLoad: false
@@ -54,7 +53,6 @@ var VictoryTransition = /*#__PURE__*/function (_React$Component) {
54
53
  var child = _this.props.children;
55
54
  var polar = child.props.polar;
56
55
  _this.continuous = !polar && child.type && child.type.continuous === true;
57
- _this.getTransitionState = _this.getTransitionState.bind(_assertThisInitialized(_this));
58
56
  _this.timer = _this.context.transitionTimer;
59
57
  return _this;
60
58
  }
@@ -158,10 +156,12 @@ var VictoryTransition = /*#__PURE__*/function (_React$Component) {
158
156
  }, {
159
157
  key: "pickDomainProps",
160
158
  value: function pickDomainProps(props) {
161
- var parentState = _isObject(props.animate) && props.animate.parentState;
159
+ var _props$animate;
160
+
161
+ var parentState = (_props$animate = props.animate) === null || _props$animate === void 0 ? void 0 : _props$animate.parentState;
162
162
 
163
163
  if (parentState && parentState.nodesWillExit) {
164
- return this.continous || parentState.continuous ? parentState.nextProps || this.state.nextProps || props : props;
164
+ return this.continuous || parentState.continuous ? parentState.nextProps || this.state.nextProps || props : props;
165
165
  }
166
166
 
167
167
  return this.continuous && this.state.nodesWillExit ? this.state.nextProps || props : props;
@@ -180,10 +180,11 @@ var VictoryTransition = /*#__PURE__*/function (_React$Component) {
180
180
  }, {
181
181
  key: "render",
182
182
  value: function render() {
183
- var _this3 = this;
183
+ var _this$props$animate,
184
+ _this3 = this;
184
185
 
185
186
  var props = this.pickProps();
186
- var getTransitionProps = _isObject(this.props.animate) && this.props.animate.getTransitions ? this.props.animate.getTransitions : Transitions.getTransitionPropsFactory(props, this.state, function (newState) {
187
+ var getTransitionProps = (_this$props$animate = this.props.animate) !== null && _this$props$animate !== void 0 && _this$props$animate.getTransitions ? this.props.animate.getTransitions : Transitions.getTransitionPropsFactory(props, this.state, function (newState) {
187
188
  return _this3.setState(newState);
188
189
  });
189
190
  var child = React.Children.toArray(props.children)[0];
@@ -227,15 +228,10 @@ var VictoryTransition = /*#__PURE__*/function (_React$Component) {
227
228
 
228
229
  return VictoryTransition;
229
230
  }(React.Component);
230
-
231
- _defineProperty(VictoryTransition, "displayName", "VictoryTransition");
232
-
233
- _defineProperty(VictoryTransition, "propTypes", {
231
+ VictoryTransition.displayName = "VictoryTransition";
232
+ VictoryTransition.propTypes = {
234
233
  animate: PropTypes.oneOfType([PropTypes.bool, PropTypes.object]),
235
234
  animationWhitelist: PropTypes.array,
236
235
  children: PropTypes.node
237
- });
238
-
239
- _defineProperty(VictoryTransition, "contextType", TimerContext);
240
-
241
- export { VictoryTransition as default };
236
+ };
237
+ VictoryTransition.contextType = TimerContext;
@@ -28,7 +28,7 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
28
28
 
29
29
  function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
30
30
 
31
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
31
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
32
32
 
33
33
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
34
34
 
@@ -38,13 +38,16 @@ function _assertThisInitialized(self) { if (self === void 0) { throw new Referen
38
38
 
39
39
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
40
40
 
41
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
41
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
42
42
 
43
43
  /*global window:false */
44
44
  import React from "react";
45
45
  import * as Events from "./events";
46
46
  import isEqual from "react-fast-compare";
47
- import VictoryTransition from "../victory-transition/victory-transition";
47
+ import { VictoryTransition } from "../victory-transition/victory-transition"; // DISCLAIMER:
48
+ // This file is not currently tested, and it is first on the list of files
49
+ // to refactor in our current refactoring effort. Please do not make changes
50
+ // to this file without manual testing and/or refactoring and adding tests.
48
51
 
49
52
  var datumHasXandY = function (datum) {
50
53
  return !_isNil(datum._x) && !_isNil(datum._y);
@@ -23,7 +23,6 @@ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToAr
23
23
 
24
24
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
25
25
 
26
- /* eslint-disable func-style */
27
26
  import React from "react";
28
27
  import * as Collection from "./collection";
29
28
  import * as Domain from "./domain";
@@ -10,8 +10,6 @@ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToAr
10
10
 
11
11
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
12
12
 
13
- /* eslint-disable func-style */
14
-
15
13
  /* eslint-disable no-use-before-define */
16
14
  function isNonEmptyArray(collection) {
17
15
  return Array.isArray(collection) && collection.length > 0;
@@ -24,8 +24,6 @@ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToAr
24
24
 
25
25
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
26
26
 
27
- /* eslint-disable func-style */
28
-
29
27
  /* eslint-disable no-use-before-define */
30
28
  import React from "react";
31
29
  import * as Helpers from "./helpers";
@@ -1,4 +1,3 @@
1
- /* eslint-disable func-style */
2
1
  export function continuousTransitions() {
3
2
  return {
4
3
  onLoad: {
@@ -17,8 +17,6 @@ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToAr
17
17
 
18
18
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
19
19
 
20
- /* eslint-disable func-style */
21
-
22
20
  /* eslint-disable no-use-before-define */
23
21
  import React from "react";
24
22
  import * as Data from "./data";
@@ -5,8 +5,6 @@ import _property from "lodash/property";
5
5
  import _isFunction from "lodash/isFunction";
6
6
  import _defaults from "lodash/defaults";
7
7
 
8
- /* eslint-disable func-style */
9
-
10
8
  /* eslint-disable no-use-before-define */
11
9
  import React from "react";
12
10
 
@@ -1,4 +1,3 @@
1
- /* eslint-disable func-style */
2
1
  export var IMMUTABLE_ITERABLE = "@@__IMMUTABLE_ITERABLE__@@";
3
2
  export var IMMUTABLE_RECORD = "@@__IMMUTABLE_RECORD__@@";
4
3
  export var IMMUTABLE_LIST = "@@__IMMUTABLE_LIST__@@";
@@ -1,7 +1,5 @@
1
1
  import _defaults from "lodash/defaults";
2
2
 
3
- /* eslint-disable func-style */
4
-
5
3
  /* eslint-disable no-use-before-define */
6
4
  import * as Helpers from "./helpers";
7
5
 
@@ -2,7 +2,6 @@
2
2
 
3
3
  /* eslint-disable no-console */
4
4
  // TODO: Use "warning" npm module like React is switching to.
5
- // eslint-disable-next-line func-style
6
5
  export function warn(message) {
7
6
  if (process.env.NODE_ENV !== "production") {
8
7
  if (console && console.warn) {