victory-box-plot 36.4.0 → 36.5.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.
- package/dist/victory-box-plot.js +1262 -1084
- package/dist/victory-box-plot.min.js +1 -1
- package/es/helper-methods.js +2 -1
- package/es/index.d.ts +1 -1
- package/es/index.js +2 -1
- package/es/victory-box-plot.js +21 -28
- package/lib/helper-methods.js +2 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +2 -1
- package/lib/victory-box-plot.js +21 -29
- package/package.json +6 -6
- package/src/helper-methods.js +32 -32
- package/src/index.d.ts +1 -1
- package/src/victory-box-plot.js +41 -43
package/es/helper-methods.js
CHANGED
package/es/index.d.ts
CHANGED
package/es/index.js
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export { default as VictoryBoxPlot } from "./victory-box-plot";
|
|
1
|
+
export { default as VictoryBoxPlot } from "./victory-box-plot";
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
package/es/victory-box-plot.js
CHANGED
|
@@ -5,6 +5,8 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
5
5
|
|
|
6
6
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
7
7
|
|
|
8
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
9
|
+
|
|
8
10
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
9
11
|
|
|
10
12
|
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."); }
|
|
@@ -25,7 +27,7 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
|
|
|
25
27
|
|
|
26
28
|
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); }
|
|
27
29
|
|
|
28
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf
|
|
30
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
29
31
|
|
|
30
32
|
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); }; }
|
|
31
33
|
|
|
@@ -35,9 +37,7 @@ function _assertThisInitialized(self) { if (self === void 0) { throw new Referen
|
|
|
35
37
|
|
|
36
38
|
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; } }
|
|
37
39
|
|
|
38
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
39
|
-
|
|
40
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
40
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
41
41
|
|
|
42
42
|
import React from "react";
|
|
43
43
|
import PropTypes from "prop-types";
|
|
@@ -173,23 +173,19 @@ var VictoryBoxPlot = /*#__PURE__*/function (_React$Component) {
|
|
|
173
173
|
}
|
|
174
174
|
|
|
175
175
|
var children = this.renderBoxPlot(props);
|
|
176
|
-
var
|
|
177
|
-
return
|
|
176
|
+
var component = props.standalone ? this.renderContainer(props.containerComponent, children) : children;
|
|
177
|
+
return UserProps.withSafeUserProps(component, props);
|
|
178
178
|
}
|
|
179
179
|
}]);
|
|
180
180
|
|
|
181
181
|
return VictoryBoxPlot;
|
|
182
182
|
}(React.Component);
|
|
183
183
|
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
_defineProperty(VictoryBoxPlot, "defaultTransitions", DefaultTransitions.discreteTransitions());
|
|
191
|
-
|
|
192
|
-
_defineProperty(VictoryBoxPlot, "propTypes", _objectSpread(_objectSpread(_objectSpread({}, CommonProps.baseProps), CommonProps.dataProps), {}, {
|
|
184
|
+
VictoryBoxPlot.animationWhitelist = ["data", "domain", "height", "padding", "style", "width"];
|
|
185
|
+
VictoryBoxPlot.displayName = "VictoryBoxPlot";
|
|
186
|
+
VictoryBoxPlot.role = "boxplot";
|
|
187
|
+
VictoryBoxPlot.defaultTransitions = DefaultTransitions.discreteTransitions();
|
|
188
|
+
VictoryBoxPlot.propTypes = _objectSpread(_objectSpread(_objectSpread({}, CommonProps.baseProps), CommonProps.dataProps), {}, {
|
|
193
189
|
boxWidth: PropTypes.number,
|
|
194
190
|
events: PropTypes.arrayOf(PropTypes.shape({
|
|
195
191
|
target: PropTypes.oneOf(["max", "maxLabels", "median", "medianLabels", "min", "minLabels", "q1", "q1Labels", "q3", "q3Labels", "parent"]),
|
|
@@ -242,9 +238,8 @@ _defineProperty(VictoryBoxPlot, "propTypes", _objectSpread(_objectSpread(_object
|
|
|
242
238
|
whiskers: PropTypes.object
|
|
243
239
|
}),
|
|
244
240
|
whiskerWidth: PropTypes.number
|
|
245
|
-
})
|
|
246
|
-
|
|
247
|
-
_defineProperty(VictoryBoxPlot, "defaultProps", {
|
|
241
|
+
});
|
|
242
|
+
VictoryBoxPlot.defaultProps = {
|
|
248
243
|
containerComponent: /*#__PURE__*/React.createElement(VictoryContainer, null),
|
|
249
244
|
data: defaultData,
|
|
250
245
|
dataComponent: /*#__PURE__*/React.createElement(Box, null),
|
|
@@ -266,16 +261,14 @@ _defineProperty(VictoryBoxPlot, "defaultProps", {
|
|
|
266
261
|
sortOrder: "ascending",
|
|
267
262
|
standalone: true,
|
|
268
263
|
theme: VictoryTheme.grayscale
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
_defineProperty(VictoryBoxPlot, "getData", getData);
|
|
264
|
+
};
|
|
265
|
+
VictoryBoxPlot.getDomain = getDomain;
|
|
266
|
+
VictoryBoxPlot.getData = getData;
|
|
274
267
|
|
|
275
|
-
|
|
268
|
+
VictoryBoxPlot.getBaseProps = function (props) {
|
|
276
269
|
return getBaseProps(props, fallbackProps);
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
_defineProperty(VictoryBoxPlot, "expectedComponents", ["maxComponent", "maxLabelComponent", "medianComponent", "medianLabelComponent", "minComponent", "minLabelComponent", "q1Component", "q1LabelComponent", "q3Component", "q3LabelComponent", "groupComponent", "containerComponent"]);
|
|
270
|
+
};
|
|
280
271
|
|
|
281
|
-
|
|
272
|
+
VictoryBoxPlot.expectedComponents = ["maxComponent", "maxLabelComponent", "medianComponent", "medianLabelComponent", "minComponent", "minLabelComponent", "q1Component", "q1LabelComponent", "q3Component", "q3LabelComponent", "groupComponent", "containerComponent"];
|
|
273
|
+
export default addEvents(VictoryBoxPlot, options);
|
|
274
|
+
//# sourceMappingURL=victory-box-plot.js.map
|
package/lib/helper-methods.js
CHANGED
package/lib/index.d.ts
CHANGED
package/lib/index.js
CHANGED
|
@@ -12,4 +12,5 @@ Object.defineProperty(exports, "VictoryBoxPlot", {
|
|
|
12
12
|
|
|
13
13
|
var _victoryBoxPlot = _interopRequireDefault(require("./victory-box-plot"));
|
|
14
14
|
|
|
15
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
16
|
+
//# sourceMappingURL=index.js.map
|
package/lib/victory-box-plot.js
CHANGED
|
@@ -23,6 +23,8 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
23
23
|
|
|
24
24
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
25
25
|
|
|
26
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
27
|
+
|
|
26
28
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
27
29
|
|
|
28
30
|
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."); }
|
|
@@ -43,7 +45,7 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
|
|
|
43
45
|
|
|
44
46
|
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); }
|
|
45
47
|
|
|
46
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf
|
|
48
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
47
49
|
|
|
48
50
|
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); }; }
|
|
49
51
|
|
|
@@ -53,9 +55,7 @@ function _assertThisInitialized(self) { if (self === void 0) { throw new Referen
|
|
|
53
55
|
|
|
54
56
|
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; } }
|
|
55
57
|
|
|
56
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
57
|
-
|
|
58
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
58
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
59
59
|
|
|
60
60
|
var fallbackProps = {
|
|
61
61
|
width: 450,
|
|
@@ -185,25 +185,19 @@ var VictoryBoxPlot = /*#__PURE__*/function (_React$Component) {
|
|
|
185
185
|
}
|
|
186
186
|
|
|
187
187
|
var children = this.renderBoxPlot(props);
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
return props.standalone ? this.renderContainer(container, children) : children;
|
|
188
|
+
var component = props.standalone ? this.renderContainer(props.containerComponent, children) : children;
|
|
189
|
+
return _victoryCore.UserProps.withSafeUserProps(component, props);
|
|
192
190
|
}
|
|
193
191
|
}]);
|
|
194
192
|
|
|
195
193
|
return VictoryBoxPlot;
|
|
196
194
|
}(_react.default.Component);
|
|
197
195
|
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
_defineProperty(VictoryBoxPlot, "defaultTransitions", _victoryCore.DefaultTransitions.discreteTransitions());
|
|
205
|
-
|
|
206
|
-
_defineProperty(VictoryBoxPlot, "propTypes", _objectSpread(_objectSpread(_objectSpread({}, _victoryCore.CommonProps.baseProps), _victoryCore.CommonProps.dataProps), {}, {
|
|
196
|
+
VictoryBoxPlot.animationWhitelist = ["data", "domain", "height", "padding", "style", "width"];
|
|
197
|
+
VictoryBoxPlot.displayName = "VictoryBoxPlot";
|
|
198
|
+
VictoryBoxPlot.role = "boxplot";
|
|
199
|
+
VictoryBoxPlot.defaultTransitions = _victoryCore.DefaultTransitions.discreteTransitions();
|
|
200
|
+
VictoryBoxPlot.propTypes = _objectSpread(_objectSpread(_objectSpread({}, _victoryCore.CommonProps.baseProps), _victoryCore.CommonProps.dataProps), {}, {
|
|
207
201
|
boxWidth: _propTypes.default.number,
|
|
208
202
|
events: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
209
203
|
target: _propTypes.default.oneOf(["max", "maxLabels", "median", "medianLabels", "min", "minLabels", "q1", "q1Labels", "q3", "q3Labels", "parent"]),
|
|
@@ -256,9 +250,8 @@ _defineProperty(VictoryBoxPlot, "propTypes", _objectSpread(_objectSpread(_object
|
|
|
256
250
|
whiskers: _propTypes.default.object
|
|
257
251
|
}),
|
|
258
252
|
whiskerWidth: _propTypes.default.number
|
|
259
|
-
})
|
|
260
|
-
|
|
261
|
-
_defineProperty(VictoryBoxPlot, "defaultProps", {
|
|
253
|
+
});
|
|
254
|
+
VictoryBoxPlot.defaultProps = {
|
|
262
255
|
containerComponent: /*#__PURE__*/_react.default.createElement(_victoryCore.VictoryContainer, null),
|
|
263
256
|
data: defaultData,
|
|
264
257
|
dataComponent: /*#__PURE__*/_react.default.createElement(_victoryCore.Box, null),
|
|
@@ -280,18 +273,17 @@ _defineProperty(VictoryBoxPlot, "defaultProps", {
|
|
|
280
273
|
sortOrder: "ascending",
|
|
281
274
|
standalone: true,
|
|
282
275
|
theme: _victoryCore.VictoryTheme.grayscale
|
|
283
|
-
}
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
_defineProperty(VictoryBoxPlot, "getData", _helperMethods.getData);
|
|
276
|
+
};
|
|
277
|
+
VictoryBoxPlot.getDomain = _helperMethods.getDomain;
|
|
278
|
+
VictoryBoxPlot.getData = _helperMethods.getData;
|
|
288
279
|
|
|
289
|
-
|
|
280
|
+
VictoryBoxPlot.getBaseProps = function (props) {
|
|
290
281
|
return (0, _helperMethods.getBaseProps)(props, fallbackProps);
|
|
291
|
-
}
|
|
282
|
+
};
|
|
292
283
|
|
|
293
|
-
|
|
284
|
+
VictoryBoxPlot.expectedComponents = ["maxComponent", "maxLabelComponent", "medianComponent", "medianLabelComponent", "minComponent", "minLabelComponent", "q1Component", "q1LabelComponent", "q3Component", "q3LabelComponent", "groupComponent", "containerComponent"];
|
|
294
285
|
|
|
295
286
|
var _default = (0, _victoryCore.addEvents)(VictoryBoxPlot, options);
|
|
296
287
|
|
|
297
|
-
exports.default = _default;
|
|
288
|
+
exports.default = _default;
|
|
289
|
+
//# sourceMappingURL=victory-box-plot.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "victory-box-plot",
|
|
3
|
-
"version": "36.
|
|
3
|
+
"version": "36.5.1",
|
|
4
4
|
"description": "Box Plot Component for Victory",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"data visualization",
|
|
@@ -20,16 +20,16 @@
|
|
|
20
20
|
"license": "MIT",
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"lodash": "^4.17.19",
|
|
23
|
-
"prop-types": "^15.
|
|
24
|
-
"victory-core": "^36.
|
|
25
|
-
"victory-vendor": "^36.
|
|
23
|
+
"prop-types": "^15.8.1",
|
|
24
|
+
"victory-core": "^36.5.1",
|
|
25
|
+
"victory-vendor": "^36.5.1"
|
|
26
26
|
},
|
|
27
27
|
"peerDependencies": {
|
|
28
|
-
"react": "
|
|
28
|
+
"react": ">=16.6.0"
|
|
29
29
|
},
|
|
30
30
|
"scripts": {
|
|
31
31
|
"version": "yarn run nps build-libs && nps build-dists"
|
|
32
32
|
},
|
|
33
33
|
"sideEffects": false,
|
|
34
|
-
"gitHead": "
|
|
34
|
+
"gitHead": "fbe60407533cd7a6da4f8155d2ef8e189583c5a2"
|
|
35
35
|
}
|
package/src/helper-methods.js
CHANGED
|
@@ -6,13 +6,13 @@ import {
|
|
|
6
6
|
groupBy,
|
|
7
7
|
keys,
|
|
8
8
|
isNaN,
|
|
9
|
-
isNil
|
|
9
|
+
isNil,
|
|
10
10
|
} from "lodash";
|
|
11
11
|
import { Helpers, Scale, Domain, Data, Collection } from "victory-core";
|
|
12
12
|
import {
|
|
13
13
|
min as d3Min,
|
|
14
14
|
max as d3Max,
|
|
15
|
-
quantile as d3Quantile
|
|
15
|
+
quantile as d3Quantile,
|
|
16
16
|
} from "victory-vendor/d3-array";
|
|
17
17
|
|
|
18
18
|
const TYPES = ["max", "min", "median", "q1", "q3"];
|
|
@@ -47,7 +47,7 @@ const getSummaryStatistics = (data) => {
|
|
|
47
47
|
_q3: nanToNull(d3Quantile(dependentVars, 0.75)), // eslint-disable-line no-magic-numbers
|
|
48
48
|
_min: nanToNull(d3Min(dependentVars)),
|
|
49
49
|
_median: nanToNull(d3Quantile(dependentVars, 0.5)),
|
|
50
|
-
_max: nanToNull(d3Max(dependentVars))
|
|
50
|
+
_max: nanToNull(d3Max(dependentVars)),
|
|
51
51
|
};
|
|
52
52
|
|
|
53
53
|
return assign({}, data[0], quartiles, { _y: data[0]._y });
|
|
@@ -72,7 +72,7 @@ const processData = (data) => {
|
|
|
72
72
|
the depedentVarArray and process each datum separately */
|
|
73
73
|
return data.map((datum) => {
|
|
74
74
|
const dataArray = datum[sortKey].map((d) =>
|
|
75
|
-
assign({}, datum, { [sortKey]: d })
|
|
75
|
+
assign({}, datum, { [sortKey]: d }),
|
|
76
76
|
);
|
|
77
77
|
const sortedData = orderBy(dataArray, sortKey);
|
|
78
78
|
return getSummaryStatistics(sortedData);
|
|
@@ -172,7 +172,7 @@ const getStyles = (props, styleObject) => {
|
|
|
172
172
|
const labelStyles = defaults(
|
|
173
173
|
{},
|
|
174
174
|
style.labels,
|
|
175
|
-
getLabelStyle(props, styleObject)
|
|
175
|
+
getLabelStyle(props, styleObject),
|
|
176
176
|
);
|
|
177
177
|
const boxStyles = defaults({}, style.boxes, styleObject.boxes);
|
|
178
178
|
const whiskerStyles = defaults({}, style.whiskers, styleObject.whiskers);
|
|
@@ -185,37 +185,37 @@ const getStyles = (props, styleObject) => {
|
|
|
185
185
|
{},
|
|
186
186
|
style.maxLabels,
|
|
187
187
|
getLabelStyle(props, styleObject, "max"),
|
|
188
|
-
labelStyles
|
|
188
|
+
labelStyles,
|
|
189
189
|
),
|
|
190
190
|
median: defaults({}, style.median, styleObject.median, whiskerStyles),
|
|
191
191
|
medianLabels: defaults(
|
|
192
192
|
{},
|
|
193
193
|
style.medianLabels,
|
|
194
194
|
getLabelStyle(props, styleObject, "median"),
|
|
195
|
-
labelStyles
|
|
195
|
+
labelStyles,
|
|
196
196
|
),
|
|
197
197
|
min: defaults({}, style.min, styleObject.min, whiskerStyles),
|
|
198
198
|
minLabels: defaults(
|
|
199
199
|
{},
|
|
200
200
|
style.minLabels,
|
|
201
201
|
getLabelStyle(props, styleObject, "min"),
|
|
202
|
-
labelStyles
|
|
202
|
+
labelStyles,
|
|
203
203
|
),
|
|
204
204
|
q1: defaults({}, style.q1, styleObject.q1, boxStyles),
|
|
205
205
|
q1Labels: defaults(
|
|
206
206
|
{},
|
|
207
207
|
style.q1Labels,
|
|
208
208
|
getLabelStyle(props, styleObject, "q1"),
|
|
209
|
-
labelStyles
|
|
209
|
+
labelStyles,
|
|
210
210
|
),
|
|
211
211
|
q3: defaults({}, style.q3, styleObject.q3, boxStyles),
|
|
212
212
|
q3Labels: defaults(
|
|
213
213
|
{},
|
|
214
214
|
style.q3Labels,
|
|
215
215
|
getLabelStyle(props, styleObject, "q3"),
|
|
216
|
-
labelStyles
|
|
216
|
+
labelStyles,
|
|
217
217
|
),
|
|
218
|
-
whiskers: whiskerStyles
|
|
218
|
+
whiskers: whiskerStyles,
|
|
219
219
|
};
|
|
220
220
|
};
|
|
221
221
|
|
|
@@ -224,11 +224,11 @@ const getCalculatedValues = (props) => {
|
|
|
224
224
|
const data = getData(props);
|
|
225
225
|
const range = {
|
|
226
226
|
x: Helpers.getRange(props, "x"),
|
|
227
|
-
y: Helpers.getRange(props, "y")
|
|
227
|
+
y: Helpers.getRange(props, "y"),
|
|
228
228
|
};
|
|
229
229
|
const domain = {
|
|
230
230
|
x: getDomain(props, "x"),
|
|
231
|
-
y: getDomain(props, "y")
|
|
231
|
+
y: getDomain(props, "y"),
|
|
232
232
|
};
|
|
233
233
|
const scale = {
|
|
234
234
|
x: Scale.getBaseScale(props, "x")
|
|
@@ -236,7 +236,7 @@ const getCalculatedValues = (props) => {
|
|
|
236
236
|
.range(props.horizontal ? range.y : range.x),
|
|
237
237
|
y: Scale.getBaseScale(props, "y")
|
|
238
238
|
.domain(domain.y)
|
|
239
|
-
.range(props.horizontal ? range.x : range.y)
|
|
239
|
+
.range(props.horizontal ? range.x : range.y),
|
|
240
240
|
};
|
|
241
241
|
const defaultStyles =
|
|
242
242
|
theme && theme.boxplot && theme.boxplot.style ? theme.boxplot.style : {};
|
|
@@ -257,7 +257,7 @@ const getWhiskerProps = (props, type) => {
|
|
|
257
257
|
datum,
|
|
258
258
|
scale,
|
|
259
259
|
index,
|
|
260
|
-
disableInlineStyles
|
|
260
|
+
disableInlineStyles,
|
|
261
261
|
} = props;
|
|
262
262
|
const { min, max, q1, q3, x, y } = props.positions;
|
|
263
263
|
const boxValue = type === "min" ? q1 : q3;
|
|
@@ -271,16 +271,16 @@ const getWhiskerProps = (props, type) => {
|
|
|
271
271
|
x1: horizontal ? boxValue : x,
|
|
272
272
|
y1: horizontal ? y : boxValue,
|
|
273
273
|
x2: horizontal ? whiskerValue : x,
|
|
274
|
-
y2: horizontal ? y : whiskerValue
|
|
274
|
+
y2: horizontal ? y : whiskerValue,
|
|
275
275
|
},
|
|
276
276
|
minorWhisker: {
|
|
277
277
|
x1: horizontal ? whiskerValue : x - width / 2,
|
|
278
278
|
y1: horizontal ? y - width / 2 : whiskerValue,
|
|
279
279
|
x2: horizontal ? whiskerValue : x + width / 2,
|
|
280
|
-
y2: horizontal ? y + width / 2 : whiskerValue
|
|
280
|
+
y2: horizontal ? y + width / 2 : whiskerValue,
|
|
281
281
|
},
|
|
282
282
|
style: disableInlineStyles ? {} : style[type] || style.whisker,
|
|
283
|
-
disableInlineStyles
|
|
283
|
+
disableInlineStyles,
|
|
284
284
|
};
|
|
285
285
|
};
|
|
286
286
|
|
|
@@ -292,7 +292,7 @@ const getBoxProps = (props, type) => {
|
|
|
292
292
|
scale,
|
|
293
293
|
datum,
|
|
294
294
|
index,
|
|
295
|
-
disableInlineStyles
|
|
295
|
+
disableInlineStyles,
|
|
296
296
|
} = props;
|
|
297
297
|
const { median, q1, q3, x, y } = props.positions;
|
|
298
298
|
const defaultX = type === "q1" ? q1 : median;
|
|
@@ -308,7 +308,7 @@ const getBoxProps = (props, type) => {
|
|
|
308
308
|
width: horizontal ? defaultWidth : boxWidth,
|
|
309
309
|
height: horizontal ? boxWidth : defaultHeight,
|
|
310
310
|
style: disableInlineStyles ? {} : style[type] || style.boxes,
|
|
311
|
-
disableInlineStyles
|
|
311
|
+
disableInlineStyles,
|
|
312
312
|
};
|
|
313
313
|
};
|
|
314
314
|
|
|
@@ -320,7 +320,7 @@ const getMedianProps = (props) => {
|
|
|
320
320
|
datum,
|
|
321
321
|
scale,
|
|
322
322
|
index,
|
|
323
|
-
disableInlineStyles
|
|
323
|
+
disableInlineStyles,
|
|
324
324
|
} = props;
|
|
325
325
|
const { median, x, y } = props.positions;
|
|
326
326
|
return {
|
|
@@ -332,7 +332,7 @@ const getMedianProps = (props) => {
|
|
|
332
332
|
x2: horizontal ? median : x + boxWidth / 2,
|
|
333
333
|
y2: horizontal ? y + boxWidth / 2 : median,
|
|
334
334
|
style: disableInlineStyles ? {} : style.median,
|
|
335
|
-
disableInlineStyles
|
|
335
|
+
disableInlineStyles,
|
|
336
336
|
};
|
|
337
337
|
};
|
|
338
338
|
|
|
@@ -363,7 +363,7 @@ const getLabelProps = (props, text, type) => {
|
|
|
363
363
|
labelOrientation,
|
|
364
364
|
style,
|
|
365
365
|
theme,
|
|
366
|
-
disableInlineStyles
|
|
366
|
+
disableInlineStyles,
|
|
367
367
|
} = props;
|
|
368
368
|
const orientation = getOrientation(labelOrientation, type);
|
|
369
369
|
const namespace = `${type}Labels`;
|
|
@@ -372,13 +372,13 @@ const getLabelProps = (props, text, type) => {
|
|
|
372
372
|
top: "end",
|
|
373
373
|
bottom: "start",
|
|
374
374
|
left: "middle",
|
|
375
|
-
right: "middle"
|
|
375
|
+
right: "middle",
|
|
376
376
|
};
|
|
377
377
|
const defaultTextAnchors = {
|
|
378
378
|
left: "end",
|
|
379
379
|
right: "start",
|
|
380
380
|
top: "middle",
|
|
381
|
-
bottom: "middle"
|
|
381
|
+
bottom: "middle",
|
|
382
382
|
};
|
|
383
383
|
const whiskerWidth =
|
|
384
384
|
typeof props.whiskerWidth === "number" ? props.whiskerWidth : boxWidth;
|
|
@@ -387,7 +387,7 @@ const getLabelProps = (props, text, type) => {
|
|
|
387
387
|
const getOffset = (coord) => {
|
|
388
388
|
const sign = {
|
|
389
389
|
x: orientation === "left" ? -1 : 1,
|
|
390
|
-
y: orientation === "top" ? -1 : 1
|
|
390
|
+
y: orientation === "top" ? -1 : 1,
|
|
391
391
|
};
|
|
392
392
|
return (sign[coord] * width) / 2 + sign[coord] * (labelStyle.padding || 0);
|
|
393
393
|
};
|
|
@@ -407,7 +407,7 @@ const getLabelProps = (props, text, type) => {
|
|
|
407
407
|
labelStyle.verticalAnchor || defaultVerticalAnchors[orientation],
|
|
408
408
|
angle: labelStyle.angle,
|
|
409
409
|
horizontal,
|
|
410
|
-
disableInlineStyles
|
|
410
|
+
disableInlineStyles,
|
|
411
411
|
};
|
|
412
412
|
|
|
413
413
|
const component = props[`${type}LabelComponent`];
|
|
@@ -474,7 +474,7 @@ export const getBaseProps = (props, fallbackProps) => {
|
|
|
474
474
|
data,
|
|
475
475
|
style,
|
|
476
476
|
domain,
|
|
477
|
-
name
|
|
477
|
+
name,
|
|
478
478
|
} = props;
|
|
479
479
|
const initialChildProps = {
|
|
480
480
|
parent: {
|
|
@@ -489,8 +489,8 @@ export const getBaseProps = (props, fallbackProps) => {
|
|
|
489
489
|
style: style.parent || {},
|
|
490
490
|
padding,
|
|
491
491
|
groupComponent,
|
|
492
|
-
horizontal
|
|
493
|
-
}
|
|
492
|
+
horizontal,
|
|
493
|
+
},
|
|
494
494
|
};
|
|
495
495
|
const boxScale = scale.y;
|
|
496
496
|
return data.reduce((acc, datum, index) => {
|
|
@@ -505,7 +505,7 @@ export const getBaseProps = (props, fallbackProps) => {
|
|
|
505
505
|
max: boxScale(datum._max),
|
|
506
506
|
median: boxScale(datum._median),
|
|
507
507
|
q1: boxScale(datum._q1),
|
|
508
|
-
q3: boxScale(datum._q3)
|
|
508
|
+
q3: boxScale(datum._q3),
|
|
509
509
|
};
|
|
510
510
|
const dataProps = assign({ index, datum, positions }, props);
|
|
511
511
|
const dataObj = TYPES.reduce((memo, type) => {
|
|
@@ -526,7 +526,7 @@ export const getBaseProps = (props, fallbackProps) => {
|
|
|
526
526
|
acc[eventKey][target] = getLabelProps(
|
|
527
527
|
assign({}, props, dataProps),
|
|
528
528
|
labelText,
|
|
529
|
-
type
|
|
529
|
+
type,
|
|
530
530
|
);
|
|
531
531
|
}
|
|
532
532
|
});
|