victory-stack 36.8.3 → 36.8.5-next.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.
- package/CHANGELOG.md +12 -0
- package/dist/victory-stack.js +409 -630
- package/dist/victory-stack.min.js +1 -1
- package/es/helper-methods.d.ts +52 -52
- package/es/helper-methods.js +4 -5
- package/es/index.d.ts +1 -1
- package/es/victory-stack.d.ts +75 -75
- package/es/victory-stack.js +1 -3
- package/lib/helper-methods.d.ts +52 -52
- package/lib/helper-methods.js +4 -6
- package/lib/index.d.ts +1 -1
- package/lib/victory-stack.d.ts +75 -75
- package/lib/victory-stack.js +1 -3
- package/package.json +7 -7
- package/src/helper-methods.tsx +5 -5
- package/src/victory-stack.tsx +2 -2
package/es/helper-methods.d.ts
CHANGED
|
@@ -1,53 +1,53 @@
|
|
|
1
|
-
export declare function getCalculatedProps(initialProps: any, childComponents: any): {
|
|
2
|
-
datasets: any;
|
|
3
|
-
categories: any;
|
|
4
|
-
range: any;
|
|
5
|
-
domain: {
|
|
6
|
-
x: any;
|
|
7
|
-
y: any;
|
|
8
|
-
};
|
|
9
|
-
horizontal: any;
|
|
10
|
-
scale: {
|
|
11
|
-
x: import("victory-core").D3Scale<any>;
|
|
12
|
-
y: import("victory-core").D3Scale<any>;
|
|
13
|
-
};
|
|
14
|
-
style: any;
|
|
15
|
-
colorScale: any;
|
|
16
|
-
role: string;
|
|
17
|
-
};
|
|
18
|
-
export declare function useMemoizedProps(initialProps: any): {
|
|
19
|
-
datasets: any;
|
|
20
|
-
categories: any;
|
|
21
|
-
range: any;
|
|
22
|
-
domain: {
|
|
23
|
-
x: any;
|
|
24
|
-
y: any;
|
|
25
|
-
};
|
|
26
|
-
horizontal: any;
|
|
27
|
-
scale: {
|
|
28
|
-
x: import("victory-core").D3Scale<any>;
|
|
29
|
-
y: import("victory-core").D3Scale<any>;
|
|
30
|
-
};
|
|
31
|
-
style: any;
|
|
32
|
-
colorScale: any;
|
|
33
|
-
role: string;
|
|
34
|
-
};
|
|
35
|
-
export declare function getChildProps(props: any, calculatedProps: any): {
|
|
36
|
-
height: any;
|
|
37
|
-
width: any;
|
|
38
|
-
padding: {
|
|
39
|
-
top: any;
|
|
40
|
-
bottom: any;
|
|
41
|
-
left: any;
|
|
42
|
-
right: any;
|
|
43
|
-
};
|
|
44
|
-
standalone: boolean;
|
|
45
|
-
theme: any;
|
|
46
|
-
categories: any;
|
|
47
|
-
domain: any;
|
|
48
|
-
range: any;
|
|
49
|
-
scale: any;
|
|
50
|
-
horizontal: any;
|
|
51
|
-
};
|
|
52
|
-
export declare function getChildren(initialProps: any, childComponents: any, calculatedProps: any): any;
|
|
1
|
+
export declare function getCalculatedProps(initialProps: any, childComponents: any): {
|
|
2
|
+
datasets: any;
|
|
3
|
+
categories: any;
|
|
4
|
+
range: any;
|
|
5
|
+
domain: {
|
|
6
|
+
x: any;
|
|
7
|
+
y: any;
|
|
8
|
+
};
|
|
9
|
+
horizontal: any;
|
|
10
|
+
scale: {
|
|
11
|
+
x: import("victory-core").D3Scale<any>;
|
|
12
|
+
y: import("victory-core").D3Scale<any>;
|
|
13
|
+
};
|
|
14
|
+
style: any;
|
|
15
|
+
colorScale: any;
|
|
16
|
+
role: string;
|
|
17
|
+
};
|
|
18
|
+
export declare function useMemoizedProps(initialProps: any): {
|
|
19
|
+
datasets: any;
|
|
20
|
+
categories: any;
|
|
21
|
+
range: any;
|
|
22
|
+
domain: {
|
|
23
|
+
x: any;
|
|
24
|
+
y: any;
|
|
25
|
+
};
|
|
26
|
+
horizontal: any;
|
|
27
|
+
scale: {
|
|
28
|
+
x: import("victory-core").D3Scale<any>;
|
|
29
|
+
y: import("victory-core").D3Scale<any>;
|
|
30
|
+
};
|
|
31
|
+
style: any;
|
|
32
|
+
colorScale: any;
|
|
33
|
+
role: string;
|
|
34
|
+
};
|
|
35
|
+
export declare function getChildProps(props: any, calculatedProps: any): {
|
|
36
|
+
height: any;
|
|
37
|
+
width: any;
|
|
38
|
+
padding: {
|
|
39
|
+
top: any;
|
|
40
|
+
bottom: any;
|
|
41
|
+
left: any;
|
|
42
|
+
right: any;
|
|
43
|
+
};
|
|
44
|
+
standalone: boolean;
|
|
45
|
+
theme: any;
|
|
46
|
+
categories: any;
|
|
47
|
+
domain: any;
|
|
48
|
+
range: any;
|
|
49
|
+
scale: any;
|
|
50
|
+
horizontal: any;
|
|
51
|
+
};
|
|
52
|
+
export declare function getChildren(initialProps: any, childComponents: any, calculatedProps: any): any;
|
|
53
53
|
//# sourceMappingURL=helper-methods.d.ts.map
|
package/es/helper-methods.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import _orderBy from "lodash/orderBy";
|
|
2
2
|
import _keys from "lodash/keys";
|
|
3
|
-
import _assign from "lodash/assign";
|
|
4
3
|
|
|
5
4
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
6
5
|
|
|
@@ -117,7 +116,7 @@ function addLayoutData(props, datasets, index) {
|
|
|
117
116
|
var xOffset = props.xOffset || 0;
|
|
118
117
|
return datasets[index].map(function (datum) {
|
|
119
118
|
var yOffset = getY0(datum, index, datasets) || 0;
|
|
120
|
-
return
|
|
119
|
+
return Object.assign({}, datum, {
|
|
121
120
|
_y0: !(datum._y instanceof Date) ? yOffset : yOffset ? new Date(yOffset) : datum._y,
|
|
122
121
|
_y1: datum._y === null ? null : datum._y instanceof Date ? new Date(Number(datum._y) + Number(yOffset)) : datum._y + yOffset,
|
|
123
122
|
_x1: datum._x === null ? null : datum._x instanceof Date ? new Date(Number(datum._x) + Number(xOffset)) : datum._x + xOffset
|
|
@@ -153,10 +152,10 @@ export function getCalculatedProps(initialProps, childComponents) {
|
|
|
153
152
|
});
|
|
154
153
|
});
|
|
155
154
|
var domain = {
|
|
156
|
-
x: Wrapper.getDomain(
|
|
155
|
+
x: Wrapper.getDomain(Object.assign({}, props, {
|
|
157
156
|
categories: categories
|
|
158
157
|
}), "x", clonedChildren),
|
|
159
|
-
y: Wrapper.getDomain(
|
|
158
|
+
y: Wrapper.getDomain(Object.assign({}, props, {
|
|
160
159
|
categories: categories
|
|
161
160
|
}), "y", clonedChildren)
|
|
162
161
|
};
|
|
@@ -272,7 +271,7 @@ export function getChildren(initialProps, childComponents, calculatedProps) {
|
|
|
272
271
|
var style = Wrapper.getChildStyle(child, index, newCalculatedProps);
|
|
273
272
|
var labels = props.labels ? getLabels(props, datasets, index) : child.props.labels;
|
|
274
273
|
var name = child.props.name || "".concat(parentName, "-").concat(role, "-").concat(index);
|
|
275
|
-
return /*#__PURE__*/React.cloneElement(child,
|
|
274
|
+
return /*#__PURE__*/React.cloneElement(child, Object.assign({
|
|
276
275
|
key: "".concat(name, "-key-").concat(index),
|
|
277
276
|
labels: labels,
|
|
278
277
|
name: name,
|
package/es/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from "./victory-stack";
|
|
1
|
+
export * from "./victory-stack";
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
package/es/victory-stack.d.ts
CHANGED
|
@@ -1,76 +1,76 @@
|
|
|
1
|
-
import PropTypes from "prop-types";
|
|
2
|
-
import React from "react";
|
|
3
|
-
import { CategoryPropType, ColorScalePropType, DomainPropType, EventPropTypeInterface, StringOrNumberOrCallback, VictoryCommonProps, VictoryLabelableProps, VictoryMultiLabelableProps, VictoryStyleInterface, VictoryComponentConfiguration } from "victory-core";
|
|
4
|
-
export declare type VictoryStackTTargetType = "data" | "labels" | "parent";
|
|
5
|
-
export interface VictoryStackProps extends VictoryCommonProps, VictoryLabelableProps, VictoryMultiLabelableProps {
|
|
6
|
-
bins?: number | number[] | Date[];
|
|
7
|
-
categories?: CategoryPropType;
|
|
8
|
-
children?: React.ReactNode | React.ReactNode[];
|
|
9
|
-
colorScale?: ColorScalePropType;
|
|
10
|
-
domain?: DomainPropType;
|
|
11
|
-
events?: EventPropTypeInterface<VictoryStackTTargetType, StringOrNumberOrCallback>[];
|
|
12
|
-
eventKey?: StringOrNumberOrCallback;
|
|
13
|
-
fillInMissingData?: boolean;
|
|
14
|
-
style?: VictoryStyleInterface;
|
|
15
|
-
xOffset?: number;
|
|
16
|
-
}
|
|
17
|
-
export declare const VictoryStack: React.NamedExoticComponent<VictoryStackProps> & {
|
|
18
|
-
readonly type: {
|
|
19
|
-
(initialProps: VictoryStackProps): JSX.Element;
|
|
20
|
-
propTypes: {
|
|
21
|
-
bins: PropTypes.Requireable<number | (number | Date | null | undefined)[]>;
|
|
22
|
-
categories: PropTypes.Requireable<(string | null | undefined)[] | PropTypes.InferProps<{
|
|
23
|
-
x: PropTypes.Requireable<(string | null | undefined)[]>;
|
|
24
|
-
y: PropTypes.Requireable<(string | null | undefined)[]>;
|
|
25
|
-
}>>;
|
|
26
|
-
children: PropTypes.Requireable<string | number | boolean | PropTypes.ReactElementLike | PropTypes.ReactNodeArray>;
|
|
27
|
-
colorScale: PropTypes.Requireable<string | (string | null | undefined)[]>;
|
|
28
|
-
fillInMissingData: PropTypes.Requireable<boolean>;
|
|
29
|
-
horizontal: PropTypes.Requireable<boolean>;
|
|
30
|
-
labelComponent: PropTypes.Requireable<PropTypes.ReactElementLike>;
|
|
31
|
-
labels: PropTypes.Requireable<any[] | ((...args: any[]) => any)>;
|
|
32
|
-
style: PropTypes.Requireable<PropTypes.InferProps<{
|
|
33
|
-
parent: PropTypes.Requireable<object>;
|
|
34
|
-
data: PropTypes.Requireable<object>;
|
|
35
|
-
labels: PropTypes.Requireable<object>;
|
|
36
|
-
}>>;
|
|
37
|
-
xOffset: PropTypes.Requireable<number>;
|
|
38
|
-
theme?: React.Validator<import("victory-core").VictoryThemeDefinition | null | undefined> | undefined;
|
|
39
|
-
animate?: React.Validator<boolean | import("victory-core").AnimatePropTypeInterface | null | undefined> | undefined;
|
|
40
|
-
containerComponent?: React.Validator<React.ReactElement<any, string | React.JSXElementConstructor<any>> | null | undefined> | undefined;
|
|
41
|
-
disableInlineStyles?: React.Validator<boolean | null | undefined> | undefined;
|
|
42
|
-
domainPadding?: React.Validator<import("victory-core").ForAxes<import("victory-core").PaddingType> | null | undefined> | undefined;
|
|
43
|
-
externalEventMutations?: React.Validator<import("victory-core").EventCallbackInterface<string | string[], import("victory-core").StringOrNumberOrList>[] | null | undefined> | undefined;
|
|
44
|
-
groupComponent?: React.Validator<React.ReactElement<any, string | React.JSXElementConstructor<any>> | null | undefined> | undefined;
|
|
45
|
-
height?: React.Validator<number | null | undefined> | undefined;
|
|
46
|
-
maxDomain?: React.Validator<number | {
|
|
47
|
-
x?: number | undefined;
|
|
48
|
-
y?: number | undefined;
|
|
49
|
-
} | null | undefined> | undefined;
|
|
50
|
-
minDomain?: React.Validator<number | {
|
|
51
|
-
x?: number | undefined;
|
|
52
|
-
y?: number | undefined;
|
|
53
|
-
} | null | undefined> | undefined;
|
|
54
|
-
name?: React.Validator<string | null | undefined> | undefined;
|
|
55
|
-
origin?: React.Validator<import("victory-core").OriginType | null | undefined> | undefined;
|
|
56
|
-
padding?: React.Validator<import("victory-core").PaddingProps | null | undefined> | undefined;
|
|
57
|
-
polar?: React.Validator<boolean | null | undefined> | undefined;
|
|
58
|
-
range?: React.Validator<import("victory-core").ForAxes<import("victory-core").RangeTuple> | null | undefined> | undefined;
|
|
59
|
-
scale?: React.Validator<import("victory-core").D3Scale<any> | import("victory-core").ScaleName | {
|
|
60
|
-
x?: import("victory-core").D3Scale<any> | import("victory-core").ScaleName | undefined;
|
|
61
|
-
y?: import("victory-core").D3Scale<any> | import("victory-core").ScaleName | undefined;
|
|
62
|
-
} | null | undefined> | undefined;
|
|
63
|
-
sharedEvents?: React.Validator<{
|
|
64
|
-
events: any[];
|
|
65
|
-
getEventState: Function;
|
|
66
|
-
} | null | undefined> | undefined;
|
|
67
|
-
singleQuadrantDomainPadding?: React.Validator<boolean | {
|
|
68
|
-
x?: boolean | undefined;
|
|
69
|
-
y?: boolean | undefined;
|
|
70
|
-
} | null | undefined> | undefined;
|
|
71
|
-
standalone?: React.Validator<boolean | null | undefined> | undefined;
|
|
72
|
-
width?: React.Validator<number | null | undefined> | undefined;
|
|
73
|
-
};
|
|
74
|
-
};
|
|
75
|
-
} & VictoryComponentConfiguration<VictoryStackProps>;
|
|
1
|
+
import PropTypes from "prop-types";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { CategoryPropType, ColorScalePropType, DomainPropType, EventPropTypeInterface, StringOrNumberOrCallback, VictoryCommonProps, VictoryLabelableProps, VictoryMultiLabelableProps, VictoryStyleInterface, VictoryComponentConfiguration } from "victory-core";
|
|
4
|
+
export declare type VictoryStackTTargetType = "data" | "labels" | "parent";
|
|
5
|
+
export interface VictoryStackProps extends VictoryCommonProps, VictoryLabelableProps, VictoryMultiLabelableProps {
|
|
6
|
+
bins?: number | number[] | Date[];
|
|
7
|
+
categories?: CategoryPropType;
|
|
8
|
+
children?: React.ReactNode | React.ReactNode[];
|
|
9
|
+
colorScale?: ColorScalePropType;
|
|
10
|
+
domain?: DomainPropType;
|
|
11
|
+
events?: EventPropTypeInterface<VictoryStackTTargetType, StringOrNumberOrCallback>[];
|
|
12
|
+
eventKey?: StringOrNumberOrCallback;
|
|
13
|
+
fillInMissingData?: boolean;
|
|
14
|
+
style?: VictoryStyleInterface;
|
|
15
|
+
xOffset?: number;
|
|
16
|
+
}
|
|
17
|
+
export declare const VictoryStack: React.NamedExoticComponent<VictoryStackProps> & {
|
|
18
|
+
readonly type: {
|
|
19
|
+
(initialProps: VictoryStackProps): JSX.Element;
|
|
20
|
+
propTypes: {
|
|
21
|
+
bins: PropTypes.Requireable<number | (number | Date | null | undefined)[]>;
|
|
22
|
+
categories: PropTypes.Requireable<(string | null | undefined)[] | PropTypes.InferProps<{
|
|
23
|
+
x: PropTypes.Requireable<(string | null | undefined)[]>;
|
|
24
|
+
y: PropTypes.Requireable<(string | null | undefined)[]>;
|
|
25
|
+
}>>;
|
|
26
|
+
children: PropTypes.Requireable<string | number | boolean | PropTypes.ReactElementLike | PropTypes.ReactNodeArray>;
|
|
27
|
+
colorScale: PropTypes.Requireable<string | (string | null | undefined)[]>;
|
|
28
|
+
fillInMissingData: PropTypes.Requireable<boolean>;
|
|
29
|
+
horizontal: PropTypes.Requireable<boolean>;
|
|
30
|
+
labelComponent: PropTypes.Requireable<PropTypes.ReactElementLike>;
|
|
31
|
+
labels: PropTypes.Requireable<any[] | ((...args: any[]) => any)>;
|
|
32
|
+
style: PropTypes.Requireable<PropTypes.InferProps<{
|
|
33
|
+
parent: PropTypes.Requireable<object>;
|
|
34
|
+
data: PropTypes.Requireable<object>;
|
|
35
|
+
labels: PropTypes.Requireable<object>;
|
|
36
|
+
}>>;
|
|
37
|
+
xOffset: PropTypes.Requireable<number>;
|
|
38
|
+
theme?: React.Validator<import("victory-core").VictoryThemeDefinition | null | undefined> | undefined;
|
|
39
|
+
animate?: React.Validator<boolean | import("victory-core").AnimatePropTypeInterface | null | undefined> | undefined;
|
|
40
|
+
containerComponent?: React.Validator<React.ReactElement<any, string | React.JSXElementConstructor<any>> | null | undefined> | undefined;
|
|
41
|
+
disableInlineStyles?: React.Validator<boolean | null | undefined> | undefined;
|
|
42
|
+
domainPadding?: React.Validator<import("victory-core").ForAxes<import("victory-core").PaddingType> | null | undefined> | undefined;
|
|
43
|
+
externalEventMutations?: React.Validator<import("victory-core").EventCallbackInterface<string | string[], import("victory-core").StringOrNumberOrList>[] | null | undefined> | undefined;
|
|
44
|
+
groupComponent?: React.Validator<React.ReactElement<any, string | React.JSXElementConstructor<any>> | null | undefined> | undefined;
|
|
45
|
+
height?: React.Validator<number | null | undefined> | undefined;
|
|
46
|
+
maxDomain?: React.Validator<number | {
|
|
47
|
+
x?: number | undefined;
|
|
48
|
+
y?: number | undefined;
|
|
49
|
+
} | null | undefined> | undefined;
|
|
50
|
+
minDomain?: React.Validator<number | {
|
|
51
|
+
x?: number | undefined;
|
|
52
|
+
y?: number | undefined;
|
|
53
|
+
} | null | undefined> | undefined;
|
|
54
|
+
name?: React.Validator<string | null | undefined> | undefined;
|
|
55
|
+
origin?: React.Validator<import("victory-core").OriginType | null | undefined> | undefined;
|
|
56
|
+
padding?: React.Validator<import("victory-core").PaddingProps | null | undefined> | undefined;
|
|
57
|
+
polar?: React.Validator<boolean | null | undefined> | undefined;
|
|
58
|
+
range?: React.Validator<import("victory-core").ForAxes<import("victory-core").RangeTuple> | null | undefined> | undefined;
|
|
59
|
+
scale?: React.Validator<import("victory-core").D3Scale<any> | import("victory-core").ScaleName | {
|
|
60
|
+
x?: import("victory-core").D3Scale<any> | import("victory-core").ScaleName | undefined;
|
|
61
|
+
y?: import("victory-core").D3Scale<any> | import("victory-core").ScaleName | undefined;
|
|
62
|
+
} | null | undefined> | undefined;
|
|
63
|
+
sharedEvents?: React.Validator<{
|
|
64
|
+
events: any[];
|
|
65
|
+
getEventState: Function;
|
|
66
|
+
} | null | undefined> | undefined;
|
|
67
|
+
singleQuadrantDomainPadding?: React.Validator<boolean | {
|
|
68
|
+
x?: boolean | undefined;
|
|
69
|
+
y?: boolean | undefined;
|
|
70
|
+
} | null | undefined> | undefined;
|
|
71
|
+
standalone?: React.Validator<boolean | null | undefined> | undefined;
|
|
72
|
+
width?: React.Validator<number | null | undefined> | undefined;
|
|
73
|
+
};
|
|
74
|
+
};
|
|
75
|
+
} & VictoryComponentConfiguration<VictoryStackProps>;
|
|
76
76
|
//# sourceMappingURL=victory-stack.d.ts.map
|
package/es/victory-stack.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import _isEmpty from "lodash/isEmpty";
|
|
2
2
|
import _defaults from "lodash/defaults";
|
|
3
|
-
import _assign from "lodash/assign";
|
|
4
3
|
|
|
5
4
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
6
5
|
|
|
@@ -59,10 +58,9 @@ var VictoryStackBase = function (initialProps) {
|
|
|
59
58
|
var newChildren = React.useMemo(function () {
|
|
60
59
|
var children = getChildren(props, childComponents, calculatedProps);
|
|
61
60
|
var orderedChildren = children.map(function (child, index) {
|
|
62
|
-
var childProps =
|
|
61
|
+
var childProps = Object.assign({
|
|
63
62
|
animate: getAnimationProps(props, child, index)
|
|
64
63
|
}, child.props);
|
|
65
|
-
|
|
66
64
|
return /*#__PURE__*/React.cloneElement(child, childProps);
|
|
67
65
|
});
|
|
68
66
|
/*
|
package/lib/helper-methods.d.ts
CHANGED
|
@@ -1,53 +1,53 @@
|
|
|
1
|
-
export declare function getCalculatedProps(initialProps: any, childComponents: any): {
|
|
2
|
-
datasets: any;
|
|
3
|
-
categories: any;
|
|
4
|
-
range: any;
|
|
5
|
-
domain: {
|
|
6
|
-
x: any;
|
|
7
|
-
y: any;
|
|
8
|
-
};
|
|
9
|
-
horizontal: any;
|
|
10
|
-
scale: {
|
|
11
|
-
x: import("victory-core").D3Scale<any>;
|
|
12
|
-
y: import("victory-core").D3Scale<any>;
|
|
13
|
-
};
|
|
14
|
-
style: any;
|
|
15
|
-
colorScale: any;
|
|
16
|
-
role: string;
|
|
17
|
-
};
|
|
18
|
-
export declare function useMemoizedProps(initialProps: any): {
|
|
19
|
-
datasets: any;
|
|
20
|
-
categories: any;
|
|
21
|
-
range: any;
|
|
22
|
-
domain: {
|
|
23
|
-
x: any;
|
|
24
|
-
y: any;
|
|
25
|
-
};
|
|
26
|
-
horizontal: any;
|
|
27
|
-
scale: {
|
|
28
|
-
x: import("victory-core").D3Scale<any>;
|
|
29
|
-
y: import("victory-core").D3Scale<any>;
|
|
30
|
-
};
|
|
31
|
-
style: any;
|
|
32
|
-
colorScale: any;
|
|
33
|
-
role: string;
|
|
34
|
-
};
|
|
35
|
-
export declare function getChildProps(props: any, calculatedProps: any): {
|
|
36
|
-
height: any;
|
|
37
|
-
width: any;
|
|
38
|
-
padding: {
|
|
39
|
-
top: any;
|
|
40
|
-
bottom: any;
|
|
41
|
-
left: any;
|
|
42
|
-
right: any;
|
|
43
|
-
};
|
|
44
|
-
standalone: boolean;
|
|
45
|
-
theme: any;
|
|
46
|
-
categories: any;
|
|
47
|
-
domain: any;
|
|
48
|
-
range: any;
|
|
49
|
-
scale: any;
|
|
50
|
-
horizontal: any;
|
|
51
|
-
};
|
|
52
|
-
export declare function getChildren(initialProps: any, childComponents: any, calculatedProps: any): any;
|
|
1
|
+
export declare function getCalculatedProps(initialProps: any, childComponents: any): {
|
|
2
|
+
datasets: any;
|
|
3
|
+
categories: any;
|
|
4
|
+
range: any;
|
|
5
|
+
domain: {
|
|
6
|
+
x: any;
|
|
7
|
+
y: any;
|
|
8
|
+
};
|
|
9
|
+
horizontal: any;
|
|
10
|
+
scale: {
|
|
11
|
+
x: import("victory-core").D3Scale<any>;
|
|
12
|
+
y: import("victory-core").D3Scale<any>;
|
|
13
|
+
};
|
|
14
|
+
style: any;
|
|
15
|
+
colorScale: any;
|
|
16
|
+
role: string;
|
|
17
|
+
};
|
|
18
|
+
export declare function useMemoizedProps(initialProps: any): {
|
|
19
|
+
datasets: any;
|
|
20
|
+
categories: any;
|
|
21
|
+
range: any;
|
|
22
|
+
domain: {
|
|
23
|
+
x: any;
|
|
24
|
+
y: any;
|
|
25
|
+
};
|
|
26
|
+
horizontal: any;
|
|
27
|
+
scale: {
|
|
28
|
+
x: import("victory-core").D3Scale<any>;
|
|
29
|
+
y: import("victory-core").D3Scale<any>;
|
|
30
|
+
};
|
|
31
|
+
style: any;
|
|
32
|
+
colorScale: any;
|
|
33
|
+
role: string;
|
|
34
|
+
};
|
|
35
|
+
export declare function getChildProps(props: any, calculatedProps: any): {
|
|
36
|
+
height: any;
|
|
37
|
+
width: any;
|
|
38
|
+
padding: {
|
|
39
|
+
top: any;
|
|
40
|
+
bottom: any;
|
|
41
|
+
left: any;
|
|
42
|
+
right: any;
|
|
43
|
+
};
|
|
44
|
+
standalone: boolean;
|
|
45
|
+
theme: any;
|
|
46
|
+
categories: any;
|
|
47
|
+
domain: any;
|
|
48
|
+
range: any;
|
|
49
|
+
scale: any;
|
|
50
|
+
horizontal: any;
|
|
51
|
+
};
|
|
52
|
+
export declare function getChildren(initialProps: any, childComponents: any, calculatedProps: any): any;
|
|
53
53
|
//# sourceMappingURL=helper-methods.d.ts.map
|
package/lib/helper-methods.js
CHANGED
|
@@ -12,8 +12,6 @@ var _orderBy2 = _interopRequireDefault(require("lodash/orderBy"));
|
|
|
12
12
|
|
|
13
13
|
var _keys2 = _interopRequireDefault(require("lodash/keys"));
|
|
14
14
|
|
|
15
|
-
var _assign2 = _interopRequireDefault(require("lodash/assign"));
|
|
16
|
-
|
|
17
15
|
var _react = _interopRequireDefault(require("react"));
|
|
18
16
|
|
|
19
17
|
var _victoryCore = require("victory-core");
|
|
@@ -131,7 +129,7 @@ function addLayoutData(props, datasets, index) {
|
|
|
131
129
|
var xOffset = props.xOffset || 0;
|
|
132
130
|
return datasets[index].map(function (datum) {
|
|
133
131
|
var yOffset = getY0(datum, index, datasets) || 0;
|
|
134
|
-
return
|
|
132
|
+
return Object.assign({}, datum, {
|
|
135
133
|
_y0: !(datum._y instanceof Date) ? yOffset : yOffset ? new Date(yOffset) : datum._y,
|
|
136
134
|
_y1: datum._y === null ? null : datum._y instanceof Date ? new Date(Number(datum._y) + Number(yOffset)) : datum._y + yOffset,
|
|
137
135
|
_x1: datum._x === null ? null : datum._x instanceof Date ? new Date(Number(datum._x) + Number(xOffset)) : datum._x + xOffset
|
|
@@ -173,10 +171,10 @@ function getCalculatedProps(initialProps, childComponents) {
|
|
|
173
171
|
});
|
|
174
172
|
});
|
|
175
173
|
var domain = {
|
|
176
|
-
x: _victoryCore.Wrapper.getDomain(
|
|
174
|
+
x: _victoryCore.Wrapper.getDomain(Object.assign({}, props, {
|
|
177
175
|
categories: categories
|
|
178
176
|
}), "x", clonedChildren),
|
|
179
|
-
y: _victoryCore.Wrapper.getDomain(
|
|
177
|
+
y: _victoryCore.Wrapper.getDomain(Object.assign({}, props, {
|
|
180
178
|
categories: categories
|
|
181
179
|
}), "y", clonedChildren)
|
|
182
180
|
};
|
|
@@ -300,7 +298,7 @@ function getChildren(initialProps, childComponents, calculatedProps) {
|
|
|
300
298
|
|
|
301
299
|
var labels = props.labels ? getLabels(props, datasets, index) : child.props.labels;
|
|
302
300
|
var name = child.props.name || "".concat(parentName, "-").concat(role, "-").concat(index);
|
|
303
|
-
return /*#__PURE__*/_react.default.cloneElement(child,
|
|
301
|
+
return /*#__PURE__*/_react.default.cloneElement(child, Object.assign({
|
|
304
302
|
key: "".concat(name, "-key-").concat(index),
|
|
305
303
|
labels: labels,
|
|
306
304
|
name: name,
|
package/lib/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from "./victory-stack";
|
|
1
|
+
export * from "./victory-stack";
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
package/lib/victory-stack.d.ts
CHANGED
|
@@ -1,76 +1,76 @@
|
|
|
1
|
-
import PropTypes from "prop-types";
|
|
2
|
-
import React from "react";
|
|
3
|
-
import { CategoryPropType, ColorScalePropType, DomainPropType, EventPropTypeInterface, StringOrNumberOrCallback, VictoryCommonProps, VictoryLabelableProps, VictoryMultiLabelableProps, VictoryStyleInterface, VictoryComponentConfiguration } from "victory-core";
|
|
4
|
-
export declare type VictoryStackTTargetType = "data" | "labels" | "parent";
|
|
5
|
-
export interface VictoryStackProps extends VictoryCommonProps, VictoryLabelableProps, VictoryMultiLabelableProps {
|
|
6
|
-
bins?: number | number[] | Date[];
|
|
7
|
-
categories?: CategoryPropType;
|
|
8
|
-
children?: React.ReactNode | React.ReactNode[];
|
|
9
|
-
colorScale?: ColorScalePropType;
|
|
10
|
-
domain?: DomainPropType;
|
|
11
|
-
events?: EventPropTypeInterface<VictoryStackTTargetType, StringOrNumberOrCallback>[];
|
|
12
|
-
eventKey?: StringOrNumberOrCallback;
|
|
13
|
-
fillInMissingData?: boolean;
|
|
14
|
-
style?: VictoryStyleInterface;
|
|
15
|
-
xOffset?: number;
|
|
16
|
-
}
|
|
17
|
-
export declare const VictoryStack: React.NamedExoticComponent<VictoryStackProps> & {
|
|
18
|
-
readonly type: {
|
|
19
|
-
(initialProps: VictoryStackProps): JSX.Element;
|
|
20
|
-
propTypes: {
|
|
21
|
-
bins: PropTypes.Requireable<number | (number | Date | null | undefined)[]>;
|
|
22
|
-
categories: PropTypes.Requireable<(string | null | undefined)[] | PropTypes.InferProps<{
|
|
23
|
-
x: PropTypes.Requireable<(string | null | undefined)[]>;
|
|
24
|
-
y: PropTypes.Requireable<(string | null | undefined)[]>;
|
|
25
|
-
}>>;
|
|
26
|
-
children: PropTypes.Requireable<string | number | boolean | PropTypes.ReactElementLike | PropTypes.ReactNodeArray>;
|
|
27
|
-
colorScale: PropTypes.Requireable<string | (string | null | undefined)[]>;
|
|
28
|
-
fillInMissingData: PropTypes.Requireable<boolean>;
|
|
29
|
-
horizontal: PropTypes.Requireable<boolean>;
|
|
30
|
-
labelComponent: PropTypes.Requireable<PropTypes.ReactElementLike>;
|
|
31
|
-
labels: PropTypes.Requireable<any[] | ((...args: any[]) => any)>;
|
|
32
|
-
style: PropTypes.Requireable<PropTypes.InferProps<{
|
|
33
|
-
parent: PropTypes.Requireable<object>;
|
|
34
|
-
data: PropTypes.Requireable<object>;
|
|
35
|
-
labels: PropTypes.Requireable<object>;
|
|
36
|
-
}>>;
|
|
37
|
-
xOffset: PropTypes.Requireable<number>;
|
|
38
|
-
theme?: React.Validator<import("victory-core").VictoryThemeDefinition | null | undefined> | undefined;
|
|
39
|
-
animate?: React.Validator<boolean | import("victory-core").AnimatePropTypeInterface | null | undefined> | undefined;
|
|
40
|
-
containerComponent?: React.Validator<React.ReactElement<any, string | React.JSXElementConstructor<any>> | null | undefined> | undefined;
|
|
41
|
-
disableInlineStyles?: React.Validator<boolean | null | undefined> | undefined;
|
|
42
|
-
domainPadding?: React.Validator<import("victory-core").ForAxes<import("victory-core").PaddingType> | null | undefined> | undefined;
|
|
43
|
-
externalEventMutations?: React.Validator<import("victory-core").EventCallbackInterface<string | string[], import("victory-core").StringOrNumberOrList>[] | null | undefined> | undefined;
|
|
44
|
-
groupComponent?: React.Validator<React.ReactElement<any, string | React.JSXElementConstructor<any>> | null | undefined> | undefined;
|
|
45
|
-
height?: React.Validator<number | null | undefined> | undefined;
|
|
46
|
-
maxDomain?: React.Validator<number | {
|
|
47
|
-
x?: number | undefined;
|
|
48
|
-
y?: number | undefined;
|
|
49
|
-
} | null | undefined> | undefined;
|
|
50
|
-
minDomain?: React.Validator<number | {
|
|
51
|
-
x?: number | undefined;
|
|
52
|
-
y?: number | undefined;
|
|
53
|
-
} | null | undefined> | undefined;
|
|
54
|
-
name?: React.Validator<string | null | undefined> | undefined;
|
|
55
|
-
origin?: React.Validator<import("victory-core").OriginType | null | undefined> | undefined;
|
|
56
|
-
padding?: React.Validator<import("victory-core").PaddingProps | null | undefined> | undefined;
|
|
57
|
-
polar?: React.Validator<boolean | null | undefined> | undefined;
|
|
58
|
-
range?: React.Validator<import("victory-core").ForAxes<import("victory-core").RangeTuple> | null | undefined> | undefined;
|
|
59
|
-
scale?: React.Validator<import("victory-core").D3Scale<any> | import("victory-core").ScaleName | {
|
|
60
|
-
x?: import("victory-core").D3Scale<any> | import("victory-core").ScaleName | undefined;
|
|
61
|
-
y?: import("victory-core").D3Scale<any> | import("victory-core").ScaleName | undefined;
|
|
62
|
-
} | null | undefined> | undefined;
|
|
63
|
-
sharedEvents?: React.Validator<{
|
|
64
|
-
events: any[];
|
|
65
|
-
getEventState: Function;
|
|
66
|
-
} | null | undefined> | undefined;
|
|
67
|
-
singleQuadrantDomainPadding?: React.Validator<boolean | {
|
|
68
|
-
x?: boolean | undefined;
|
|
69
|
-
y?: boolean | undefined;
|
|
70
|
-
} | null | undefined> | undefined;
|
|
71
|
-
standalone?: React.Validator<boolean | null | undefined> | undefined;
|
|
72
|
-
width?: React.Validator<number | null | undefined> | undefined;
|
|
73
|
-
};
|
|
74
|
-
};
|
|
75
|
-
} & VictoryComponentConfiguration<VictoryStackProps>;
|
|
1
|
+
import PropTypes from "prop-types";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { CategoryPropType, ColorScalePropType, DomainPropType, EventPropTypeInterface, StringOrNumberOrCallback, VictoryCommonProps, VictoryLabelableProps, VictoryMultiLabelableProps, VictoryStyleInterface, VictoryComponentConfiguration } from "victory-core";
|
|
4
|
+
export declare type VictoryStackTTargetType = "data" | "labels" | "parent";
|
|
5
|
+
export interface VictoryStackProps extends VictoryCommonProps, VictoryLabelableProps, VictoryMultiLabelableProps {
|
|
6
|
+
bins?: number | number[] | Date[];
|
|
7
|
+
categories?: CategoryPropType;
|
|
8
|
+
children?: React.ReactNode | React.ReactNode[];
|
|
9
|
+
colorScale?: ColorScalePropType;
|
|
10
|
+
domain?: DomainPropType;
|
|
11
|
+
events?: EventPropTypeInterface<VictoryStackTTargetType, StringOrNumberOrCallback>[];
|
|
12
|
+
eventKey?: StringOrNumberOrCallback;
|
|
13
|
+
fillInMissingData?: boolean;
|
|
14
|
+
style?: VictoryStyleInterface;
|
|
15
|
+
xOffset?: number;
|
|
16
|
+
}
|
|
17
|
+
export declare const VictoryStack: React.NamedExoticComponent<VictoryStackProps> & {
|
|
18
|
+
readonly type: {
|
|
19
|
+
(initialProps: VictoryStackProps): JSX.Element;
|
|
20
|
+
propTypes: {
|
|
21
|
+
bins: PropTypes.Requireable<number | (number | Date | null | undefined)[]>;
|
|
22
|
+
categories: PropTypes.Requireable<(string | null | undefined)[] | PropTypes.InferProps<{
|
|
23
|
+
x: PropTypes.Requireable<(string | null | undefined)[]>;
|
|
24
|
+
y: PropTypes.Requireable<(string | null | undefined)[]>;
|
|
25
|
+
}>>;
|
|
26
|
+
children: PropTypes.Requireable<string | number | boolean | PropTypes.ReactElementLike | PropTypes.ReactNodeArray>;
|
|
27
|
+
colorScale: PropTypes.Requireable<string | (string | null | undefined)[]>;
|
|
28
|
+
fillInMissingData: PropTypes.Requireable<boolean>;
|
|
29
|
+
horizontal: PropTypes.Requireable<boolean>;
|
|
30
|
+
labelComponent: PropTypes.Requireable<PropTypes.ReactElementLike>;
|
|
31
|
+
labels: PropTypes.Requireable<any[] | ((...args: any[]) => any)>;
|
|
32
|
+
style: PropTypes.Requireable<PropTypes.InferProps<{
|
|
33
|
+
parent: PropTypes.Requireable<object>;
|
|
34
|
+
data: PropTypes.Requireable<object>;
|
|
35
|
+
labels: PropTypes.Requireable<object>;
|
|
36
|
+
}>>;
|
|
37
|
+
xOffset: PropTypes.Requireable<number>;
|
|
38
|
+
theme?: React.Validator<import("victory-core").VictoryThemeDefinition | null | undefined> | undefined;
|
|
39
|
+
animate?: React.Validator<boolean | import("victory-core").AnimatePropTypeInterface | null | undefined> | undefined;
|
|
40
|
+
containerComponent?: React.Validator<React.ReactElement<any, string | React.JSXElementConstructor<any>> | null | undefined> | undefined;
|
|
41
|
+
disableInlineStyles?: React.Validator<boolean | null | undefined> | undefined;
|
|
42
|
+
domainPadding?: React.Validator<import("victory-core").ForAxes<import("victory-core").PaddingType> | null | undefined> | undefined;
|
|
43
|
+
externalEventMutations?: React.Validator<import("victory-core").EventCallbackInterface<string | string[], import("victory-core").StringOrNumberOrList>[] | null | undefined> | undefined;
|
|
44
|
+
groupComponent?: React.Validator<React.ReactElement<any, string | React.JSXElementConstructor<any>> | null | undefined> | undefined;
|
|
45
|
+
height?: React.Validator<number | null | undefined> | undefined;
|
|
46
|
+
maxDomain?: React.Validator<number | {
|
|
47
|
+
x?: number | undefined;
|
|
48
|
+
y?: number | undefined;
|
|
49
|
+
} | null | undefined> | undefined;
|
|
50
|
+
minDomain?: React.Validator<number | {
|
|
51
|
+
x?: number | undefined;
|
|
52
|
+
y?: number | undefined;
|
|
53
|
+
} | null | undefined> | undefined;
|
|
54
|
+
name?: React.Validator<string | null | undefined> | undefined;
|
|
55
|
+
origin?: React.Validator<import("victory-core").OriginType | null | undefined> | undefined;
|
|
56
|
+
padding?: React.Validator<import("victory-core").PaddingProps | null | undefined> | undefined;
|
|
57
|
+
polar?: React.Validator<boolean | null | undefined> | undefined;
|
|
58
|
+
range?: React.Validator<import("victory-core").ForAxes<import("victory-core").RangeTuple> | null | undefined> | undefined;
|
|
59
|
+
scale?: React.Validator<import("victory-core").D3Scale<any> | import("victory-core").ScaleName | {
|
|
60
|
+
x?: import("victory-core").D3Scale<any> | import("victory-core").ScaleName | undefined;
|
|
61
|
+
y?: import("victory-core").D3Scale<any> | import("victory-core").ScaleName | undefined;
|
|
62
|
+
} | null | undefined> | undefined;
|
|
63
|
+
sharedEvents?: React.Validator<{
|
|
64
|
+
events: any[];
|
|
65
|
+
getEventState: Function;
|
|
66
|
+
} | null | undefined> | undefined;
|
|
67
|
+
singleQuadrantDomainPadding?: React.Validator<boolean | {
|
|
68
|
+
x?: boolean | undefined;
|
|
69
|
+
y?: boolean | undefined;
|
|
70
|
+
} | null | undefined> | undefined;
|
|
71
|
+
standalone?: React.Validator<boolean | null | undefined> | undefined;
|
|
72
|
+
width?: React.Validator<number | null | undefined> | undefined;
|
|
73
|
+
};
|
|
74
|
+
};
|
|
75
|
+
} & VictoryComponentConfiguration<VictoryStackProps>;
|
|
76
76
|
//# sourceMappingURL=victory-stack.d.ts.map
|