victory-box-plot 36.9.1 → 36.9.2-next.1

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.
@@ -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
@@ -5,10 +5,6 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.VictoryBoxPlot = void 0;
7
7
 
8
- var _isNil2 = _interopRequireDefault(require("lodash/isNil"));
9
-
10
- var _flatten2 = _interopRequireDefault(require("lodash/flatten"));
11
-
12
8
  var _react = _interopRequireDefault(require("react"));
13
9
 
14
10
  var _victoryCore = require("victory-core");
@@ -118,7 +114,7 @@ var VictoryBoxPlotBase = /*#__PURE__*/function (_React$Component) {
118
114
  var _this = this;
119
115
 
120
116
  var types = ["q1", "q3", "max", "min", "median"];
121
- var dataComponents = (0, _flatten2.default)(types.map(function (type) {
117
+ var dataComponents = types.map(function (type) {
122
118
  return _this.dataKeys.reduce(function (validDataComponents, _key, index) {
123
119
  var baseComponent = props["".concat(type, "Component")];
124
120
 
@@ -130,8 +126,8 @@ var VictoryBoxPlotBase = /*#__PURE__*/function (_React$Component) {
130
126
 
131
127
  return validDataComponents;
132
128
  }, []);
133
- }));
134
- var labelComponents = (0, _flatten2.default)(types.map(function (type) {
129
+ }).flat();
130
+ var labelComponents = types.map(function (type) {
135
131
  var components = _this.dataKeys.reduce(function (validComponents, _key, index) {
136
132
  var name = "".concat(type, "Labels");
137
133
  var baseComponent = props["".concat(type, "LabelComponent")];
@@ -146,7 +142,7 @@ var VictoryBoxPlotBase = /*#__PURE__*/function (_React$Component) {
146
142
  }, []);
147
143
 
148
144
  return components.filter(Boolean);
149
- }));
145
+ }).flat();
150
146
  var children = [].concat(_toConsumableArray(dataComponents), _toConsumableArray(labelComponents));
151
147
  return this.renderContainer(props.groupComponent, children);
152
148
  } // Overridden in native versions
@@ -159,9 +155,9 @@ var VictoryBoxPlotBase = /*#__PURE__*/function (_React$Component) {
159
155
  }, {
160
156
  key: "shouldRenderDatum",
161
157
  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);
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);
165
161
  return hasSummaryStatistics && (this.props.horizontal ? hasY : hasX);
166
162
  }
167
163
  }, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "victory-box-plot",
3
- "version": "36.9.1",
3
+ "version": "36.9.2-next.1",
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.1",
25
- "victory-vendor": "^36.9.1"
24
+ "victory-core": "^36.9.2-next.1",
25
+ "victory-vendor": "^36.9.2-next.1"
26
26
  },
27
27
  "peerDependencies": {
28
28
  "react": ">=16.6.0"
29
29
  },
