victory-box-plot 36.9.2 → 37.0.1-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 +14 -0
- package/dist/victory-box-plot.js +3766 -4910
- package/dist/victory-box-plot.min.js +1 -1
- package/es/helper-methods.d.ts +3 -3
- package/es/helper-methods.js +268 -320
- package/es/index.d.ts +1 -1
- package/es/victory-box-plot.d.ts +139 -139
- package/es/victory-box-plot.js +89 -151
- package/lib/helper-methods.d.ts +3 -3
- package/lib/helper-methods.js +268 -334
- package/lib/index.d.ts +1 -1
- package/lib/index.js +0 -2
- package/lib/victory-box-plot.d.ts +139 -139
- package/lib/victory-box-plot.js +89 -158
- package/package.json +4 -7
- package/src/victory-box-plot.tsx +3 -1
package/lib/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from "./victory-box-plot";
|
|
1
|
+
export * from "./victory-box-plot";
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
package/lib/index.js
CHANGED
|
@@ -3,9 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
|
|
7
6
|
var _victoryBoxPlot = require("./victory-box-plot");
|
|
8
|
-
|
|
9
7
|
Object.keys(_victoryBoxPlot).forEach(function (key) {
|
|
10
8
|
if (key === "default" || key === "__esModule") return;
|
|
11
9
|
if (key in exports && exports[key] === _victoryBoxPlot[key]) return;
|
|
@@ -1,140 +1,140 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { EventPropTypeInterface, DomainPropType, DomainPaddingPropType, OrientationTypes, StringOrNumberOrCallback, VictoryDatableProps, VictoryCommonProps, VictoryStyleObject, VictoryLabelStyleObject, EventsMixinClass } from "victory-core";
|
|
3
|
-
export declare type VictoryBoxPlotLabelType = boolean | (string | number)[] | {
|
|
4
|
-
(): any;
|
|
5
|
-
} | {
|
|
6
|
-
(data: any): string | null;
|
|
7
|
-
};
|
|
8
|
-
export interface VictoryBoxPlotStyleInterface {
|
|
9
|
-
parent?: VictoryStyleObject;
|
|
10
|
-
max?: VictoryStyleObject;
|
|
11
|
-
maxLabels?: VictoryLabelStyleObject | VictoryLabelStyleObject[];
|
|
12
|
-
min?: VictoryStyleObject;
|
|
13
|
-
minLabels?: VictoryLabelStyleObject | VictoryLabelStyleObject[];
|
|
14
|
-
median?: VictoryStyleObject;
|
|
15
|
-
medianLabels?: VictoryLabelStyleObject | VictoryLabelStyleObject[];
|
|
16
|
-
q1?: VictoryStyleObject;
|
|
17
|
-
q1Labels?: VictoryLabelStyleObject | VictoryLabelStyleObject[];
|
|
18
|
-
q3?: VictoryStyleObject;
|
|
19
|
-
q3Labels?: VictoryLabelStyleObject | VictoryLabelStyleObject[];
|
|
20
|
-
boxes?: VictoryStyleObject;
|
|
21
|
-
whiskers?: VictoryStyleObject;
|
|
22
|
-
}
|
|
23
|
-
export interface VictoryBoxPlotLabelOrientationInterface {
|
|
24
|
-
max?: OrientationTypes;
|
|
25
|
-
min?: OrientationTypes;
|
|
26
|
-
median?: OrientationTypes;
|
|
27
|
-
q1?: OrientationTypes;
|
|
28
|
-
q3?: OrientationTypes;
|
|
29
|
-
}
|
|
30
|
-
export interface VictoryBoxPlotProps extends VictoryCommonProps, VictoryDatableProps {
|
|
31
|
-
boxWidth?: number;
|
|
32
|
-
datum?: any;
|
|
33
|
-
domain?: DomainPropType;
|
|
34
|
-
domainPadding?: DomainPaddingPropType;
|
|
35
|
-
events?: EventPropTypeInterface<string, StringOrNumberOrCallback>[];
|
|
36
|
-
eventKey?: StringOrNumberOrCallback;
|
|
37
|
-
horizontal?: boolean;
|
|
38
|
-
labelOrientation?: OrientationTypes | VictoryBoxPlotLabelOrientationInterface;
|
|
39
|
-
labels?: boolean;
|
|
40
|
-
max?: StringOrNumberOrCallback | string[];
|
|
41
|
-
maxComponent?: React.ReactElement;
|
|
42
|
-
maxLabelComponent?: React.ReactElement;
|
|
43
|
-
maxLabels?: VictoryBoxPlotLabelType;
|
|
44
|
-
median?: StringOrNumberOrCallback | string[];
|
|
45
|
-
medianComponent?: React.ReactElement;
|
|
46
|
-
medianLabelComponent?: React.ReactElement;
|
|
47
|
-
medianLabels?: VictoryBoxPlotLabelType;
|
|
48
|
-
min?: StringOrNumberOrCallback | string[];
|
|
49
|
-
minComponent?: React.ReactElement;
|
|
50
|
-
minLabelComponent?: React.ReactElement;
|
|
51
|
-
minLabels?: VictoryBoxPlotLabelType;
|
|
52
|
-
q1?: StringOrNumberOrCallback | string[];
|
|
53
|
-
q1Component?: React.ReactElement;
|
|
54
|
-
q1LabelComponent?: React.ReactElement;
|
|
55
|
-
q1Labels?: VictoryBoxPlotLabelType;
|
|
56
|
-
q3?: StringOrNumberOrCallback | string[];
|
|
57
|
-
q3Component?: React.ReactElement;
|
|
58
|
-
q3LabelComponent?: React.ReactElement;
|
|
59
|
-
q3Labels?: VictoryBoxPlotLabelType;
|
|
60
|
-
style?: VictoryBoxPlotStyleInterface;
|
|
61
|
-
text?: StringOrNumberOrCallback | string[];
|
|
62
|
-
whiskerWidth?: number;
|
|
63
|
-
}
|
|
64
|
-
interface VictoryBoxPlotBase extends EventsMixinClass<VictoryBoxPlotProps> {
|
|
65
|
-
}
|
|
66
|
-
declare class VictoryBoxPlotBase extends React.Component<VictoryBoxPlotProps> {
|
|
67
|
-
static animationWhitelist: Array<keyof VictoryBoxPlotProps>;
|
|
68
|
-
static displayName: string;
|
|
69
|
-
static role: string;
|
|
70
|
-
static defaultTransitions: import("victory-core").AnimatePropTypeInterface;
|
|
71
|
-
static defaultProps: VictoryBoxPlotProps;
|
|
72
|
-
static getDomain: (props: any, axis: any) => any;
|
|
73
|
-
static getData: (props: any) => any;
|
|
74
|
-
static getBaseProps
|
|
75
|
-
static expectedComponents: Array<keyof VictoryBoxPlotProps>;
|
|
76
|
-
renderBoxPlot(props: any): React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
77
|
-
shouldAnimate(): boolean;
|
|
78
|
-
shouldRenderDatum(datum: any): boolean;
|
|
79
|
-
render(): React.ReactElement;
|
|
80
|
-
}
|
|
81
|
-
export declare const VictoryBoxPlot: {
|
|
82
|
-
new (props: import("victory-core").EventMixinCommonProps): {
|
|
83
|
-
state: {};
|
|
84
|
-
getEventState: (eventKey: string | number, namespace: string, childType?: string | undefined) => any;
|
|
85
|
-
getScopedEvents: (events: any, namespace: any, childType: any, baseProps: any) => {};
|
|
86
|
-
getEvents: (p: any, target: any, eventKey: any) => any;
|
|
87
|
-
externalMutations: {} | undefined;
|
|
88
|
-
calculatedState: {};
|
|
89
|
-
globalEvents: {};
|
|
90
|
-
prevGlobalEventKeys: string[];
|
|
91
|
-
boundGlobalEvents: {};
|
|
92
|
-
shouldComponentUpdate(nextProps: import("victory-core").EventMixinCommonProps): boolean;
|
|
93
|
-
componentDidMount(): void;
|
|
94
|
-
componentDidUpdate(prevProps: any): void;
|
|
95
|
-
componentWillUnmount(): void;
|
|
96
|
-
addGlobalListener(key: any): void;
|
|
97
|
-
removeGlobalListener(key: any): void;
|
|
98
|
-
getStateChanges(props: any): {};
|
|
99
|
-
applyExternalMutations(props: any, externalMutations: any): void;
|
|
100
|
-
getCalculatedValues(props: any): import("victory-core").EventMixinCalculatedValues;
|
|
101
|
-
getExternalMutations(props: import("victory-core").EventMixinCommonProps): {} | undefined;
|
|
102
|
-
cacheValues(obj: any): void;
|
|
103
|
-
getBaseProps(props: any, getSharedEventState: any): Record<string, object>;
|
|
104
|
-
getAllEvents(props: any): any;
|
|
105
|
-
getComponentProps(component: React.ReactNode, type: string, index: string | number): any;
|
|
106
|
-
renderContainer(component: any, children: any): React.DetailedReactHTMLElement<any, HTMLElement>;
|
|
107
|
-
animateComponent(props: import("victory-core").EventMixinCommonProps, defaultAnimationWhitelist: string[]): React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
108
|
-
renderContinuousData(props: import("victory-core").EventMixinCommonProps): React.DetailedReactHTMLElement<any, HTMLElement>;
|
|
109
|
-
renderData(props: any, shouldRenderDatum?: ((datum: any) => boolean) | undefined): React.DetailedReactHTMLElement<any, HTMLElement>;
|
|
110
|
-
context: unknown;
|
|
111
|
-
setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<import("victory-core").EventMixinCommonProps>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
|
|
112
|
-
forceUpdate(callback?: (() => void) | undefined): void;
|
|
113
|
-
render(): React.ReactNode;
|
|
114
|
-
readonly props: Readonly<import("victory-core").EventMixinCommonProps>;
|
|
115
|
-
refs: {
|
|
116
|
-
[key: string]: React.ReactInstance;
|
|
117
|
-
};
|
|
118
|
-
componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
|
|
119
|
-
getSnapshotBeforeUpdate?(prevProps: Readonly<import("victory-core").EventMixinCommonProps>, prevState: Readonly<{}>): any;
|
|
120
|
-
componentWillMount?(): void;
|
|
121
|
-
UNSAFE_componentWillMount?(): void;
|
|
122
|
-
componentWillReceiveProps?(nextProps: Readonly<import("victory-core").EventMixinCommonProps>, nextContext: any): void;
|
|
123
|
-
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<import("victory-core").EventMixinCommonProps>, nextContext: any): void;
|
|
124
|
-
componentWillUpdate?(nextProps: Readonly<import("victory-core").EventMixinCommonProps>, nextState: Readonly<{}>, nextContext: any): void;
|
|
125
|
-
UNSAFE_componentWillUpdate?(nextProps: Readonly<import("victory-core").EventMixinCommonProps>, nextState: Readonly<{}>, nextContext: any): void;
|
|
126
|
-
componentEvents: import("victory-core/lib/victory-util/events").ComponentEvent[];
|
|
127
|
-
getSharedEventState: (key: string, value: string) => unknown;
|
|
128
|
-
baseProps: Record<string, object>;
|
|
129
|
-
dataKeys: string[];
|
|
130
|
-
hasEvents: unknown;
|
|
131
|
-
events: unknown;
|
|
132
|
-
};
|
|
133
|
-
getBaseProps?(props: import("victory-core").EventMixinCommonProps): Record<string, object>;
|
|
134
|
-
role?: string | undefined;
|
|
135
|
-
expectedComponents?: string[] | undefined;
|
|
136
|
-
getChildren?: ((props: import("victory-core").EventMixinCommonProps, childComponents?: React.ReactNode[] | undefined, calculatedProps?: import("victory-core").EventMixinCommonProps | undefined) => void) | undefined;
|
|
137
|
-
animationWhitelist?: string[] | undefined;
|
|
138
|
-
} & typeof VictoryBoxPlotBase;
|
|
139
|
-
export {};
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { EventPropTypeInterface, DomainPropType, DomainPaddingPropType, OrientationTypes, StringOrNumberOrCallback, VictoryDatableProps, VictoryCommonProps, VictoryStyleObject, VictoryLabelStyleObject, EventsMixinClass } from "victory-core";
|
|
3
|
+
export declare type VictoryBoxPlotLabelType = boolean | (string | number)[] | {
|
|
4
|
+
(): any;
|
|
5
|
+
} | {
|
|
6
|
+
(data: any): string | null;
|
|
7
|
+
};
|
|
8
|
+
export interface VictoryBoxPlotStyleInterface {
|
|
9
|
+
parent?: VictoryStyleObject;
|
|
10
|
+
max?: VictoryStyleObject;
|
|
11
|
+
maxLabels?: VictoryLabelStyleObject | VictoryLabelStyleObject[];
|
|
12
|
+
min?: VictoryStyleObject;
|
|
13
|
+
minLabels?: VictoryLabelStyleObject | VictoryLabelStyleObject[];
|
|
14
|
+
median?: VictoryStyleObject;
|
|
15
|
+
medianLabels?: VictoryLabelStyleObject | VictoryLabelStyleObject[];
|
|
16
|
+
q1?: VictoryStyleObject;
|
|
17
|
+
q1Labels?: VictoryLabelStyleObject | VictoryLabelStyleObject[];
|
|
18
|
+
q3?: VictoryStyleObject;
|
|
19
|
+
q3Labels?: VictoryLabelStyleObject | VictoryLabelStyleObject[];
|
|
20
|
+
boxes?: VictoryStyleObject;
|
|
21
|
+
whiskers?: VictoryStyleObject;
|
|
22
|
+
}
|
|
23
|
+
export interface VictoryBoxPlotLabelOrientationInterface {
|
|
24
|
+
max?: OrientationTypes;
|
|
25
|
+
min?: OrientationTypes;
|
|
26
|
+
median?: OrientationTypes;
|
|
27
|
+
q1?: OrientationTypes;
|
|
28
|
+
q3?: OrientationTypes;
|
|
29
|
+
}
|
|
30
|
+
export interface VictoryBoxPlotProps extends VictoryCommonProps, VictoryDatableProps {
|
|
31
|
+
boxWidth?: number;
|
|
32
|
+
datum?: any;
|
|
33
|
+
domain?: DomainPropType;
|
|
34
|
+
domainPadding?: DomainPaddingPropType;
|
|
35
|
+
events?: EventPropTypeInterface<string, StringOrNumberOrCallback>[];
|
|
36
|
+
eventKey?: StringOrNumberOrCallback;
|
|
37
|
+
horizontal?: boolean;
|
|
38
|
+
labelOrientation?: OrientationTypes | VictoryBoxPlotLabelOrientationInterface;
|
|
39
|
+
labels?: boolean;
|
|
40
|
+
max?: StringOrNumberOrCallback | string[];
|
|
41
|
+
maxComponent?: React.ReactElement;
|
|
42
|
+
maxLabelComponent?: React.ReactElement;
|
|
43
|
+
maxLabels?: VictoryBoxPlotLabelType;
|
|
44
|
+
median?: StringOrNumberOrCallback | string[];
|
|
45
|
+
medianComponent?: React.ReactElement;
|
|
46
|
+
medianLabelComponent?: React.ReactElement;
|
|
47
|
+
medianLabels?: VictoryBoxPlotLabelType;
|
|
48
|
+
min?: StringOrNumberOrCallback | string[];
|
|
49
|
+
minComponent?: React.ReactElement;
|
|
50
|
+
minLabelComponent?: React.ReactElement;
|
|
51
|
+
minLabels?: VictoryBoxPlotLabelType;
|
|
52
|
+
q1?: StringOrNumberOrCallback | string[];
|
|
53
|
+
q1Component?: React.ReactElement;
|
|
54
|
+
q1LabelComponent?: React.ReactElement;
|
|
55
|
+
q1Labels?: VictoryBoxPlotLabelType;
|
|
56
|
+
q3?: StringOrNumberOrCallback | string[];
|
|
57
|
+
q3Component?: React.ReactElement;
|
|
58
|
+
q3LabelComponent?: React.ReactElement;
|
|
59
|
+
q3Labels?: VictoryBoxPlotLabelType;
|
|
60
|
+
style?: VictoryBoxPlotStyleInterface;
|
|
61
|
+
text?: StringOrNumberOrCallback | string[];
|
|
62
|
+
whiskerWidth?: number;
|
|
63
|
+
}
|
|
64
|
+
interface VictoryBoxPlotBase extends EventsMixinClass<VictoryBoxPlotProps> {
|
|
65
|
+
}
|
|
66
|
+
declare class VictoryBoxPlotBase extends React.Component<VictoryBoxPlotProps> {
|
|
67
|
+
static animationWhitelist: Array<keyof VictoryBoxPlotProps>;
|
|
68
|
+
static displayName: string;
|
|
69
|
+
static role: string;
|
|
70
|
+
static defaultTransitions: import("victory-core").AnimatePropTypeInterface;
|
|
71
|
+
static defaultProps: VictoryBoxPlotProps;
|
|
72
|
+
static getDomain: (props: any, axis: any) => any;
|
|
73
|
+
static getData: (props: any) => any;
|
|
74
|
+
static getBaseProps(props: any): any;
|
|
75
|
+
static expectedComponents: Array<keyof VictoryBoxPlotProps>;
|
|
76
|
+
renderBoxPlot(props: any): React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
77
|
+
shouldAnimate(): boolean;
|
|
78
|
+
shouldRenderDatum(datum: any): boolean;
|
|
79
|
+
render(): React.ReactElement;
|
|
80
|
+
}
|
|
81
|
+
export declare const VictoryBoxPlot: {
|
|
82
|
+
new (props: import("victory-core").EventMixinCommonProps): {
|
|
83
|
+
state: {};
|
|
84
|
+
getEventState: (eventKey: string | number, namespace: string, childType?: string | undefined) => any;
|
|
85
|
+
getScopedEvents: (events: any, namespace: any, childType: any, baseProps: any) => {};
|
|
86
|
+
getEvents: (p: any, target: any, eventKey: any) => any;
|
|
87
|
+
externalMutations: {} | undefined;
|
|
88
|
+
calculatedState: {};
|
|
89
|
+
globalEvents: {};
|
|
90
|
+
prevGlobalEventKeys: string[];
|
|
91
|
+
boundGlobalEvents: {};
|
|
92
|
+
shouldComponentUpdate(nextProps: import("victory-core").EventMixinCommonProps): boolean;
|
|
93
|
+
componentDidMount(): void;
|
|
94
|
+
componentDidUpdate(prevProps: any): void;
|
|
95
|
+
componentWillUnmount(): void;
|
|
96
|
+
addGlobalListener(key: any): void;
|
|
97
|
+
removeGlobalListener(key: any): void;
|
|
98
|
+
getStateChanges(props: any): {};
|
|
99
|
+
applyExternalMutations(props: any, externalMutations: any): void;
|
|
100
|
+
getCalculatedValues(props: any): import("victory-core").EventMixinCalculatedValues;
|
|
101
|
+
getExternalMutations(props: import("victory-core").EventMixinCommonProps): {} | undefined;
|
|
102
|
+
cacheValues(obj: any): void;
|
|
103
|
+
getBaseProps(props: any, getSharedEventState: any): Record<string, object>;
|
|
104
|
+
getAllEvents(props: any): any;
|
|
105
|
+
getComponentProps(component: React.ReactNode, type: string, index: string | number): any;
|
|
106
|
+
renderContainer(component: any, children: any): React.DetailedReactHTMLElement<any, HTMLElement>;
|
|
107
|
+
animateComponent(props: import("victory-core").EventMixinCommonProps, defaultAnimationWhitelist: string[]): React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
108
|
+
renderContinuousData(props: import("victory-core").EventMixinCommonProps): React.DetailedReactHTMLElement<any, HTMLElement>;
|
|
109
|
+
renderData(props: any, shouldRenderDatum?: ((datum: any) => boolean) | undefined): React.DetailedReactHTMLElement<any, HTMLElement>;
|
|
110
|
+
context: unknown;
|
|
111
|
+
setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<import("victory-core").EventMixinCommonProps>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
|
|
112
|
+
forceUpdate(callback?: (() => void) | undefined): void;
|
|
113
|
+
render(): React.ReactNode;
|
|
114
|
+
readonly props: Readonly<import("victory-core").EventMixinCommonProps>;
|
|
115
|
+
refs: {
|
|
116
|
+
[key: string]: React.ReactInstance;
|
|
117
|
+
};
|
|
118
|
+
componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
|
|
119
|
+
getSnapshotBeforeUpdate?(prevProps: Readonly<import("victory-core").EventMixinCommonProps>, prevState: Readonly<{}>): any;
|
|
120
|
+
componentWillMount?(): void;
|
|
121
|
+
UNSAFE_componentWillMount?(): void;
|
|
122
|
+
componentWillReceiveProps?(nextProps: Readonly<import("victory-core").EventMixinCommonProps>, nextContext: any): void;
|
|
123
|
+
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<import("victory-core").EventMixinCommonProps>, nextContext: any): void;
|
|
124
|
+
componentWillUpdate?(nextProps: Readonly<import("victory-core").EventMixinCommonProps>, nextState: Readonly<{}>, nextContext: any): void;
|
|
125
|
+
UNSAFE_componentWillUpdate?(nextProps: Readonly<import("victory-core").EventMixinCommonProps>, nextState: Readonly<{}>, nextContext: any): void;
|
|
126
|
+
componentEvents: import("victory-core/lib/victory-util/events").ComponentEvent[];
|
|
127
|
+
getSharedEventState: (key: string, value: string) => unknown;
|
|
128
|
+
baseProps: Record<string, object>;
|
|
129
|
+
dataKeys: string[];
|
|
130
|
+
hasEvents: unknown;
|
|
131
|
+
events: unknown;
|
|
132
|
+
};
|
|
133
|
+
getBaseProps?(props: import("victory-core").EventMixinCommonProps): Record<string, object>;
|
|
134
|
+
role?: string | undefined;
|
|
135
|
+
expectedComponents?: string[] | undefined;
|
|
136
|
+
getChildren?: ((props: import("victory-core").EventMixinCommonProps, childComponents?: React.ReactNode[] | undefined, calculatedProps?: import("victory-core").EventMixinCommonProps | undefined) => void) | undefined;
|
|
137
|
+
animationWhitelist?: string[] | undefined;
|
|
138
|
+
} & typeof VictoryBoxPlotBase;
|
|
139
|
+
export {};
|
|
140
140
|
//# sourceMappingURL=victory-box-plot.d.ts.map
|
package/lib/victory-box-plot.js
CHANGED
|
@@ -4,48 +4,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.VictoryBoxPlot = void 0;
|
|
7
|
-
|
|
8
7
|
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
|
|
10
8
|
var _victoryCore = require("victory-core");
|
|
11
|
-
|
|
12
9
|
var _helperMethods = require("./helper-methods");
|
|
13
|
-
|
|
14
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
-
|
|
16
|
-
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
17
|
-
|
|
18
|
-
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
19
|
-
|
|
20
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
21
|
-
|
|
22
|
-
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
23
|
-
|
|
24
|
-
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
25
|
-
|
|
26
|
-
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; }
|
|
27
|
-
|
|
28
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
29
|
-
|
|
30
|
-
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
31
|
-
|
|
32
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
33
|
-
|
|
34
|
-
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); }
|
|
35
|
-
|
|
36
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
37
|
-
|
|
38
|
-
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); }; }
|
|
39
|
-
|
|
40
|
-
function _possibleConstructorReturn(self, call) { if (call && (typeof call === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
41
|
-
|
|
42
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
43
|
-
|
|
44
|
-
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; } }
|
|
45
|
-
|
|
46
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
47
|
-
|
|
48
|
-
var fallbackProps = {
|
|
11
|
+
const fallbackProps = {
|
|
49
12
|
width: 450,
|
|
50
13
|
height: 300,
|
|
51
14
|
padding: {
|
|
@@ -55,7 +18,7 @@ var fallbackProps = {
|
|
|
55
18
|
left: 20
|
|
56
19
|
}
|
|
57
20
|
};
|
|
58
|
-
|
|
21
|
+
const defaultData = [{
|
|
59
22
|
x: 1,
|
|
60
23
|
min: 5,
|
|
61
24
|
q1: 7,
|
|
@@ -70,7 +33,7 @@ var defaultData = [{
|
|
|
70
33
|
q3: 12,
|
|
71
34
|
max: 15
|
|
72
35
|
}];
|
|
73
|
-
|
|
36
|
+
const options = {
|
|
74
37
|
components: [{
|
|
75
38
|
name: "min"
|
|
76
39
|
}, {
|
|
@@ -97,124 +60,92 @@ var options = {
|
|
|
97
60
|
}]
|
|
98
61
|
};
|
|
99
62
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
63
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-interface
|
|
64
|
+
|
|
65
|
+
class VictoryBoxPlotBase extends _react.default.Component {
|
|
66
|
+
static animationWhitelist = ["data", "domain", "height", "padding", "style", "width"];
|
|
67
|
+
static displayName = "VictoryBoxPlot";
|
|
68
|
+
static role = "boxplot";
|
|
69
|
+
static defaultTransitions = _victoryCore.DefaultTransitions.discreteTransitions();
|
|
70
|
+
static defaultProps = {
|
|
71
|
+
containerComponent: /*#__PURE__*/_react.default.createElement(_victoryCore.VictoryContainer, null),
|
|
72
|
+
data: defaultData,
|
|
73
|
+
dataComponent: /*#__PURE__*/_react.default.createElement(_victoryCore.Box, null),
|
|
74
|
+
groupComponent: /*#__PURE__*/_react.default.createElement("g", {
|
|
75
|
+
role: "presentation"
|
|
76
|
+
}),
|
|
77
|
+
maxComponent: /*#__PURE__*/_react.default.createElement(_victoryCore.Whisker, null),
|
|
78
|
+
maxLabelComponent: /*#__PURE__*/_react.default.createElement(_victoryCore.VictoryLabel, null),
|
|
79
|
+
medianComponent: /*#__PURE__*/_react.default.createElement(_victoryCore.LineSegment, null),
|
|
80
|
+
medianLabelComponent: /*#__PURE__*/_react.default.createElement(_victoryCore.VictoryLabel, null),
|
|
81
|
+
minComponent: /*#__PURE__*/_react.default.createElement(_victoryCore.Whisker, null),
|
|
82
|
+
minLabelComponent: /*#__PURE__*/_react.default.createElement(_victoryCore.VictoryLabel, null),
|
|
83
|
+
q1Component: /*#__PURE__*/_react.default.createElement(_victoryCore.Box, null),
|
|
84
|
+
q1LabelComponent: /*#__PURE__*/_react.default.createElement(_victoryCore.VictoryLabel, null),
|
|
85
|
+
q3Component: /*#__PURE__*/_react.default.createElement(_victoryCore.Box, null),
|
|
86
|
+
q3LabelComponent: /*#__PURE__*/_react.default.createElement(_victoryCore.VictoryLabel, null),
|
|
87
|
+
samples: 50,
|
|
88
|
+
sortKey: "x",
|
|
89
|
+
sortOrder: "ascending",
|
|
90
|
+
standalone: true,
|
|
91
|
+
theme: _victoryCore.VictoryTheme.grayscale
|
|
92
|
+
};
|
|
93
|
+
static getDomain = _helperMethods.getDomain;
|
|
94
|
+
static getData = _helperMethods.getData;
|
|
95
|
+
static getBaseProps(props) {
|
|
96
|
+
return (0, _helperMethods.getBaseProps)(props, fallbackProps);
|
|
97
|
+
}
|
|
98
|
+
static expectedComponents = ["maxComponent", "maxLabelComponent", "medianComponent", "medianLabelComponent", "minComponent", "minLabelComponent", "q1Component", "q1LabelComponent", "q3Component", "q3LabelComponent", "groupComponent", "containerComponent"];
|
|
99
|
+
renderBoxPlot(props) {
|
|
100
|
+
const types = ["q1", "q3", "max", "min", "median"];
|
|
101
|
+
const dataComponents = types.map(type => {
|
|
102
|
+
return this.dataKeys.reduce((validDataComponents, _key, index) => {
|
|
103
|
+
const baseComponent = props[`${type}Component`];
|
|
104
|
+
const componentProps = this.getComponentProps(baseComponent, type, index);
|
|
105
|
+
if (this.shouldRenderDatum(componentProps.datum)) {
|
|
106
|
+
validDataComponents.push( /*#__PURE__*/_react.default.cloneElement(baseComponent, componentProps));
|
|
107
|
+
}
|
|
108
|
+
return validDataComponents;
|
|
109
|
+
}, []);
|
|
110
|
+
}).flat();
|
|
111
|
+
const labelComponents = types.map(type => {
|
|
112
|
+
const components = this.dataKeys.reduce((validComponents, _key, index) => {
|
|
113
|
+
const name = `${type}Labels`;
|
|
114
|
+
const baseComponent = props[`${type}LabelComponent`];
|
|
115
|
+
const labelProps = this.getComponentProps(baseComponent, name, index);
|
|
116
|
+
if (labelProps.text !== undefined && labelProps.text !== null) {
|
|
117
|
+
validComponents.push( /*#__PURE__*/_react.default.cloneElement(baseComponent, labelProps));
|
|
118
|
+
}
|
|
119
|
+
return validComponents;
|
|
120
|
+
}, []);
|
|
121
|
+
return components.filter(Boolean);
|
|
122
|
+
}).flat();
|
|
123
|
+
const children = [...dataComponents, ...labelComponents];
|
|
124
|
+
return this.renderContainer(props.groupComponent, children);
|
|
109
125
|
}
|
|
110
126
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
}).flat();
|
|
130
|
-
var labelComponents = types.map(function (type) {
|
|
131
|
-
var components = _this.dataKeys.reduce(function (validComponents, _key, index) {
|
|
132
|
-
var name = "".concat(type, "Labels");
|
|
133
|
-
var baseComponent = props["".concat(type, "LabelComponent")];
|
|
134
|
-
|
|
135
|
-
var labelProps = _this.getComponentProps(baseComponent, name, index);
|
|
136
|
-
|
|
137
|
-
if (labelProps.text !== undefined && labelProps.text !== null) {
|
|
138
|
-
validComponents.push( /*#__PURE__*/_react.default.cloneElement(baseComponent, labelProps));
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
return validComponents;
|
|
142
|
-
}, []);
|
|
143
|
-
|
|
144
|
-
return components.filter(Boolean);
|
|
145
|
-
}).flat();
|
|
146
|
-
var children = [].concat(_toConsumableArray(dataComponents), _toConsumableArray(labelComponents));
|
|
147
|
-
return this.renderContainer(props.groupComponent, children);
|
|
148
|
-
} // Overridden in native versions
|
|
149
|
-
|
|
150
|
-
}, {
|
|
151
|
-
key: "shouldAnimate",
|
|
152
|
-
value: function shouldAnimate() {
|
|
153
|
-
return !!this.props.animate;
|
|
154
|
-
}
|
|
155
|
-
}, {
|
|
156
|
-
key: "shouldRenderDatum",
|
|
157
|
-
value: function shouldRenderDatum(datum) {
|
|
158
|
-
var hasX = !_victoryCore.Helpers.isNil(datum._x);
|
|
159
|
-
var hasY = !_victoryCore.Helpers.isNil(datum._y);
|
|
160
|
-
var hasSummaryStatistics = !_victoryCore.Helpers.isNil(datum._min) && !_victoryCore.Helpers.isNil(datum._max) && !_victoryCore.Helpers.isNil(datum._median) && !_victoryCore.Helpers.isNil(datum._q1) && !_victoryCore.Helpers.isNil(datum._q3);
|
|
161
|
-
return hasSummaryStatistics && (this.props.horizontal ? hasY : hasX);
|
|
162
|
-
}
|
|
163
|
-
}, {
|
|
164
|
-
key: "render",
|
|
165
|
-
value: function render() {
|
|
166
|
-
var animationWhitelist = VictoryBoxPlot.animationWhitelist,
|
|
167
|
-
role = VictoryBoxPlot.role;
|
|
168
|
-
|
|
169
|
-
var props = _victoryCore.Helpers.modifyProps(this.props, fallbackProps, role);
|
|
170
|
-
|
|
171
|
-
if (this.shouldAnimate()) {
|
|
172
|
-
return this.animateComponent(props, animationWhitelist);
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
var children = this.renderBoxPlot(props);
|
|
176
|
-
var component = props.standalone ? this.renderContainer(props.containerComponent, children) : children;
|
|
177
|
-
return _victoryCore.UserProps.withSafeUserProps(component, props);
|
|
127
|
+
// Overridden in native versions
|
|
128
|
+
shouldAnimate() {
|
|
129
|
+
return !!this.props.animate;
|
|
130
|
+
}
|
|
131
|
+
shouldRenderDatum(datum) {
|
|
132
|
+
const hasX = !_victoryCore.Helpers.isNil(datum._x);
|
|
133
|
+
const hasY = !_victoryCore.Helpers.isNil(datum._y);
|
|
134
|
+
const hasSummaryStatistics = !_victoryCore.Helpers.isNil(datum._min) && !_victoryCore.Helpers.isNil(datum._max) && !_victoryCore.Helpers.isNil(datum._median) && !_victoryCore.Helpers.isNil(datum._q1) && !_victoryCore.Helpers.isNil(datum._q3);
|
|
135
|
+
return hasSummaryStatistics && (this.props.horizontal ? hasY : hasX);
|
|
136
|
+
}
|
|
137
|
+
render() {
|
|
138
|
+
const {
|
|
139
|
+
animationWhitelist,
|
|
140
|
+
role
|
|
141
|
+
} = VictoryBoxPlot;
|
|
142
|
+
const props = _victoryCore.Helpers.modifyProps(this.props, fallbackProps, role);
|
|
143
|
+
if (this.shouldAnimate()) {
|
|
144
|
+
return this.animateComponent(props, animationWhitelist);
|
|
178
145
|
}
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
VictoryBoxPlotBase.displayName = "VictoryBoxPlot";
|
|
186
|
-
VictoryBoxPlotBase.role = "boxplot";
|
|
187
|
-
VictoryBoxPlotBase.defaultTransitions = _victoryCore.DefaultTransitions.discreteTransitions();
|
|
188
|
-
VictoryBoxPlotBase.defaultProps = {
|
|
189
|
-
containerComponent: /*#__PURE__*/_react.default.createElement(_victoryCore.VictoryContainer, null),
|
|
190
|
-
data: defaultData,
|
|
191
|
-
dataComponent: /*#__PURE__*/_react.default.createElement(_victoryCore.Box, null),
|
|
192
|
-
groupComponent: /*#__PURE__*/_react.default.createElement("g", {
|
|
193
|
-
role: "presentation"
|
|
194
|
-
}),
|
|
195
|
-
maxComponent: /*#__PURE__*/_react.default.createElement(_victoryCore.Whisker, null),
|
|
196
|
-
maxLabelComponent: /*#__PURE__*/_react.default.createElement(_victoryCore.VictoryLabel, null),
|
|
197
|
-
medianComponent: /*#__PURE__*/_react.default.createElement(_victoryCore.LineSegment, null),
|
|
198
|
-
medianLabelComponent: /*#__PURE__*/_react.default.createElement(_victoryCore.VictoryLabel, null),
|
|
199
|
-
minComponent: /*#__PURE__*/_react.default.createElement(_victoryCore.Whisker, null),
|
|
200
|
-
minLabelComponent: /*#__PURE__*/_react.default.createElement(_victoryCore.VictoryLabel, null),
|
|
201
|
-
q1Component: /*#__PURE__*/_react.default.createElement(_victoryCore.Box, null),
|
|
202
|
-
q1LabelComponent: /*#__PURE__*/_react.default.createElement(_victoryCore.VictoryLabel, null),
|
|
203
|
-
q3Component: /*#__PURE__*/_react.default.createElement(_victoryCore.Box, null),
|
|
204
|
-
q3LabelComponent: /*#__PURE__*/_react.default.createElement(_victoryCore.VictoryLabel, null),
|
|
205
|
-
samples: 50,
|
|
206
|
-
sortKey: "x",
|
|
207
|
-
sortOrder: "ascending",
|
|
208
|
-
standalone: true,
|
|
209
|
-
theme: _victoryCore.VictoryTheme.grayscale
|
|
210
|
-
};
|
|
211
|
-
VictoryBoxPlotBase.getDomain = _helperMethods.getDomain;
|
|
212
|
-
VictoryBoxPlotBase.getData = _helperMethods.getData;
|
|
213
|
-
|
|
214
|
-
VictoryBoxPlotBase.getBaseProps = function (props) {
|
|
215
|
-
return (0, _helperMethods.getBaseProps)(props, fallbackProps);
|
|
216
|
-
};
|
|
217
|
-
|
|
218
|
-
VictoryBoxPlotBase.expectedComponents = ["maxComponent", "maxLabelComponent", "medianComponent", "medianLabelComponent", "minComponent", "minLabelComponent", "q1Component", "q1LabelComponent", "q3Component", "q3LabelComponent", "groupComponent", "containerComponent"];
|
|
219
|
-
var VictoryBoxPlot = (0, _victoryCore.addEvents)(VictoryBoxPlotBase, options);
|
|
220
|
-
exports.VictoryBoxPlot = VictoryBoxPlot;
|
|
146
|
+
const children = this.renderBoxPlot(props);
|
|
147
|
+
const component = props.standalone ? this.renderContainer(props.containerComponent, children) : children;
|
|
148
|
+
return _victoryCore.UserProps.withSafeUserProps(component, props);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
const VictoryBoxPlot = exports.VictoryBoxPlot = (0, _victoryCore.addEvents)(VictoryBoxPlotBase, options);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "victory-box-plot",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "37.0.1-next.0",
|
|
4
4
|
"description": "Box Plot Component for Victory",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"data visualization",
|
|
@@ -21,17 +21,14 @@
|
|
|
21
21
|
"license": "MIT",
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"lodash": "^4.17.19",
|
|
24
|
-
"victory-core": "^
|
|
25
|
-
"victory-vendor": "^
|
|
24
|
+
"victory-core": "^37.0.1-next.0",
|
|
25
|
+
"victory-vendor": "^37.0.1-next.0"
|
|
26
26
|
},
|
|
27
27
|
"peerDependencies": {
|
|
28
28
|
"react": ">=16.6.0"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
|
-
"victory-chart": "
|
|
32
|
-
},
|
|
33
|
-
"publishConfig": {
|
|
34
|
-
"provenance": true
|
|
31
|
+
"victory-chart": "37.0.1-next.0"
|
|
35
32
|
},
|
|
36
33
|
"wireit": {
|
|
37
34
|
"### THESE WIREIT CONFIGS ARE GENERATED ####": {},
|
package/src/victory-box-plot.tsx
CHANGED
|
@@ -163,7 +163,9 @@ class VictoryBoxPlotBase extends React.Component<VictoryBoxPlotProps> {
|
|
|
163
163
|
|
|
164
164
|
static getDomain = getDomain;
|
|
165
165
|
static getData = getData;
|
|
166
|
-
static getBaseProps
|
|
166
|
+
static getBaseProps(props) {
|
|
167
|
+
return getBaseProps(props, fallbackProps);
|
|
168
|
+
}
|
|
167
169
|
static expectedComponents: Array<keyof VictoryBoxPlotProps> = [
|
|
168
170
|
"maxComponent",
|
|
169
171
|
"maxLabelComponent",
|