victory-area 36.9.2 → 37.0.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 +6 -0
- package/dist/victory-area.js +3769 -5009
- package/dist/victory-area.min.js +1 -1
- package/es/area.js +80 -94
- package/es/helper-methods.js +81 -90
- package/es/victory-area.js +46 -85
- package/lib/area.js +83 -116
- package/lib/helper-methods.js +81 -101
- package/lib/index.js +0 -4
- package/lib/victory-area.js +46 -93
- package/package.json +3 -3
package/lib/area.js
CHANGED
|
@@ -4,74 +4,50 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.Area = void 0;
|
|
7
|
-
|
|
8
7
|
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
|
|
10
8
|
var d3Shape = _interopRequireWildcard(require("victory-vendor/d3-shape"));
|
|
11
|
-
|
|
12
9
|
var _victoryCore = require("victory-core");
|
|
13
|
-
|
|
14
|
-
function
|
|
15
|
-
|
|
16
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
17
|
-
|
|
10
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
11
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
18
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
+
/* eslint no-magic-numbers: ["error", { "ignore": [-1, 0, 1, 2] }]*/
|
|
19
14
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
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; }
|
|
23
|
-
|
|
24
|
-
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; }
|
|
25
|
-
|
|
26
|
-
var defined = function (d) {
|
|
27
|
-
var y = d._y1 !== undefined ? d._y1 : d._y;
|
|
15
|
+
const defined = d => {
|
|
16
|
+
const y = d._y1 !== undefined ? d._y1 : d._y;
|
|
28
17
|
return y !== null && y !== undefined && d._y0 !== null;
|
|
29
18
|
};
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
return function (d) {
|
|
33
|
-
return scale.x(d._x1 !== undefined ? d._x1 : d._x);
|
|
34
|
-
};
|
|
19
|
+
const getXAccessor = scale => {
|
|
20
|
+
return d => scale.x(d._x1 !== undefined ? d._x1 : d._x);
|
|
35
21
|
};
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
return function (d) {
|
|
39
|
-
return scale.y(d._y1 !== undefined ? d._y1 : d._y);
|
|
40
|
-
};
|
|
22
|
+
const getYAccessor = scale => {
|
|
23
|
+
return d => scale.y(d._y1 !== undefined ? d._y1 : d._y);
|
|
41
24
|
};
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
return function (d) {
|
|
45
|
-
return scale.y(d._y0);
|
|
46
|
-
};
|
|
25
|
+
const getY0Accessor = scale => {
|
|
26
|
+
return d => scale.y(d._y0);
|
|
47
27
|
};
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
var x = scale.x(d._x1 !== undefined ? d._x1 : d._x);
|
|
28
|
+
const getAngleAccessor = scale => {
|
|
29
|
+
return d => {
|
|
30
|
+
const x = scale.x(d._x1 !== undefined ? d._x1 : d._x);
|
|
52
31
|
return -1 * x + Math.PI / 2;
|
|
53
32
|
};
|
|
54
33
|
};
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
34
|
+
const getCartesianArea = props => {
|
|
35
|
+
const {
|
|
36
|
+
horizontal,
|
|
37
|
+
scale
|
|
38
|
+
} = props;
|
|
39
|
+
const interpolationFunction = _victoryCore.LineHelpers.getInterpolationFunction(props);
|
|
62
40
|
return horizontal ? d3Shape.area().defined(defined).curve(interpolationFunction).x0(getY0Accessor(scale)).x1(getYAccessor(scale)).y(getXAccessor(scale)) : d3Shape.area().defined(defined).curve(interpolationFunction).x(getXAccessor(scale)).y1(getYAccessor(scale)).y0(getY0Accessor(scale));
|
|
63
41
|
};
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
42
|
+
const getAreaFunction = props => {
|
|
43
|
+
const {
|
|
44
|
+
polar,
|
|
45
|
+
scale
|
|
46
|
+
} = props;
|
|
47
|
+
const interpolationFunction = _victoryCore.LineHelpers.getInterpolationFunction(props);
|
|
71
48
|
return polar ? d3Shape.radialArea().defined(defined).curve(interpolationFunction).angle(getAngleAccessor(scale)).outerRadius(getYAccessor(scale)).innerRadius(getY0Accessor(scale)) : getCartesianArea(props);
|
|
72
49
|
};
|
|
73
|
-
|
|
74
|
-
var evaluateProps = function (props) {
|
|
50
|
+
const evaluateProps = props => {
|
|
75
51
|
/**
|
|
76
52
|
* Potential evaluated props are:
|
|
77
53
|
* `ariaLabel`
|
|
@@ -80,89 +56,81 @@ var evaluateProps = function (props) {
|
|
|
80
56
|
* `style`
|
|
81
57
|
* `tabIndex`
|
|
82
58
|
*/
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
var id = _victoryCore.Helpers.evaluateProp(props.id, props);
|
|
88
|
-
|
|
89
|
-
var style = _victoryCore.Helpers.evaluateStyle(Object.assign({
|
|
59
|
+
const ariaLabel = _victoryCore.Helpers.evaluateProp(props.ariaLabel, props);
|
|
60
|
+
const desc = _victoryCore.Helpers.evaluateProp(props.desc, props);
|
|
61
|
+
const id = _victoryCore.Helpers.evaluateProp(props.id, props);
|
|
62
|
+
const style = _victoryCore.Helpers.evaluateStyle(Object.assign({
|
|
90
63
|
fill: "black"
|
|
91
64
|
}, props.style), props);
|
|
92
|
-
|
|
93
|
-
var tabIndex = _victoryCore.Helpers.evaluateProp(props.tabIndex, props);
|
|
94
|
-
|
|
65
|
+
const tabIndex = _victoryCore.Helpers.evaluateProp(props.tabIndex, props);
|
|
95
66
|
return Object.assign({}, props, {
|
|
96
|
-
ariaLabel
|
|
97
|
-
desc
|
|
98
|
-
id
|
|
99
|
-
style
|
|
100
|
-
tabIndex
|
|
67
|
+
ariaLabel,
|
|
68
|
+
desc,
|
|
69
|
+
id,
|
|
70
|
+
style,
|
|
71
|
+
tabIndex
|
|
101
72
|
});
|
|
102
73
|
};
|
|
103
|
-
|
|
104
|
-
var defaultProps = {
|
|
74
|
+
const defaultProps = {
|
|
105
75
|
groupComponent: /*#__PURE__*/_react.default.createElement("g", null),
|
|
106
76
|
pathComponent: /*#__PURE__*/_react.default.createElement(_victoryCore.Path, null),
|
|
107
77
|
role: "presentation",
|
|
108
78
|
shapeRendering: "auto"
|
|
109
79
|
};
|
|
80
|
+
|
|
110
81
|
/**
|
|
111
82
|
* The area primitive used by VictoryArea
|
|
112
83
|
*/
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
role = props.role,
|
|
118
|
-
shapeRendering = props.shapeRendering,
|
|
119
|
-
className = props.className,
|
|
120
|
-
polar = props.polar,
|
|
121
|
-
origin = props.origin,
|
|
122
|
-
data = props.data,
|
|
123
|
-
pathComponent = props.pathComponent,
|
|
124
|
-
events = props.events,
|
|
125
|
-
groupComponent = props.groupComponent,
|
|
126
|
-
clipPath = props.clipPath,
|
|
127
|
-
id = props.id,
|
|
128
|
-
style = props.style,
|
|
129
|
-
desc = props.desc,
|
|
130
|
-
tabIndex = props.tabIndex;
|
|
131
|
-
|
|
132
|
-
var userProps = _victoryCore.UserProps.getSafeUserProps(props);
|
|
133
|
-
|
|
134
|
-
var defaultTransform = polar && origin ? "translate(".concat(origin.x, ", ").concat(origin.y, ")") : undefined;
|
|
135
|
-
var transform = props.transform || defaultTransform;
|
|
136
|
-
var renderLine = style.stroke && style.stroke !== "none" && style.stroke !== "transparent";
|
|
137
|
-
var areaFunction = getAreaFunction(props);
|
|
138
|
-
|
|
139
|
-
var lineFunction = renderLine && _victoryCore.LineHelpers.getLineFunction(props);
|
|
140
|
-
|
|
141
|
-
var areaStroke = style.stroke ? "none" : style.fill;
|
|
142
|
-
|
|
143
|
-
var sharedProps = _objectSpread(_objectSpread({
|
|
144
|
-
"aria-label": ariaLabel,
|
|
145
|
-
className: className,
|
|
146
|
-
role: role,
|
|
147
|
-
shapeRendering: shapeRendering,
|
|
148
|
-
transform: transform
|
|
149
|
-
}, events), {}, {
|
|
150
|
-
clipPath: clipPath,
|
|
151
|
-
tabIndex: tabIndex
|
|
84
|
+
const Area = initialProps => {
|
|
85
|
+
const props = evaluateProps({
|
|
86
|
+
...defaultProps,
|
|
87
|
+
...initialProps
|
|
152
88
|
});
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
89
|
+
const {
|
|
90
|
+
ariaLabel,
|
|
91
|
+
role,
|
|
92
|
+
shapeRendering,
|
|
93
|
+
className,
|
|
94
|
+
polar,
|
|
95
|
+
origin,
|
|
96
|
+
data,
|
|
97
|
+
pathComponent,
|
|
98
|
+
events,
|
|
99
|
+
groupComponent,
|
|
100
|
+
clipPath,
|
|
101
|
+
id,
|
|
102
|
+
style,
|
|
103
|
+
desc,
|
|
104
|
+
tabIndex
|
|
105
|
+
} = props;
|
|
106
|
+
const userProps = _victoryCore.UserProps.getSafeUserProps(props);
|
|
107
|
+
const defaultTransform = polar && origin ? `translate(${origin.x}, ${origin.y})` : undefined;
|
|
108
|
+
const transform = props.transform || defaultTransform;
|
|
109
|
+
const renderLine = style.stroke && style.stroke !== "none" && style.stroke !== "transparent";
|
|
110
|
+
const areaFunction = getAreaFunction(props);
|
|
111
|
+
const lineFunction = renderLine && _victoryCore.LineHelpers.getLineFunction(props);
|
|
112
|
+
const areaStroke = style.stroke ? "none" : style.fill;
|
|
113
|
+
const sharedProps = {
|
|
114
|
+
"aria-label": ariaLabel,
|
|
115
|
+
className,
|
|
116
|
+
role,
|
|
117
|
+
shapeRendering,
|
|
118
|
+
transform,
|
|
119
|
+
...events,
|
|
120
|
+
clipPath,
|
|
121
|
+
tabIndex
|
|
122
|
+
};
|
|
123
|
+
const area = /*#__PURE__*/_react.default.cloneElement(pathComponent, Object.assign({
|
|
124
|
+
key: `${id}-area`,
|
|
156
125
|
style: Object.assign({}, style, {
|
|
157
126
|
stroke: areaStroke
|
|
158
127
|
}),
|
|
159
128
|
d: areaFunction(data),
|
|
160
|
-
desc
|
|
161
|
-
tabIndex
|
|
129
|
+
desc,
|
|
130
|
+
tabIndex
|
|
162
131
|
}, sharedProps, userProps));
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
key: "".concat(id, "-area-stroke"),
|
|
132
|
+
const line = renderLine ? /*#__PURE__*/_react.default.cloneElement(pathComponent, Object.assign({
|
|
133
|
+
key: `${id}-area-stroke`,
|
|
166
134
|
style: Object.assign({}, style, {
|
|
167
135
|
fill: "none"
|
|
168
136
|
}),
|
|
@@ -170,5 +138,4 @@ var Area = function (initialProps) {
|
|
|
170
138
|
}, sharedProps)) : null;
|
|
171
139
|
return renderLine ? /*#__PURE__*/_react.default.cloneElement(groupComponent, userProps, [area, line]) : area;
|
|
172
140
|
};
|
|
173
|
-
|
|
174
141
|
exports.Area = Area;
|
package/lib/helper-methods.js
CHANGED
|
@@ -4,150 +4,130 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.getDataWithBaseline = exports.getBaseProps = void 0;
|
|
7
|
-
|
|
8
7
|
var _victoryCore = require("victory-core");
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
var data = _victoryCore.Data.getData(props);
|
|
12
|
-
|
|
8
|
+
const getDataWithBaseline = (props, scale) => {
|
|
9
|
+
let data = _victoryCore.Data.getData(props);
|
|
13
10
|
if (data.length < 2) {
|
|
14
11
|
data = [];
|
|
15
12
|
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
var maxY = _victoryCore.Collection.getMaxValue(domain);
|
|
24
|
-
|
|
25
|
-
var defaultMin = defaultZero;
|
|
26
|
-
|
|
13
|
+
const getDefaultMin = axis => {
|
|
14
|
+
const defaultZero = _victoryCore.Scale.getType(scale[axis]) === "log" ? 1 / Number.MAX_SAFE_INTEGER : 0;
|
|
15
|
+
const domain = scale[axis].domain();
|
|
16
|
+
const minY = _victoryCore.Collection.getMinValue(domain);
|
|
17
|
+
const maxY = _victoryCore.Collection.getMaxValue(domain);
|
|
18
|
+
let defaultMin = defaultZero;
|
|
27
19
|
if (minY < 0 && maxY <= 0) {
|
|
28
20
|
defaultMin = maxY;
|
|
29
21
|
} else if (minY >= 0 && maxY > 0) {
|
|
30
22
|
defaultMin = minY;
|
|
31
23
|
}
|
|
32
|
-
|
|
33
24
|
return _victoryCore.Collection.containsDates(domain) ? new Date(defaultMin) : defaultMin;
|
|
34
25
|
};
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
var _x1 = datum._x1 !== undefined ? datum._x1 : datum._x;
|
|
42
|
-
|
|
43
|
-
var _x0 = datum._x0 !== undefined ? datum._x0 : getDefaultMin("x");
|
|
44
|
-
|
|
26
|
+
return data.map(datum => {
|
|
27
|
+
const _y1 = datum._y1 !== undefined ? datum._y1 : datum._y;
|
|
28
|
+
const _y0 = datum._y0 !== undefined ? datum._y0 : getDefaultMin("y");
|
|
29
|
+
const _x1 = datum._x1 !== undefined ? datum._x1 : datum._x;
|
|
30
|
+
const _x0 = datum._x0 !== undefined ? datum._x0 : getDefaultMin("x");
|
|
45
31
|
return Object.assign({}, datum, {
|
|
46
|
-
_y0
|
|
47
|
-
_y1
|
|
48
|
-
_x0
|
|
49
|
-
_x1
|
|
32
|
+
_y0,
|
|
33
|
+
_y1,
|
|
34
|
+
_x0,
|
|
35
|
+
_x1
|
|
50
36
|
});
|
|
51
37
|
});
|
|
52
38
|
};
|
|
53
|
-
|
|
54
39
|
exports.getDataWithBaseline = getDataWithBaseline;
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
var range = {
|
|
40
|
+
const getCalculatedValues = props => {
|
|
41
|
+
const {
|
|
42
|
+
polar
|
|
43
|
+
} = props;
|
|
44
|
+
const defaultStyles = _victoryCore.Helpers.getDefaultStyles(props, "area");
|
|
45
|
+
const style = _victoryCore.Helpers.getStyles(props.style, defaultStyles);
|
|
46
|
+
const range = {
|
|
64
47
|
x: _victoryCore.Helpers.getRange(props, "x"),
|
|
65
48
|
y: _victoryCore.Helpers.getRange(props, "y")
|
|
66
49
|
};
|
|
67
|
-
|
|
50
|
+
const domain = {
|
|
68
51
|
x: _victoryCore.Domain.getDomainWithZero(props, "x"),
|
|
69
52
|
y: _victoryCore.Domain.getDomainWithZero(props, "y")
|
|
70
53
|
};
|
|
71
|
-
|
|
54
|
+
const scale = {
|
|
72
55
|
x: _victoryCore.Scale.getBaseScale(props, "x").domain(domain.x).range(props.horizontal ? range.y : range.x),
|
|
73
56
|
y: _victoryCore.Scale.getBaseScale(props, "y").domain(domain.y).range(props.horizontal ? range.x : range.y)
|
|
74
57
|
};
|
|
75
|
-
|
|
76
|
-
|
|
58
|
+
const origin = polar ? props.origin || _victoryCore.Helpers.getPolarOrigin(props) : undefined;
|
|
59
|
+
const data = getDataWithBaseline(props, scale);
|
|
77
60
|
return {
|
|
78
|
-
style
|
|
79
|
-
data
|
|
80
|
-
scale
|
|
81
|
-
domain
|
|
82
|
-
origin
|
|
61
|
+
style,
|
|
62
|
+
data,
|
|
63
|
+
scale,
|
|
64
|
+
domain,
|
|
65
|
+
origin
|
|
83
66
|
};
|
|
84
67
|
};
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
68
|
+
const getBaseProps = (initialProps, fallbackProps) => {
|
|
69
|
+
const modifiedProps = _victoryCore.Helpers.modifyProps(initialProps, fallbackProps, "area");
|
|
70
|
+
const props = Object.assign({}, modifiedProps, getCalculatedValues(modifiedProps));
|
|
71
|
+
const {
|
|
72
|
+
data,
|
|
73
|
+
domain,
|
|
74
|
+
events,
|
|
75
|
+
groupComponent,
|
|
76
|
+
height,
|
|
77
|
+
horizontal,
|
|
78
|
+
interpolation,
|
|
79
|
+
origin,
|
|
80
|
+
padding,
|
|
81
|
+
polar,
|
|
82
|
+
scale,
|
|
83
|
+
sharedEvents,
|
|
84
|
+
standalone,
|
|
85
|
+
style,
|
|
86
|
+
theme,
|
|
87
|
+
width,
|
|
88
|
+
labels,
|
|
89
|
+
name,
|
|
90
|
+
disableInlineStyles
|
|
91
|
+
} = props;
|
|
92
|
+
const initialChildProps = {
|
|
110
93
|
parent: {
|
|
111
94
|
style: style.parent,
|
|
112
|
-
width
|
|
113
|
-
height
|
|
114
|
-
scale
|
|
115
|
-
data
|
|
116
|
-
domain
|
|
117
|
-
standalone
|
|
118
|
-
theme
|
|
119
|
-
polar
|
|
120
|
-
origin
|
|
121
|
-
padding
|
|
122
|
-
name
|
|
123
|
-
horizontal
|
|
95
|
+
width,
|
|
96
|
+
height,
|
|
97
|
+
scale,
|
|
98
|
+
data,
|
|
99
|
+
domain,
|
|
100
|
+
standalone,
|
|
101
|
+
theme,
|
|
102
|
+
polar,
|
|
103
|
+
origin,
|
|
104
|
+
padding,
|
|
105
|
+
name,
|
|
106
|
+
horizontal
|
|
124
107
|
},
|
|
125
108
|
all: {
|
|
126
109
|
data: {
|
|
127
|
-
horizontal
|
|
128
|
-
polar
|
|
129
|
-
origin
|
|
130
|
-
scale
|
|
131
|
-
data
|
|
132
|
-
interpolation
|
|
133
|
-
groupComponent
|
|
110
|
+
horizontal,
|
|
111
|
+
polar,
|
|
112
|
+
origin,
|
|
113
|
+
scale,
|
|
114
|
+
data,
|
|
115
|
+
interpolation,
|
|
116
|
+
groupComponent,
|
|
134
117
|
style: disableInlineStyles ? {} : style.data,
|
|
135
|
-
disableInlineStyles
|
|
118
|
+
disableInlineStyles
|
|
136
119
|
}
|
|
137
120
|
}
|
|
138
121
|
};
|
|
139
|
-
return data.reduce(
|
|
140
|
-
|
|
141
|
-
|
|
122
|
+
return data.reduce((childProps, datum, index) => {
|
|
123
|
+
const text = _victoryCore.LabelHelpers.getText(props, datum, index);
|
|
142
124
|
if (text !== undefined && text !== null || labels && (events || sharedEvents)) {
|
|
143
|
-
|
|
125
|
+
const eventKey = !_victoryCore.Helpers.isNil(datum.eventKey) ? datum.eventKey : index;
|
|
144
126
|
childProps[eventKey] = {
|
|
145
127
|
labels: _victoryCore.LabelHelpers.getProps(props, index)
|
|
146
128
|
};
|
|
147
129
|
}
|
|
148
|
-
|
|
149
130
|
return childProps;
|
|
150
131
|
}, initialChildProps);
|
|
151
132
|
};
|
|
152
|
-
|
|
153
133
|
exports.getBaseProps = getBaseProps;
|
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 _victoryArea = require("./victory-area");
|
|
8
|
-
|
|
9
7
|
Object.keys(_victoryArea).forEach(function (key) {
|
|
10
8
|
if (key === "default" || key === "__esModule") return;
|
|
11
9
|
if (key in exports && exports[key] === _victoryArea[key]) return;
|
|
@@ -16,9 +14,7 @@ Object.keys(_victoryArea).forEach(function (key) {
|
|
|
16
14
|
}
|
|
17
15
|
});
|
|
18
16
|
});
|
|
19
|
-
|
|
20
17
|
var _area = require("./area");
|
|
21
|
-
|
|
22
18
|
Object.keys(_area).forEach(function (key) {
|
|
23
19
|
if (key === "default" || key === "__esModule") return;
|
|
24
20
|
if (key in exports && exports[key] === _area[key]) return;
|