victory-area 37.3.1 → 37.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -0
- package/dist/victory-area.js +355 -323
- package/dist/victory-area.min.js +1 -1
- package/es/area.js +2 -2
- package/es/helper-methods.js +2 -2
- package/es/victory-area.d.ts +7 -7
- package/es/victory-area.js +1 -1
- package/lib/area.js +2 -2
- package/lib/helper-methods.js +2 -2
- package/lib/victory-area.d.ts +7 -7
- package/lib/victory-area.js +1 -1
- package/package.json +7 -39
- package/src/area.tsx +2 -2
- package/src/helper-methods.tsx +2 -2
- package/src/victory-area.tsx +2 -2
package/es/area.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import _defaults from "lodash/defaults";
|
|
2
1
|
/* eslint no-magic-numbers: ["error", { "ignore": [-1, 0, 1, 2] }]*/
|
|
3
2
|
import React from "react";
|
|
3
|
+
import defaults from "lodash/defaults";
|
|
4
4
|
import * as d3Shape from "victory-vendor/d3-shape";
|
|
5
5
|
import { Helpers, Path, UserProps, LineHelpers } from "victory-core";
|
|
6
6
|
const defined = d => {
|
|
@@ -73,7 +73,7 @@ const defaultProps = {
|
|
|
73
73
|
* The area primitive used by VictoryArea
|
|
74
74
|
*/
|
|
75
75
|
export const Area = initialProps => {
|
|
76
|
-
const props = evaluateProps(
|
|
76
|
+
const props = evaluateProps(defaults({}, initialProps, defaultProps));
|
|
77
77
|
const {
|
|
78
78
|
ariaLabel,
|
|
79
79
|
role,
|
package/es/helper-methods.js
CHANGED
|
@@ -10,9 +10,9 @@ export const getDataWithBaseline = (props, scale) => {
|
|
|
10
10
|
const minY = Collection.getMinValue(domain);
|
|
11
11
|
const maxY = Collection.getMaxValue(domain);
|
|
12
12
|
let defaultMin = defaultZero;
|
|
13
|
-
if (minY < 0 && maxY <= 0) {
|
|
13
|
+
if (minY.valueOf() < 0 && maxY.valueOf() <= 0) {
|
|
14
14
|
defaultMin = maxY;
|
|
15
|
-
} else if (minY >= 0 && maxY > 0) {
|
|
15
|
+
} else if (minY.valueOf() >= 0 && maxY.valueOf() > 0) {
|
|
16
16
|
defaultMin = minY;
|
|
17
17
|
}
|
|
18
18
|
return Collection.containsDates(domain) ? new Date(defaultMin) : defaultMin;
|
package/es/victory-area.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { Data, Domain, EventPropTypeInterface, InterpolationPropType, StringOrNumberOrCallback, VictoryCommonProps, VictoryDatableProps, VictoryMultiLabelableProps, VictoryStyleInterface, EventsMixinClass } from "victory-core";
|
|
3
|
-
export
|
|
3
|
+
export type VictoryAreaTTargetType = "data" | "labels" | "parent";
|
|
4
4
|
export interface VictoryAreaProps extends VictoryCommonProps, VictoryDatableProps, VictoryMultiLabelableProps {
|
|
5
5
|
eventKey?: string[] | number[] | StringOrNumberOrCallback;
|
|
6
6
|
events?: EventPropTypeInterface<VictoryAreaTTargetType, string | number>[];
|
|
@@ -54,9 +54,9 @@ export declare const VictoryArea: {
|
|
|
54
54
|
getAllEvents(props: any): any;
|
|
55
55
|
getComponentProps(component: React.ReactNode, type: string, index: string | number): any;
|
|
56
56
|
renderContainer(component: any, children: any): React.DetailedReactHTMLElement<any, HTMLElement>;
|
|
57
|
-
animateComponent(props: import("victory-core").EventMixinCommonProps, defaultAnimationWhitelist: string[]): React.ReactElement
|
|
57
|
+
animateComponent(props: import("victory-core").EventMixinCommonProps, defaultAnimationWhitelist: string[]): React.ReactElement;
|
|
58
58
|
renderContinuousData(props: import("victory-core").EventMixinCommonProps): React.DetailedReactHTMLElement<any, HTMLElement>;
|
|
59
|
-
renderData(props: any, shouldRenderDatum?: (
|
|
59
|
+
renderData(props: any, shouldRenderDatum?: (datum: any) => boolean): React.DetailedReactHTMLElement<any, HTMLElement>;
|
|
60
60
|
context: unknown;
|
|
61
61
|
setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<import("victory-core").EventMixinCommonProps>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
|
|
62
62
|
forceUpdate(callback?: (() => void) | undefined): void;
|
|
@@ -73,17 +73,17 @@ export declare const VictoryArea: {
|
|
|
73
73
|
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<import("victory-core").EventMixinCommonProps>, nextContext: any): void;
|
|
74
74
|
componentWillUpdate?(nextProps: Readonly<import("victory-core").EventMixinCommonProps>, nextState: Readonly<{}>, nextContext: any): void;
|
|
75
75
|
UNSAFE_componentWillUpdate?(nextProps: Readonly<import("victory-core").EventMixinCommonProps>, nextState: Readonly<{}>, nextContext: any): void;
|
|
76
|
-
componentEvents: import("victory-core/lib/victory-util/events").ComponentEvent
|
|
76
|
+
componentEvents: Array<import("@/victory-core/lib/victory-util/events").ComponentEvent>;
|
|
77
77
|
getSharedEventState: (key: string, value: string) => unknown;
|
|
78
78
|
baseProps: Record<string, object>;
|
|
79
79
|
dataKeys: string[];
|
|
80
80
|
hasEvents: unknown;
|
|
81
81
|
events: unknown;
|
|
82
82
|
};
|
|
83
|
-
getBaseProps?(props: import("victory-core").EventMixinCommonProps):
|
|
84
|
-
role?:
|
|
83
|
+
getBaseProps?(props: import("victory-core").EventMixinCommonProps): import("victory-core").EventMixinCalculatedValues["baseProps"];
|
|
84
|
+
role?: import("victory-core").VictoryComponentRole;
|
|
85
85
|
expectedComponents?: string[] | undefined;
|
|
86
|
-
getChildren?: ((props: import("victory-core").EventMixinCommonProps, childComponents?: React.ReactNode
|
|
86
|
+
getChildren?: ((props: import("victory-core").EventMixinCommonProps, childComponents?: Array<React.ReactNode>, calculatedProps?: import("victory-core").EventMixinCommonProps | undefined) => void) | undefined;
|
|
87
87
|
animationWhitelist?: string[] | undefined;
|
|
88
88
|
} & typeof VictoryAreaBase;
|
|
89
89
|
export {};
|
package/es/victory-area.js
CHANGED
|
@@ -20,7 +20,7 @@ const options = {
|
|
|
20
20
|
}]
|
|
21
21
|
};
|
|
22
22
|
|
|
23
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-
|
|
23
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
24
24
|
|
|
25
25
|
/**
|
|
26
26
|
* Draw area charts with React. VictoryArea is a composable component, so it doesn't include axes.
|
package/lib/area.js
CHANGED
|
@@ -4,8 +4,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.Area = void 0;
|
|
7
|
-
var _defaults2 = _interopRequireDefault(require("lodash/defaults"));
|
|
8
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _defaults = _interopRequireDefault(require("lodash/defaults"));
|
|
9
9
|
var d3Shape = _interopRequireWildcard(require("victory-vendor/d3-shape"));
|
|
10
10
|
var _victoryCore = require("victory-core");
|
|
11
11
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
@@ -83,7 +83,7 @@ const defaultProps = {
|
|
|
83
83
|
* The area primitive used by VictoryArea
|
|
84
84
|
*/
|
|
85
85
|
const Area = initialProps => {
|
|
86
|
-
const props = evaluateProps((0,
|
|
86
|
+
const props = evaluateProps((0, _defaults.default)({}, initialProps, defaultProps));
|
|
87
87
|
const {
|
|
88
88
|
ariaLabel,
|
|
89
89
|
role,
|
package/lib/helper-methods.js
CHANGED
|
@@ -16,9 +16,9 @@ const getDataWithBaseline = (props, scale) => {
|
|
|
16
16
|
const minY = _victoryCore.Collection.getMinValue(domain);
|
|
17
17
|
const maxY = _victoryCore.Collection.getMaxValue(domain);
|
|
18
18
|
let defaultMin = defaultZero;
|
|
19
|
-
if (minY < 0 && maxY <= 0) {
|
|
19
|
+
if (minY.valueOf() < 0 && maxY.valueOf() <= 0) {
|
|
20
20
|
defaultMin = maxY;
|
|
21
|
-
} else if (minY >= 0 && maxY > 0) {
|
|
21
|
+
} else if (minY.valueOf() >= 0 && maxY.valueOf() > 0) {
|
|
22
22
|
defaultMin = minY;
|
|
23
23
|
}
|
|
24
24
|
return _victoryCore.Collection.containsDates(domain) ? new Date(defaultMin) : defaultMin;
|
package/lib/victory-area.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { Data, Domain, EventPropTypeInterface, InterpolationPropType, StringOrNumberOrCallback, VictoryCommonProps, VictoryDatableProps, VictoryMultiLabelableProps, VictoryStyleInterface, EventsMixinClass } from "victory-core";
|
|
3
|
-
export
|
|
3
|
+
export type VictoryAreaTTargetType = "data" | "labels" | "parent";
|
|
4
4
|
export interface VictoryAreaProps extends VictoryCommonProps, VictoryDatableProps, VictoryMultiLabelableProps {
|
|
5
5
|
eventKey?: string[] | number[] | StringOrNumberOrCallback;
|
|
6
6
|
events?: EventPropTypeInterface<VictoryAreaTTargetType, string | number>[];
|
|
@@ -54,9 +54,9 @@ export declare const VictoryArea: {
|
|
|
54
54
|
getAllEvents(props: any): any;
|
|
55
55
|
getComponentProps(component: React.ReactNode, type: string, index: string | number): any;
|
|
56
56
|
renderContainer(component: any, children: any): React.DetailedReactHTMLElement<any, HTMLElement>;
|
|
57
|
-
animateComponent(props: import("victory-core").EventMixinCommonProps, defaultAnimationWhitelist: string[]): React.ReactElement
|
|
57
|
+
animateComponent(props: import("victory-core").EventMixinCommonProps, defaultAnimationWhitelist: string[]): React.ReactElement;
|
|
58
58
|
renderContinuousData(props: import("victory-core").EventMixinCommonProps): React.DetailedReactHTMLElement<any, HTMLElement>;
|
|
59
|
-
renderData(props: any, shouldRenderDatum?: (
|
|
59
|
+
renderData(props: any, shouldRenderDatum?: (datum: any) => boolean): React.DetailedReactHTMLElement<any, HTMLElement>;
|
|
60
60
|
context: unknown;
|
|
61
61
|
setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<import("victory-core").EventMixinCommonProps>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
|
|
62
62
|
forceUpdate(callback?: (() => void) | undefined): void;
|
|
@@ -73,17 +73,17 @@ export declare const VictoryArea: {
|
|
|
73
73
|
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<import("victory-core").EventMixinCommonProps>, nextContext: any): void;
|
|
74
74
|
componentWillUpdate?(nextProps: Readonly<import("victory-core").EventMixinCommonProps>, nextState: Readonly<{}>, nextContext: any): void;
|
|
75
75
|
UNSAFE_componentWillUpdate?(nextProps: Readonly<import("victory-core").EventMixinCommonProps>, nextState: Readonly<{}>, nextContext: any): void;
|
|
76
|
-
componentEvents: import("victory-core/lib/victory-util/events").ComponentEvent
|
|
76
|
+
componentEvents: Array<import("@/victory-core/lib/victory-util/events").ComponentEvent>;
|
|
77
77
|
getSharedEventState: (key: string, value: string) => unknown;
|
|
78
78
|
baseProps: Record<string, object>;
|
|
79
79
|
dataKeys: string[];
|
|
80
80
|
hasEvents: unknown;
|
|
81
81
|
events: unknown;
|
|
82
82
|
};
|
|
83
|
-
getBaseProps?(props: import("victory-core").EventMixinCommonProps):
|
|
84
|
-
role?:
|
|
83
|
+
getBaseProps?(props: import("victory-core").EventMixinCommonProps): import("victory-core").EventMixinCalculatedValues["baseProps"];
|
|
84
|
+
role?: import("victory-core").VictoryComponentRole;
|
|
85
85
|
expectedComponents?: string[] | undefined;
|
|
86
|
-
getChildren?: ((props: import("victory-core").EventMixinCommonProps, childComponents?: React.ReactNode
|
|
86
|
+
getChildren?: ((props: import("victory-core").EventMixinCommonProps, childComponents?: Array<React.ReactNode>, calculatedProps?: import("victory-core").EventMixinCommonProps | undefined) => void) | undefined;
|
|
87
87
|
animationWhitelist?: string[] | undefined;
|
|
88
88
|
} & typeof VictoryAreaBase;
|
|
89
89
|
export {};
|
package/lib/victory-area.js
CHANGED
|
@@ -27,7 +27,7 @@ const options = {
|
|
|
27
27
|
}]
|
|
28
28
|
};
|
|
29
29
|
|
|
30
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-
|
|
30
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
31
31
|
|
|
32
32
|
/**
|
|
33
33
|
* Draw area charts with React. VictoryArea is a composable component, so it doesn't include axes.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "victory-area",
|
|
3
|
-
"version": "37.3.
|
|
3
|
+
"version": "37.3.3",
|
|
4
4
|
"description": "Area Component for Victory",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"data visualization",
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
"license": "MIT",
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"lodash": "^4.17.19",
|
|
24
|
-
"victory-core": "37.3.
|
|
25
|
-
"victory-vendor": "37.3.
|
|
24
|
+
"victory-core": "37.3.3",
|
|
25
|
+
"victory-vendor": "37.3.3"
|
|
26
26
|
},
|
|
27
27
|
"peerDependencies": {
|
|
28
28
|
"react": ">=16.6.0"
|
|
@@ -190,38 +190,10 @@
|
|
|
190
190
|
"pnpm-lock.yaml"
|
|
191
191
|
]
|
|
192
192
|
},
|
|
193
|
-
"format": {
|
|
194
|
-
"command": "nps format:pkg",
|
|
195
|
-
"files": [
|
|
196
|
-
"src/**",
|
|
197
|
-
"*.json",
|
|
198
|
-
"../../.prettierignore",
|
|
199
|
-
"../../.prettierrc.json"
|
|
200
|
-
],
|
|
201
|
-
"output": [],
|
|
202
|
-
"packageLocks": [
|
|
203
|
-
"pnpm-lock.yaml"
|
|
204
|
-
]
|
|
205
|
-
},
|
|
206
|
-
"format:fix": {
|
|
207
|
-
"command": "pnpm run format || nps format:pkg:fix",
|
|
208
|
-
"files": [
|
|
209
|
-
"src/**",
|
|
210
|
-
"*.json",
|
|
211
|
-
"../../.prettierignore",
|
|
212
|
-
"../../.prettierrc.json"
|
|
213
|
-
],
|
|
214
|
-
"output": [],
|
|
215
|
-
"packageLocks": [
|
|
216
|
-
"pnpm-lock.yaml"
|
|
217
|
-
]
|
|
218
|
-
},
|
|
219
193
|
"lint": {
|
|
220
|
-
"command": "
|
|
194
|
+
"command": "eslint src",
|
|
221
195
|
"files": [
|
|
222
|
-
"src/**"
|
|
223
|
-
"../../.eslintignore",
|
|
224
|
-
"../../.eslintrc.js"
|
|
196
|
+
"src/**"
|
|
225
197
|
],
|
|
226
198
|
"output": [],
|
|
227
199
|
"dependencies": [
|
|
@@ -236,11 +208,9 @@
|
|
|
236
208
|
]
|
|
237
209
|
},
|
|
238
210
|
"lint:fix": {
|
|
239
|
-
"command": "
|
|
211
|
+
"command": "eslint --fix src",
|
|
240
212
|
"files": [
|
|
241
|
-
"src/**"
|
|
242
|
-
"../../.eslintignore",
|
|
243
|
-
"../../.eslintrc.js"
|
|
213
|
+
"src/**"
|
|
244
214
|
],
|
|
245
215
|
"output": [],
|
|
246
216
|
"dependencies": [
|
|
@@ -287,8 +257,6 @@
|
|
|
287
257
|
"check": "wireit",
|
|
288
258
|
"types:check": "wireit",
|
|
289
259
|
"types:create": "wireit",
|
|
290
|
-
"format": "wireit",
|
|
291
|
-
"format:fix": "wireit",
|
|
292
260
|
"lint": "wireit",
|
|
293
261
|
"lint:fix": "wireit",
|
|
294
262
|
"jest": "wireit"
|
package/src/area.tsx
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* eslint no-magic-numbers: ["error", { "ignore": [-1, 0, 1, 2] }]*/
|
|
2
2
|
import React from "react";
|
|
3
|
-
import
|
|
3
|
+
import defaults from "lodash/defaults";
|
|
4
4
|
import * as d3Shape from "victory-vendor/d3-shape";
|
|
5
5
|
import {
|
|
6
6
|
Helpers,
|
|
@@ -178,7 +178,7 @@ export const Area: React.FC<AreaProps> = (initialProps) => {
|
|
|
178
178
|
export interface AreaProps extends VictoryCommonPrimitiveProps {
|
|
179
179
|
horizontal?: VictoryCommonThemeProps["horizontal"];
|
|
180
180
|
groupComponent?: React.ReactElement;
|
|
181
|
-
// eslint-disable-next-line @typescript-eslint/
|
|
181
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
|
|
182
182
|
interpolation?: string | Function;
|
|
183
183
|
pathComponent?: React.ReactElement;
|
|
184
184
|
}
|
package/src/helper-methods.tsx
CHANGED
|
@@ -19,9 +19,9 @@ export const getDataWithBaseline = (props, scale) => {
|
|
|
19
19
|
const minY = Collection.getMinValue(domain);
|
|
20
20
|
const maxY = Collection.getMaxValue(domain);
|
|
21
21
|
let defaultMin: typeof minY = defaultZero;
|
|
22
|
-
if (minY < 0 && maxY <= 0) {
|
|
22
|
+
if (minY.valueOf() < 0 && maxY.valueOf() <= 0) {
|
|
23
23
|
defaultMin = maxY;
|
|
24
|
-
} else if (minY >= 0 && maxY > 0) {
|
|
24
|
+
} else if (minY.valueOf() >= 0 && maxY.valueOf() > 0) {
|
|
25
25
|
defaultMin = minY;
|
|
26
26
|
}
|
|
27
27
|
return Collection.containsDates(domain) ? new Date(defaultMin) : defaultMin;
|
package/src/victory-area.tsx
CHANGED
|
@@ -45,12 +45,12 @@ export interface VictoryAreaProps
|
|
|
45
45
|
VictoryMultiLabelableProps {
|
|
46
46
|
eventKey?: string[] | number[] | StringOrNumberOrCallback;
|
|
47
47
|
events?: EventPropTypeInterface<VictoryAreaTTargetType, string | number>[];
|
|
48
|
-
// eslint-disable-next-line @typescript-eslint/
|
|
48
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
|
|
49
49
|
interpolation?: InterpolationPropType | Function;
|
|
50
50
|
style?: VictoryStyleInterface;
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-
|
|
53
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
54
54
|
interface VictoryAreaBase extends EventsMixinClass<VictoryAreaProps> {}
|
|
55
55
|
|
|
56
56
|
/**
|