victory-box-plot 36.9.1 → 36.9.2-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 +13 -0
- package/dist/victory-box-plot.js +3955 -5337
- package/dist/victory-box-plot.min.js +1 -1
- package/es/helper-methods.d.ts +3 -3
- package/es/helper-methods.js +268 -322
- package/es/index.d.ts +1 -1
- package/es/victory-box-plot.d.ts +139 -139
- package/es/victory-box-plot.js +87 -156
- package/lib/helper-methods.d.ts +3 -3
- package/lib/helper-methods.js +268 -339
- 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 +87 -161
- package/package.json +9 -13
- package/src/helper-methods.tsx +3 -3
- package/src/victory-box-plot.tsx +8 -8
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: (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 {};
|
|
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,52 +4,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.VictoryBoxPlot = void 0;
|
|
7
|
-
|
|
8
|
-
var _isNil2 = _interopRequireDefault(require("lodash/isNil"));
|
|
9
|
-
|
|
10
7
|
var _flatten2 = _interopRequireDefault(require("lodash/flatten"));
|
|
11
|
-
|
|
12
8
|
var _react = _interopRequireDefault(require("react"));
|
|
13
|
-
|
|
14
9
|
var _victoryCore = require("victory-core");
|
|
15
|
-
|
|
16
10
|
var _helperMethods = require("./helper-methods");
|
|
17
|
-
|
|
18
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
|
-
|
|
20
|
-
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
21
|
-
|
|
22
|
-
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."); }
|
|
23
|
-
|
|
24
|
-
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); }
|
|
25
|
-
|
|
26
|
-
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
27
|
-
|
|
28
|
-
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
29
|
-
|
|
30
|
-
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; }
|
|
31
|
-
|
|
32
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
33
|
-
|
|
34
|
-
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); } }
|
|
35
|
-
|
|
36
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
37
|
-
|
|
38
|
-
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); }
|
|
39
|
-
|
|
40
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
41
|
-
|
|
42
|
-
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); }; }
|
|
43
|
-
|
|
44
|
-
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); }
|
|
45
|
-
|
|
46
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
47
|
-
|
|
48
|
-
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; } }
|
|
49
|
-
|
|
50
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
51
|
-
|
|
52
|
-
var fallbackProps = {
|
|
12
|
+
const fallbackProps = {
|
|
53
13
|
width: 450,
|
|
54
14
|
height: 300,
|
|
55
15
|
padding: {
|
|
@@ -59,7 +19,7 @@ var fallbackProps = {
|
|
|
59
19
|
left: 20
|
|
60
20
|
}
|
|
61
21
|
};
|
|
62
|
-
|
|
22
|
+
const defaultData = [{
|
|
63
23
|
x: 1,
|
|
64
24
|
min: 5,
|
|
65
25
|
q1: 7,
|
|
@@ -74,7 +34,7 @@ var defaultData = [{
|
|
|
74
34
|
q3: 12,
|
|
75
35
|
max: 15
|
|
76
36
|
}];
|
|
77
|
-
|
|
37
|
+
const options = {
|
|
78
38
|
components: [{
|
|
79
39
|
name: "min"
|
|
80
40
|
}, {
|
|
@@ -101,124 +61,90 @@ var options = {
|
|
|
101
61
|
}]
|
|
102
62
|
};
|
|
103
63
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
64
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-interface
|
|
65
|
+
|
|
66
|
+
class VictoryBoxPlotBase extends _react.default.Component {
|
|
67
|
+
static animationWhitelist = ["data", "domain", "height", "padding", "style", "width"];
|
|
68
|
+
static displayName = "VictoryBoxPlot";
|
|
69
|
+
static role = "boxplot";
|
|
70
|
+
static defaultTransitions = _victoryCore.DefaultTransitions.discreteTransitions();
|
|
71
|
+
static defaultProps = {
|
|
72
|
+
containerComponent: /*#__PURE__*/_react.default.createElement(_victoryCore.VictoryContainer, null),
|
|
73
|
+
data: defaultData,
|
|
74
|
+
dataComponent: /*#__PURE__*/_react.default.createElement(_victoryCore.Box, null),
|
|
75
|
+
groupComponent: /*#__PURE__*/_react.default.createElement("g", {
|
|
76
|
+
role: "presentation"
|
|
77
|
+
}),
|
|
78
|
+
maxComponent: /*#__PURE__*/_react.default.createElement(_victoryCore.Whisker, null),
|
|
79
|
+
maxLabelComponent: /*#__PURE__*/_react.default.createElement(_victoryCore.VictoryLabel, null),
|
|
80
|
+
medianComponent: /*#__PURE__*/_react.default.createElement(_victoryCore.LineSegment, null),
|
|
81
|
+
medianLabelComponent: /*#__PURE__*/_react.default.createElement(_victoryCore.VictoryLabel, null),
|
|
82
|
+
minComponent: /*#__PURE__*/_react.default.createElement(_victoryCore.Whisker, null),
|
|
83
|
+
minLabelComponent: /*#__PURE__*/_react.default.createElement(_victoryCore.VictoryLabel, null),
|
|
84
|
+
q1Component: /*#__PURE__*/_react.default.createElement(_victoryCore.Box, null),
|
|
85
|
+
q1LabelComponent: /*#__PURE__*/_react.default.createElement(_victoryCore.VictoryLabel, null),
|
|
86
|
+
q3Component: /*#__PURE__*/_react.default.createElement(_victoryCore.Box, null),
|
|
87
|
+
q3LabelComponent: /*#__PURE__*/_react.default.createElement(_victoryCore.VictoryLabel, null),
|
|
88
|
+
samples: 50,
|
|
89
|
+
sortKey: "x",
|
|
90
|
+
sortOrder: "ascending",
|
|
91
|
+
standalone: true,
|
|
92
|
+
theme: _victoryCore.VictoryTheme.grayscale
|
|
93
|
+
};
|
|
94
|
+
static getDomain = _helperMethods.getDomain;
|
|
95
|
+
static getData = _helperMethods.getData;
|
|
96
|
+
static getBaseProps = props => (0, _helperMethods.getBaseProps)(props, fallbackProps);
|
|
97
|
+
static expectedComponents = ["maxComponent", "maxLabelComponent", "medianComponent", "medianLabelComponent", "minComponent", "minLabelComponent", "q1Component", "q1LabelComponent", "q3Component", "q3LabelComponent", "groupComponent", "containerComponent"];
|
|
98
|
+
renderBoxPlot(props) {
|
|
99
|
+
const types = ["q1", "q3", "max", "min", "median"];
|
|
100
|
+
const dataComponents = (0, _flatten2.default)(types.map(type => {
|
|
101
|
+
return this.dataKeys.reduce((validDataComponents, _key, index) => {
|
|
102
|
+
const baseComponent = props[`${type}Component`];
|
|
103
|
+
const componentProps = this.getComponentProps(baseComponent, type, index);
|
|
104
|
+
if (this.shouldRenderDatum(componentProps.datum)) {
|
|
105
|
+
validDataComponents.push( /*#__PURE__*/_react.default.cloneElement(baseComponent, componentProps));
|
|
106
|
+
}
|
|
107
|
+
return validDataComponents;
|
|
108
|
+
}, []);
|
|
109
|
+
}));
|
|
110
|
+
const labelComponents = (0, _flatten2.default)(types.map(type => {
|
|
111
|
+
const components = this.dataKeys.reduce((validComponents, _key, index) => {
|
|
112
|
+
const name = `${type}Labels`;
|
|
113
|
+
const baseComponent = props[`${type}LabelComponent`];
|
|
114
|
+
const labelProps = this.getComponentProps(baseComponent, name, index);
|
|
115
|
+
if (labelProps.text !== undefined && labelProps.text !== null) {
|
|
116
|
+
validComponents.push( /*#__PURE__*/_react.default.cloneElement(baseComponent, labelProps));
|
|
117
|
+
}
|
|
118
|
+
return validComponents;
|
|
119
|
+
}, []);
|
|
120
|
+
return components.filter(Boolean);
|
|
121
|
+
}));
|
|
122
|
+
const children = [...dataComponents, ...labelComponents];
|
|
123
|
+
return this.renderContainer(props.groupComponent, children);
|
|
113
124
|
}
|
|
114
125
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
}));
|
|
134
|
-
var labelComponents = (0, _flatten2.default)(types.map(function (type) {
|
|
135
|
-
var components = _this.dataKeys.reduce(function (validComponents, _key, index) {
|
|
136
|
-
var name = "".concat(type, "Labels");
|
|
137
|
-
var baseComponent = props["".concat(type, "LabelComponent")];
|
|
138
|
-
|
|
139
|
-
var labelProps = _this.getComponentProps(baseComponent, name, index);
|
|
140
|
-
|
|
141
|
-
if (labelProps.text !== undefined && labelProps.text !== null) {
|
|
142
|
-
validComponents.push( /*#__PURE__*/_react.default.cloneElement(baseComponent, labelProps));
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
return validComponents;
|
|
146
|
-
}, []);
|
|
147
|
-
|
|
148
|
-
return components.filter(Boolean);
|
|
149
|
-
}));
|
|
150
|
-
var children = [].concat(_toConsumableArray(dataComponents), _toConsumableArray(labelComponents));
|
|
151
|
-
return this.renderContainer(props.groupComponent, children);
|
|
152
|
-
} // Overridden in native versions
|
|
153
|
-
|
|
154
|
-
}, {
|
|
155
|
-
key: "shouldAnimate",
|
|
156
|
-
value: function shouldAnimate() {
|
|
157
|
-
return !!this.props.animate;
|
|
158
|
-
}
|
|
159
|
-
}, {
|
|
160
|
-
key: "shouldRenderDatum",
|
|
161
|
-
value: function shouldRenderDatum(datum) {
|
|
162
|
-
var hasX = !(0, _isNil2.default)(datum._x);
|
|
163
|
-
var hasY = !(0, _isNil2.default)(datum._y);
|
|
164
|
-
var hasSummaryStatistics = !(0, _isNil2.default)(datum._min) && !(0, _isNil2.default)(datum._max) && !(0, _isNil2.default)(datum._median) && !(0, _isNil2.default)(datum._q1) && !(0, _isNil2.default)(datum._q3);
|
|
165
|
-
return hasSummaryStatistics && (this.props.horizontal ? hasY : hasX);
|
|
166
|
-
}
|
|
167
|
-
}, {
|
|
168
|
-
key: "render",
|
|
169
|
-
value: function render() {
|
|
170
|
-
var animationWhitelist = VictoryBoxPlot.animationWhitelist,
|
|
171
|
-
role = VictoryBoxPlot.role;
|
|
172
|
-
|
|
173
|
-
var props = _victoryCore.Helpers.modifyProps(this.props, fallbackProps, role);
|
|
174
|
-
|
|
175
|
-
if (this.shouldAnimate()) {
|
|
176
|
-
return this.animateComponent(props, animationWhitelist);
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
var children = this.renderBoxPlot(props);
|
|
180
|
-
var component = props.standalone ? this.renderContainer(props.containerComponent, children) : children;
|
|
181
|
-
return _victoryCore.UserProps.withSafeUserProps(component, props);
|
|
126
|
+
// Overridden in native versions
|
|
127
|
+
shouldAnimate() {
|
|
128
|
+
return !!this.props.animate;
|
|
129
|
+
}
|
|
130
|
+
shouldRenderDatum(datum) {
|
|
131
|
+
const hasX = !_victoryCore.Helpers.isNil(datum._x);
|
|
132
|
+
const hasY = !_victoryCore.Helpers.isNil(datum._y);
|
|
133
|
+
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);
|
|
134
|
+
return hasSummaryStatistics && (this.props.horizontal ? hasY : hasX);
|
|
135
|
+
}
|
|
136
|
+
render() {
|
|
137
|
+
const {
|
|
138
|
+
animationWhitelist,
|
|
139
|
+
role
|
|
140
|
+
} = VictoryBoxPlot;
|
|
141
|
+
const props = _victoryCore.Helpers.modifyProps(this.props, fallbackProps, role);
|
|
142
|
+
if (this.shouldAnimate()) {
|
|
143
|
+
return this.animateComponent(props, animationWhitelist);
|
|
182
144
|
}
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
VictoryBoxPlotBase.displayName = "VictoryBoxPlot";
|
|
190
|
-
VictoryBoxPlotBase.role = "boxplot";
|
|
191
|
-
VictoryBoxPlotBase.defaultTransitions = _victoryCore.DefaultTransitions.discreteTransitions();
|
|
192
|
-
VictoryBoxPlotBase.defaultProps = {
|
|
193
|
-
containerComponent: /*#__PURE__*/_react.default.createElement(_victoryCore.VictoryContainer, null),
|
|
194
|
-
data: defaultData,
|
|
195
|
-
dataComponent: /*#__PURE__*/_react.default.createElement(_victoryCore.Box, null),
|
|
196
|
-
groupComponent: /*#__PURE__*/_react.default.createElement("g", {
|
|
197
|
-
role: "presentation"
|
|
198
|
-
}),
|
|
199
|
-
maxComponent: /*#__PURE__*/_react.default.createElement(_victoryCore.Whisker, null),
|
|
200
|
-
maxLabelComponent: /*#__PURE__*/_react.default.createElement(_victoryCore.VictoryLabel, null),
|
|
201
|
-
medianComponent: /*#__PURE__*/_react.default.createElement(_victoryCore.LineSegment, null),
|
|
202
|
-
medianLabelComponent: /*#__PURE__*/_react.default.createElement(_victoryCore.VictoryLabel, null),
|
|
203
|
-
minComponent: /*#__PURE__*/_react.default.createElement(_victoryCore.Whisker, null),
|
|
204
|
-
minLabelComponent: /*#__PURE__*/_react.default.createElement(_victoryCore.VictoryLabel, null),
|
|
205
|
-
q1Component: /*#__PURE__*/_react.default.createElement(_victoryCore.Box, null),
|
|
206
|
-
q1LabelComponent: /*#__PURE__*/_react.default.createElement(_victoryCore.VictoryLabel, null),
|
|
207
|
-
q3Component: /*#__PURE__*/_react.default.createElement(_victoryCore.Box, null),
|
|
208
|
-
q3LabelComponent: /*#__PURE__*/_react.default.createElement(_victoryCore.VictoryLabel, null),
|
|
209
|
-
samples: 50,
|
|
210
|
-
sortKey: "x",
|
|
211
|
-
sortOrder: "ascending",
|
|
212
|
-
standalone: true,
|
|
213
|
-
theme: _victoryCore.VictoryTheme.grayscale
|
|
214
|
-
};
|
|
215
|
-
VictoryBoxPlotBase.getDomain = _helperMethods.getDomain;
|
|
216
|
-
VictoryBoxPlotBase.getData = _helperMethods.getData;
|
|
217
|
-
|
|
218
|
-
VictoryBoxPlotBase.getBaseProps = function (props) {
|
|
219
|
-
return (0, _helperMethods.getBaseProps)(props, fallbackProps);
|
|
220
|
-
};
|
|
221
|
-
|
|
222
|
-
VictoryBoxPlotBase.expectedComponents = ["maxComponent", "maxLabelComponent", "medianComponent", "medianLabelComponent", "minComponent", "minLabelComponent", "q1Component", "q1LabelComponent", "q3Component", "q3LabelComponent", "groupComponent", "containerComponent"];
|
|
223
|
-
var VictoryBoxPlot = (0, _victoryCore.addEvents)(VictoryBoxPlotBase, options);
|
|
224
|
-
exports.VictoryBoxPlot = VictoryBoxPlot;
|
|
145
|
+
const children = this.renderBoxPlot(props);
|
|
146
|
+
const component = props.standalone ? this.renderContainer(props.containerComponent, children) : children;
|
|
147
|
+
return _victoryCore.UserProps.withSafeUserProps(component, props);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
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": "36.9.
|
|
3
|
+
"version": "36.9.2-next.0",
|
|
4
4
|
"description": "Box Plot Component for Victory",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"data visualization",
|
|
@@ -21,18 +21,14 @@
|
|
|
21
21
|
"license": "MIT",
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"lodash": "^4.17.19",
|
|
24
|
-
"victory-core": "^36.9.
|
|
25
|
-
"victory-vendor": "^36.9.
|
|
24
|
+
"victory-core": "^36.9.2-next.0",
|
|
25
|
+
"victory-vendor": "^36.9.2-next.0"
|
|
26
26
|
},
|
|
27
27
|
"peerDependencies": {
|
|
28
28
|
"react": ">=16.6.0"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
|
-
"victory-
|
|
32
|
-
"victory-chart": "^36.9.1"
|
|
33
|
-
},
|
|
34
|
-
"publishConfig": {
|
|
35
|
-
"provenance": true
|
|
31
|
+
"victory-chart": "36.9.2-next.0"
|
|
36
32
|
},
|
|
37
33
|
"wireit": {
|
|
38
34
|
"### THESE WIREIT CONFIGS ARE GENERATED ####": {},
|
|
@@ -256,7 +252,7 @@
|
|
|
256
252
|
]
|
|
257
253
|
},
|
|
258
254
|
"jest": {
|
|
259
|
-
"command": "
|
|
255
|
+
"command": "jest --passWithNoTests",
|
|
260
256
|
"files": [
|
|
261
257
|
"src/**/*.test.*",
|
|
262
258
|
"../../.babelrc.js",
|
|
@@ -265,10 +261,10 @@
|
|
|
265
261
|
],
|
|
266
262
|
"output": [],
|
|
267
263
|
"dependencies": [
|
|
268
|
-
"build
|
|
269
|
-
"../victory-
|
|
270
|
-
"../victory-
|
|
271
|
-
"../victory-voronoi:build
|
|
264
|
+
"../victory-core:build",
|
|
265
|
+
"../victory-vendor:build",
|
|
266
|
+
"../victory-chart:build",
|
|
267
|
+
"../victory-voronoi:build"
|
|
272
268
|
],
|
|
273
269
|
"packageLocks": [
|
|
274
270
|
"pnpm-lock.yaml"
|