victory-area 37.3.2 → 37.3.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.
- package/CHANGELOG.md +10 -0
- package/dist/victory-area.js +342 -290
- 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/lib/area.js +2 -2
- package/lib/helper-methods.js +2 -2
- package/lib/victory-area.d.ts +7 -7
- package/package.json +3 -31
- package/src/area.tsx +1 -1
- package/src/helper-methods.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/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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "victory-area",
|
|
3
|
-
"version": "37.3.
|
|
3
|
+
"version": "37.3.4",
|
|
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.4",
|
|
25
|
+
"victory-vendor": "37.3.4"
|
|
26
26
|
},
|
|
27
27
|
"peerDependencies": {
|
|
28
28
|
"react": ">=16.6.0"
|
|
@@ -190,32 +190,6 @@
|
|
|
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
194
|
"command": "eslint src",
|
|
221
195
|
"files": [
|
|
@@ -283,8 +257,6 @@
|
|
|
283
257
|
"check": "wireit",
|
|
284
258
|
"types:check": "wireit",
|
|
285
259
|
"types:create": "wireit",
|
|
286
|
-
"format": "wireit",
|
|
287
|
-
"format:fix": "wireit",
|
|
288
260
|
"lint": "wireit",
|
|
289
261
|
"lint:fix": "wireit",
|
|
290
262
|
"jest": "wireit"
|
package/src/area.tsx
CHANGED
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;
|