30
30
  "devDependencies": {
31
- "victory-box-plot": "*",
32
- "victory-chart": "^36.9.1"
33
- },
34
- "publishConfig": {
35
- "provenance": true
31
+ "victory-chart": "36.9.2-next.1"
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": "nps jest:pkg",
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:lib:cjs",
269
- "../victory-chart:build:lib:cjs",
270
- "../victory-vendor:build:lib:cjs",
271
- "../victory-voronoi:build:lib:cjs"
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"
@@ -1,4 +1,4 @@
1
- import { orderBy, defaults, uniq, groupBy, keys, isNaN, isNil } from "lodash";
1
+ import { orderBy, defaults, uniq, groupBy } from "lodash";
2
2
  import { Helpers, Scale, Domain, Data, Collection } from "victory-core";
3
3
  import {
4
4
  min as d3Min,
@@ -30,7 +30,7 @@ const checkProcessedData = (data) => {
30
30
  return false;
31
31
  };
32
32
 
33
- const nanToNull = (val) => (isNaN(val) ? null : val);
33
+ const nanToNull = (val) => (Number.isNaN(val) ? null : val);
34
34
 
35
35
  const getSummaryStatistics = (data) => {
36
36
  const dependentVars = data.map((datum) => datum._y);
@@ -72,7 +72,7 @@ const processData = (data) => {
72
72
  } else {
73
73
  /* Group data by independent variable and generate summary statistics for each group */
74
74
  const groupedData = groupBy(data, groupKey);
75
- return keys(groupedData).map((key) => {
75
+ return Object.keys(groupedData).map((key) => {
76
76
  const datum = groupedData[key];
77
77
  const sortedData = orderBy(datum, sortKey);
78
78
  return getSummaryStatistics(sortedData);
@@ -493,7 +493,7 @@ export const getBaseProps = (initialProps, fallbackProps) => {
493
493
  };
494
494
  const boxScale = scale.y;
495
495
  return data.reduce((acc, datum, index) => {
496
- const eventKey = !isNil(datum.eventKey) ? datum.eventKey : index;
496
+ const eventKey = !Helpers.isNil(datum.eventKey) ? datum.eventKey : index;
497
497
 
498
498
  if (isDatumOutOfBounds(datum, domain)) return acc;
499
499
 
@@ -1,5 +1,4 @@
1
1
  import React from "react";
2
- import { flatten, isNil } from "lodash";
3
2
  import {
4
3
  Helpers,
5
4
  VictoryLabel,
@@ -182,8 +181,8 @@ class VictoryBoxPlotBase extends React.Component<VictoryBoxPlotProps> {
182
181
 
183
182
  renderBoxPlot(props) {
184
183
  const types = ["q1", "q3", "max", "min", "median"];
185
- const dataComponents = flatten(
186
- types.map((type) => {
184
+ const dataComponents = types
185
+ .map((type) => {
187
186
  return this.dataKeys.reduce((validDataComponents, _key, index) => {
188
187
  const baseComponent = props[`${type}Component`];
189
188
  const componentProps = this.getComponentProps(
@@ -198,11 +197,11 @@ class VictoryBoxPlotBase extends React.Component<VictoryBoxPlotProps> {
198
197
  }
199
198
  return validDataComponents;
200
199
  }, [] as React.ReactElement[]);
201
- }),
202
- );
200
+ })
201
+ .flat();
203
202
 
204
- const labelComponents = flatten(
205
- types.map((type) => {
203
+ const labelComponents = types
204
+ .map((type) => {
206
205
  const components = this.dataKeys.reduce(
207
206
  (validComponents, _key, index) => {
208
207
  const name = `${type}Labels`;
@@ -222,8 +221,9 @@ class VictoryBoxPlotBase extends React.Component<VictoryBoxPlotProps> {
222
221
  [] as React.ReactElement[],
223
222
  );
224
223
  return components.filter(Boolean);
225
- }),
226
- );
224
+ })
225
+ .flat();
226
+
227
227
  const children = [...dataComponents, ...labelComponents];
228
228
  return this.renderContainer(props.groupComponent, children);
229
229
  }
@@ -234,14 +234,14 @@ class VictoryBoxPlotBase extends React.Component<VictoryBoxPlotProps> {
234
234
  }
235
235
 
236
236
  shouldRenderDatum(datum) {
237
- const hasX = !isNil(datum._x);
238
- const hasY = !isNil(datum._y);
237
+ const hasX = !Helpers.isNil(datum._x);
238
+ const hasY = !Helpers.isNil(datum._y);
239
239
  const hasSummaryStatistics =
240
- !isNil(datum._min) &&
241
- !isNil(datum._max) &&
242
- !isNil(datum._median) &&
243
- !isNil(datum._q1) &&
244
- !isNil(datum._q3);
240
+ !Helpers.isNil(datum._min) &&
241
+ !Helpers.isNil(datum._max) &&
242
+ !Helpers.isNil(datum._median) &&
243
+ !Helpers.isNil(datum._q1) &&
244
+ !Helpers.isNil(datum._q3);
245
245
 
246
246
  return hasSummaryStatistics && (this.props.horizontal ? hasY : hasX);
247
247
  }
package/LICENSE.txt DELETED
@@ -1,30 +0,0 @@
1
- The MIT License (MIT)
2
-
3
- Copyright (c) 2015-2020 Formidable Labs.
4
-
5
- Copyright (c) 2016-2020 Alexey Svetliakov <https://github.com/asvetliakov>,
6
- snerks <https://github.com/snerks>, Krzysztof Cebula <https://github.com
7
- Havret>, Vitaliy Polyanskiy <https://github.com/alreadyExisted>, James Lismore
8
- <https://github.com/jlismore>, Stack Builders <https://github.com
9
- stackbuilders>, Esteban Ibarra <https://github.com/ibarrae>, Dominic Lee
10
- <https://github.com/dominictwlee>, Dave Vedder <https://github.com
11
- veddermatic>, Alec Flett <https://github.com/alecf> and potentially other
12
- DefinitelyTyped contributors.
13
-
14
- Permission is hereby granted, free of charge, to any person obtaining a copy
15
- of this software and associated documentation files (the "Software"), to deal
16
- in the Software without restriction, including without limitation the rights
17
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
18
- copies of the Software, and to permit persons to whom the Software is
19
- furnished to do so, subject to the following conditions:
20
-
21
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
27
- SOFTWARE.
28
-
29
- The above copyright notice and this permission notice shall be included in all
30
- copies or substantial portions of the Software.