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/es/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
@@ -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
@@ -1,39 +1,7 @@
1
- function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
2
-
3
- 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."); }
4
-
5
- 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); }
6
-
7
- function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
8
-
9
- function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
10
-
11
- 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; }
12
-
13
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
14
-
15
- 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); } }
16
-
17
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
18
-
19
- 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); }
20
-
21
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
22
-
23
- 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); }; }
24
-
25
- 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); }
26
-
27
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
28
-
29
- 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; } }
30
-
31
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
32
-
33
1
  import React from "react";
34
2
  import { Helpers, VictoryLabel, addEvents, LineSegment, VictoryContainer, VictoryTheme, Box, Whisker, DefaultTransitions, UserProps } from "victory-core";
35
3
  import { getDomain, getData, getBaseProps } from "./helper-methods";
36
- var fallbackProps = {
4
+ const fallbackProps = {
37
5
  width: 450,
38
6
  height: 300,
39
7
  padding: {
@@ -43,7 +11,7 @@ var fallbackProps = {
43
11
  left: 20
44
12
  }
45
13
  };
46
- var defaultData = [{
14
+ const defaultData = [{
47
15
  x: 1,
48
16
  min: 5,
49
17
  q1: 7,
@@ -58,7 +26,7 @@ var defaultData = [{
58
26
  q3: 12,
59
27
  max: 15
60
28
  }];
61
- var options = {
29
+ const options = {
62
30
  components: [{
63
31
  name: "min"
64
32
  }, {
@@ -85,122 +53,92 @@ var options = {
85
53
  }]
86
54
  };
87
55
 
88
- var VictoryBoxPlotBase = /*#__PURE__*/function (_React$Component) {
89
- _inherits(VictoryBoxPlotBase, _React$Component);
90
-
91
- var _super = _createSuper(VictoryBoxPlotBase);
92
-
93
- function VictoryBoxPlotBase() {
94
- _classCallCheck(this, VictoryBoxPlotBase);
95
-
96
- return _super.apply(this, arguments);
56
+ // eslint-disable-next-line @typescript-eslint/no-empty-interface
57
+
58
+ class VictoryBoxPlotBase extends React.Component {
59
+ static animationWhitelist = ["data", "domain", "height", "padding", "style", "width"];
60
+ static displayName = "VictoryBoxPlot";
61
+ static role = "boxplot";
62
+ static defaultTransitions = DefaultTransitions.discreteTransitions();
63
+ static defaultProps = {
64
+ containerComponent: /*#__PURE__*/React.createElement(VictoryContainer, null),
65
+ data: defaultData,
66
+ dataComponent: /*#__PURE__*/React.createElement(Box, null),
67
+ groupComponent: /*#__PURE__*/React.createElement("g", {
68
+ role: "presentation"
69
+ }),
70
+ maxComponent: /*#__PURE__*/React.createElement(Whisker, null),
71
+ maxLabelComponent: /*#__PURE__*/React.createElement(VictoryLabel, null),
72
+ medianComponent: /*#__PURE__*/React.createElement(LineSegment, null),
73
+ medianLabelComponent: /*#__PURE__*/React.createElement(VictoryLabel, null),
74
+ minComponent: /*#__PURE__*/React.createElement(Whisker, null),
75
+ minLabelComponent: /*#__PURE__*/React.createElement(VictoryLabel, null),
76
+ q1Component: /*#__PURE__*/React.createElement(Box, null),
77
+ q1LabelComponent: /*#__PURE__*/React.createElement(VictoryLabel, null),
78
+ q3Component: /*#__PURE__*/React.createElement(Box, null),
79
+ q3LabelComponent: /*#__PURE__*/React.createElement(VictoryLabel, null),
80
+ samples: 50,
81
+ sortKey: "x",
82
+ sortOrder: "ascending",
83
+ standalone: true,
84
+ theme: VictoryTheme.grayscale
85
+ };
86
+ static getDomain = getDomain;
87
+ static getData = getData;
88
+ static getBaseProps(props) {
89
+ return getBaseProps(props, fallbackProps);
90
+ }
91
+ static expectedComponents = ["maxComponent", "maxLabelComponent", "medianComponent", "medianLabelComponent", "minComponent", "minLabelComponent", "q1Component", "q1LabelComponent", "q3Component", "q3LabelComponent", "groupComponent", "containerComponent"];
92
+ renderBoxPlot(props) {
93
+ const types = ["q1", "q3", "max", "min", "median"];
94
+ const dataComponents = types.map(type => {
95
+ return this.dataKeys.reduce((validDataComponents, _key, index) => {
96
+ const baseComponent = props[`${type}Component`];
97
+ const componentProps = this.getComponentProps(baseComponent, type, index);
98
+ if (this.shouldRenderDatum(componentProps.datum)) {
99
+ validDataComponents.push( /*#__PURE__*/React.cloneElement(baseComponent, componentProps));
100
+ }
101
+ return validDataComponents;
102
+ }, []);
103
+ }).flat();
104
+ const labelComponents = types.map(type => {
105
+ const components = this.dataKeys.reduce((validComponents, _key, index) => {
106
+ const name = `${type}Labels`;
107
+ const baseComponent = props[`${type}LabelComponent`];
108
+ const labelProps = this.getComponentProps(baseComponent, name, index);
109
+ if (labelProps.text !== undefined && labelProps.text !== null) {
110
+ validComponents.push( /*#__PURE__*/React.cloneElement(baseComponent, labelProps));
111
+ }
112
+ return validComponents;
113
+ }, []);
114
+ return components.filter(Boolean);
115
+ }).flat();
116
+ const children = [...dataComponents, ...labelComponents];
117
+ return this.renderContainer(props.groupComponent, children);
97
118
  }
98
119
 
99
- _createClass(VictoryBoxPlotBase, [{
100
- key: "renderBoxPlot",
101
- value: function renderBoxPlot(props) {
102
- var _this = this;
103
-
104
- var types = ["q1", "q3", "max", "min", "median"];
105
- var dataComponents = types.map(function (type) {
106
- return _this.dataKeys.reduce(function (validDataComponents, _key, index) {
107
- var baseComponent = props["".concat(type, "Component")];
108
-
109
- var componentProps = _this.getComponentProps(baseComponent, type, index);
110
-
111
- if (_this.shouldRenderDatum(componentProps.datum)) {
112
- validDataComponents.push( /*#__PURE__*/React.cloneElement(baseComponent, componentProps));
113
- }
114
-
115
- return validDataComponents;
116
- }, []);
117
- }).flat();
118
- var labelComponents = types.map(function (type) {
119
- var components = _this.dataKeys.reduce(function (validComponents, _key, index) {
120
- var name = "".concat(type, "Labels");
121
- var baseComponent = props["".concat(type, "LabelComponent")];
122
-
123
- var labelProps = _this.getComponentProps(baseComponent, name, index);
124
-
125
- if (labelProps.text !== undefined && labelProps.text !== null) {
126
- validComponents.push( /*#__PURE__*/React.cloneElement(baseComponent, labelProps));
127
- }
128
-
129
- return validComponents;
130
- }, []);
131
-
132
- return components.filter(Boolean);
133
- }).flat();
134
- var children = [].concat(_toConsumableArray(dataComponents), _toConsumableArray(labelComponents));
135
- return this.renderContainer(props.groupComponent, children);
136
- } // Overridden in native versions
137
-
138
- }, {
139
- key: "shouldAnimate",
140
- value: function shouldAnimate() {
141
- return !!this.props.animate;
142
- }
143
- }, {
144
- key: "shouldRenderDatum",
145
- value: function shouldRenderDatum(datum) {
146
- var hasX = !Helpers.isNil(datum._x);
147
- var hasY = !Helpers.isNil(datum._y);
148
- var hasSummaryStatistics = !Helpers.isNil(datum._min) && !Helpers.isNil(datum._max) && !Helpers.isNil(datum._median) && !Helpers.isNil(datum._q1) && !Helpers.isNil(datum._q3);
149
- return hasSummaryStatistics && (this.props.horizontal ? hasY : hasX);
150
- }
151
- }, {
152
- key: "render",
153
- value: function render() {
154
- var animationWhitelist = VictoryBoxPlot.animationWhitelist,
155
- role = VictoryBoxPlot.role;
156
- var props = Helpers.modifyProps(this.props, fallbackProps, role);
157
-
158
- if (this.shouldAnimate()) {
159
- return this.animateComponent(props, animationWhitelist);
160
- }
161
-
162
- var children = this.renderBoxPlot(props);
163
- var component = props.standalone ? this.renderContainer(props.containerComponent, children) : children;
164
- return UserProps.withSafeUserProps(component, props);
120
+ // Overridden in native versions
121
+ shouldAnimate() {
122
+ return !!this.props.animate;
123
+ }
124
+ shouldRenderDatum(datum) {
125
+ const hasX = !Helpers.isNil(datum._x);
126
+ const hasY = !Helpers.isNil(datum._y);
127
+ const hasSummaryStatistics = !Helpers.isNil(datum._min) && !Helpers.isNil(datum._max) && !Helpers.isNil(datum._median) && !Helpers.isNil(datum._q1) && !Helpers.isNil(datum._q3);
128
+ return hasSummaryStatistics && (this.props.horizontal ? hasY : hasX);
129
+ }
130
+ render() {
131
+ const {
132
+ animationWhitelist,
133
+ role
134
+ } = VictoryBoxPlot;
135
+ const props = Helpers.modifyProps(this.props, fallbackProps, role);
136
+ if (this.shouldAnimate()) {
137
+ return this.animateComponent(props, animationWhitelist);
165
138
  }
166
- }]);
167
-
168
- return VictoryBoxPlotBase;
169
- }(React.Component);
170
-
171
- VictoryBoxPlotBase.animationWhitelist = ["data", "domain", "height", "padding", "style", "width"];
172
- VictoryBoxPlotBase.displayName = "VictoryBoxPlot";
173
- VictoryBoxPlotBase.role = "boxplot";
174
- VictoryBoxPlotBase.defaultTransitions = DefaultTransitions.discreteTransitions();
175
- VictoryBoxPlotBase.defaultProps = {
176
- containerComponent: /*#__PURE__*/React.createElement(VictoryContainer, null),
177
- data: defaultData,
178
- dataComponent: /*#__PURE__*/React.createElement(Box, null),
179
- groupComponent: /*#__PURE__*/React.createElement("g", {
180
- role: "presentation"
181
- }),
182
- maxComponent: /*#__PURE__*/React.createElement(Whisker, null),
183
- maxLabelComponent: /*#__PURE__*/React.createElement(VictoryLabel, null),
184
- medianComponent: /*#__PURE__*/React.createElement(LineSegment, null),
185
- medianLabelComponent: /*#__PURE__*/React.createElement(VictoryLabel, null),
186
- minComponent: /*#__PURE__*/React.createElement(Whisker, null),
187
- minLabelComponent: /*#__PURE__*/React.createElement(VictoryLabel, null),
188
- q1Component: /*#__PURE__*/React.createElement(Box, null),
189
- q1LabelComponent: /*#__PURE__*/React.createElement(VictoryLabel, null),
190
- q3Component: /*#__PURE__*/React.createElement(Box, null),
191
- q3LabelComponent: /*#__PURE__*/React.createElement(VictoryLabel, null),
192
- samples: 50,
193
- sortKey: "x",
194
- sortOrder: "ascending",
195
- standalone: true,
196
- theme: VictoryTheme.grayscale
197
- };
198
- VictoryBoxPlotBase.getDomain = getDomain;
199
- VictoryBoxPlotBase.getData = getData;
200
-
201
- VictoryBoxPlotBase.getBaseProps = function (props) {
202
- return getBaseProps(props, fallbackProps);
203
- };
204
-
205
- VictoryBoxPlotBase.expectedComponents = ["maxComponent", "maxLabelComponent", "medianComponent", "medianLabelComponent", "minComponent", "minLabelComponent", "q1Component", "q1LabelComponent", "q3Component", "q3LabelComponent", "groupComponent", "containerComponent"];
206
- export var VictoryBoxPlot = addEvents(VictoryBoxPlotBase, options);
139
+ const children = this.renderBoxPlot(props);
140
+ const component = props.standalone ? this.renderContainer(props.containerComponent, children) : children;
141
+ return UserProps.withSafeUserProps(component, props);
142
+ }
143
+ }
144
+ export const VictoryBoxPlot = addEvents(VictoryBoxPlotBase, options);
@@ -1,4 +1,4 @@
1
- export declare const getData: (props: any) => any;
2
- export declare const getDomain: (props: any, axis: any) => any;
3
- export declare const getBaseProps: (initialProps: any, fallbackProps: any) => any;
1
+ export declare const getData: (props: any) => any;
2
+ export declare const getDomain: (props: any, axis: any) => any;
3
+ export declare const getBaseProps: (initialProps: any, fallbackProps: any) => any;
4
4
  //# sourceMappingURL=helper-methods.d.ts.map