victory-area 36.4.1 → 36.5.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.
@@ -1,7 +1,7 @@
1
1
  import PropTypes from "prop-types";
2
2
  import React from "react";
3
3
  import { getBaseProps } from "./helper-methods";
4
- import Area from "./area";
4
+ import { Area } from "./area";
5
5
  import {
6
6
  PropTypes as CustomPropTypes,
7
7
  Helpers,
@@ -14,32 +14,61 @@ import {
14
14
  VictoryTheme,
15
15
  Data,
16
16
  Domain,
17
- UserProps
17
+ UserProps,
18
+ EventPropTypeInterface,
19
+ InterpolationPropType,
20
+ StringOrNumberOrCallback,
21
+ VictoryCommonProps,
22
+ VictoryDatableProps,
23
+ VictoryMultiLabelableProps,
24
+ VictoryStyleInterface,
25
+ EventsMixinClass,
18
26
  } from "victory-core";
19
27
 
20
28
  const fallbackProps = {
21
29
  width: 450,
22
30
  height: 300,
23
31
  padding: 50,
24
- interpolation: "linear"
32
+ interpolation: "linear",
25
33
  };
26
34
 
27
35
  const options = {
28
36
  components: [
29
37
  { name: "parent", index: "parent" },
30
38
  { name: "data", index: "all" },
31
- { name: "labels" }
32
- ]
39
+ { name: "labels" },
40
+ ],
33
41
  };
34
42
 
35
- class VictoryArea extends React.Component {
43
+ export type VictoryAreaTTargetType = "data" | "labels" | "parent";
44
+
45
+ export interface VictoryAreaProps
46
+ extends VictoryCommonProps,
47
+ VictoryDatableProps,
48
+ VictoryMultiLabelableProps {
49
+ eventKey?: string[] | number[] | StringOrNumberOrCallback;
50
+ events?: EventPropTypeInterface<VictoryAreaTTargetType, string | number>[];
51
+ // eslint-disable-next-line @typescript-eslint/ban-types
52
+ interpolation?: InterpolationPropType | Function;
53
+ samples?: number;
54
+ style?: VictoryStyleInterface;
55
+ }
56
+
57
+ // eslint-disable-next-line @typescript-eslint/no-empty-interface
58
+ interface VictoryAreaBase extends EventsMixinClass<VictoryAreaProps> {}
59
+
60
+ /**
61
+ * Draw area charts with React. VictoryArea is a composable component, so it doesn't include axes.
62
+ * Add VictoryArea as a child of VictoryChart for a complete chart.
63
+ */
64
+ class VictoryAreaBase extends React.Component<VictoryAreaProps> {
36
65
  static animationWhitelist = [
37
66
  "data",
38
67
  "domain",
39
68
  "height",
40
69
  "padding",
41
70
  "style",
42
- "width"
71
+ "width",
43
72
  ];
44
73
 
45
74
  static propTypes = {
@@ -56,14 +85,14 @@ class VictoryArea extends React.Component {
56
85
  "natural",
57
86
  "step",
58
87
  "stepAfter",
59
- "stepBefore"
88
+ "stepBefore",
60
89
  ]),
61
- PropTypes.func
90
+ PropTypes.func,
62
91
  ]),
63
92
  label: CustomPropTypes.deprecated(
64
93
  PropTypes.string,
65
- "Use `labels` instead for individual data labels"
66
- )
94
+ "Use `labels` instead for individual data labels",
95
+ ),
67
96
  };
68
97
 
69
98
  static defaultProps = {
@@ -75,7 +104,7 @@ class VictoryArea extends React.Component {
75
104
  sortKey: "x",
76
105
  sortOrder: "ascending",
77
106
  standalone: true,
78
- theme: VictoryTheme.grayscale
107
+ theme: VictoryTheme.grayscale,
79
108
  };
80
109
 
81
110
  static displayName = "VictoryArea";
@@ -91,7 +120,7 @@ class VictoryArea extends React.Component {
91
120
  "dataComponent",
92
121
  "labelComponent",
93
122
  "groupComponent",
94
- "containerComponent"
123
+ "containerComponent",
95
124
  ];
96
125
 
97
126
  // Overridden in native versions
@@ -100,7 +129,7 @@ class VictoryArea extends React.Component {
100
129
  }
101
130
 
102
131
  render() {
103
- const { animationWhitelist, role } = VictoryArea;
132
+ const { animationWhitelist, role } = VictoryAreaBase;
104
133
  const props = Helpers.modifyProps(this.props, fallbackProps, role);
105
134
 
106
135
  if (this.shouldAnimate()) {
@@ -116,4 +145,4 @@ class VictoryArea extends React.Component {
116
145
  }
117
146
  }
118
147
 
119
- export default addEvents(VictoryArea, options);
148
+ export const VictoryArea = addEvents(VictoryAreaBase, options);
package/src/index.d.ts DELETED
@@ -1,41 +0,0 @@
1
- import * as React from "react";
2
- import {
3
- EventPropTypeInterface,
4
- InterpolationPropType,
5
- StringOrNumberOrCallback,
6
- VictoryCommonProps,
7
- VictoryCommonPrimitiveProps,
8
- VictoryDatableProps,
9
- VictoryMultiLabelableProps,
10
- VictoryStyleInterface
11
- } from "victory-core";
12
-
13
- export type VictoryAreaTTargetType = "data" | "labels" | "parent";
14
-
15
- export interface VictoryAreaProps
16
- extends VictoryCommonProps,
17
- VictoryDatableProps,
18
- VictoryMultiLabelableProps {
19
- eventKey?: string[] | number[] | StringOrNumberOrCallback;
20
- events?: EventPropTypeInterface<VictoryAreaTTargetType, string | number>[];
21
- interpolation?: InterpolationPropType | Function;
22
- samples?: number;
23
- style?: VictoryStyleInterface;
24
- }
25
-
26
- /**
27
- * Draw area charts with React. VictoryArea is a composable component, so it doesn"t include axes.
28
- * Add VictoryArea as a child of VictoryChart for a complete chart.
29
- */
30
- export class VictoryArea extends React.Component<VictoryAreaProps, any> {}
31
-
32
- export interface AreaProps extends VictoryCommonPrimitiveProps {
33
- groupComponent?: React.ReactElement;
34
- interpolation?: string | Function;
35
- pathComponent?: React.ReactElement;
36
- }
37
-
38
- /**
39
- * The area primitive used by VictoryArea
40
- */
41
- export class Area extends React.Component<AreaProps, any> {}
package/src/index.js DELETED
@@ -1,2 +0,0 @@
1
- export { default as VictoryArea } from "./victory-area";
2
- export { default as Area } from "./area";