victory-bar 36.3.2 → 36.4.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/dist/victory-bar.js +16762 -17254
- package/dist/victory-bar.min.js +1 -1
- package/es/bar.js +6 -4
- package/es/path-helper-methods.js +18 -14
- package/es/victory-bar.js +107 -137
- package/lib/bar.js +6 -4
- package/lib/index.js +22 -22
- package/lib/path-helper-methods.js +22 -16
- package/lib/victory-bar.js +106 -137
- package/package.json +4 -4
- package/src/path-helper-methods.js +1 -1
package/lib/victory-bar.js
CHANGED
|
@@ -17,21 +17,31 @@ var _victoryCore = require("victory-core");
|
|
|
17
17
|
|
|
18
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
19
|
|
|
20
|
-
function
|
|
20
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
21
21
|
|
|
22
|
-
function
|
|
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
23
|
|
|
24
24
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
25
25
|
|
|
26
26
|
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); } }
|
|
27
27
|
|
|
28
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
28
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
29
|
+
|
|
30
|
+
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); }
|
|
31
|
+
|
|
32
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
33
|
+
|
|
34
|
+
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); }; }
|
|
29
35
|
|
|
30
|
-
function _possibleConstructorReturn(self, call) { if (call && (typeof call === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
36
|
+
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); }
|
|
31
37
|
|
|
32
38
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
33
39
|
|
|
34
|
-
function
|
|
40
|
+
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; } }
|
|
41
|
+
|
|
42
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
43
|
+
|
|
44
|
+
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; }
|
|
35
45
|
|
|
36
46
|
var fallbackProps = {
|
|
37
47
|
width: 450,
|
|
@@ -52,21 +62,21 @@ var defaultData = [{
|
|
|
52
62
|
y: 4
|
|
53
63
|
}];
|
|
54
64
|
|
|
55
|
-
var VictoryBar =
|
|
56
|
-
/*#__PURE__*/
|
|
57
|
-
function (_React$Component) {
|
|
65
|
+
var VictoryBar = /*#__PURE__*/function (_React$Component) {
|
|
58
66
|
_inherits(VictoryBar, _React$Component);
|
|
59
67
|
|
|
68
|
+
var _super = _createSuper(VictoryBar);
|
|
69
|
+
|
|
60
70
|
function VictoryBar() {
|
|
61
71
|
_classCallCheck(this, VictoryBar);
|
|
62
72
|
|
|
63
|
-
return
|
|
73
|
+
return _super.apply(this, arguments);
|
|
64
74
|
}
|
|
65
75
|
|
|
66
76
|
_createClass(VictoryBar, [{
|
|
67
77
|
key: "shouldAnimate",
|
|
68
|
-
// Overridden in native versions
|
|
69
|
-
|
|
78
|
+
value: // Overridden in native versions
|
|
79
|
+
function shouldAnimate() {
|
|
70
80
|
return !!this.props.animate;
|
|
71
81
|
}
|
|
72
82
|
}, {
|
|
@@ -83,7 +93,7 @@ function (_React$Component) {
|
|
|
83
93
|
|
|
84
94
|
var children = this.renderData(props);
|
|
85
95
|
|
|
86
|
-
var container = _react.default.cloneElement(props.containerComponent, _victoryCore.UserProps.getSafeUserProps(props));
|
|
96
|
+
var container = /*#__PURE__*/_react.default.cloneElement(props.containerComponent, _victoryCore.UserProps.getSafeUserProps(props));
|
|
87
97
|
|
|
88
98
|
return props.standalone ? this.renderContainer(container, children) : children;
|
|
89
99
|
}
|
|
@@ -92,139 +102,98 @@ function (_React$Component) {
|
|
|
92
102
|
return VictoryBar;
|
|
93
103
|
}(_react.default.Component);
|
|
94
104
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
writable: true,
|
|
111
|
-
value: "bar"
|
|
112
|
-
});
|
|
113
|
-
Object.defineProperty(VictoryBar, "defaultTransitions", {
|
|
114
|
-
configurable: true,
|
|
115
|
-
enumerable: true,
|
|
116
|
-
writable: true,
|
|
117
|
-
value: {
|
|
118
|
-
onLoad: {
|
|
119
|
-
duration: 2000,
|
|
120
|
-
before: function () {
|
|
121
|
-
return {
|
|
122
|
-
_y: 0,
|
|
123
|
-
_y1: 0,
|
|
124
|
-
_y0: 0
|
|
125
|
-
};
|
|
126
|
-
},
|
|
127
|
-
after: function (datum) {
|
|
128
|
-
return {
|
|
129
|
-
_y: datum._y,
|
|
130
|
-
_y1: datum._y1,
|
|
131
|
-
_y0: datum._y0
|
|
132
|
-
};
|
|
133
|
-
}
|
|
105
|
+
_defineProperty(VictoryBar, "animationWhitelist", ["data", "domain", "height", "padding", "style", "width"]);
|
|
106
|
+
|
|
107
|
+
_defineProperty(VictoryBar, "displayName", "VictoryBar");
|
|
108
|
+
|
|
109
|
+
_defineProperty(VictoryBar, "role", "bar");
|
|
110
|
+
|
|
111
|
+
_defineProperty(VictoryBar, "defaultTransitions", {
|
|
112
|
+
onLoad: {
|
|
113
|
+
duration: 2000,
|
|
114
|
+
before: function () {
|
|
115
|
+
return {
|
|
116
|
+
_y: 0,
|
|
117
|
+
_y1: 0,
|
|
118
|
+
_y0: 0
|
|
119
|
+
};
|
|
134
120
|
},
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
121
|
+
after: function (datum) {
|
|
122
|
+
return {
|
|
123
|
+
_y: datum._y,
|
|
124
|
+
_y1: datum._y1,
|
|
125
|
+
_y0: datum._y0
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
},
|
|
129
|
+
onExit: {
|
|
130
|
+
duration: 500,
|
|
131
|
+
before: function () {
|
|
132
|
+
return {
|
|
133
|
+
_y: 0,
|
|
134
|
+
yOffset: 0
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
},
|
|
138
|
+
onEnter: {
|
|
139
|
+
duration: 500,
|
|
140
|
+
before: function () {
|
|
141
|
+
return {
|
|
142
|
+
_y: 0,
|
|
143
|
+
_y1: 0,
|
|
144
|
+
_y0: 0
|
|
145
|
+
};
|
|
143
146
|
},
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
_y0: 0
|
|
151
|
-
};
|
|
152
|
-
},
|
|
153
|
-
after: function (datum) {
|
|
154
|
-
return {
|
|
155
|
-
_y: datum._y,
|
|
156
|
-
_y1: datum._y1,
|
|
157
|
-
_y0: datum._y0
|
|
158
|
-
};
|
|
159
|
-
}
|
|
147
|
+
after: function (datum) {
|
|
148
|
+
return {
|
|
149
|
+
_y: datum._y,
|
|
150
|
+
_y1: datum._y1,
|
|
151
|
+
_y0: datum._y0
|
|
152
|
+
};
|
|
160
153
|
}
|
|
161
154
|
}
|
|
162
155
|
});
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
role: "presentation"
|
|
193
|
-
}),
|
|
194
|
-
labelComponent: _react.default.createElement(_victoryCore.VictoryLabel, null),
|
|
195
|
-
samples: 50,
|
|
196
|
-
sortOrder: "ascending",
|
|
197
|
-
standalone: true,
|
|
198
|
-
theme: _victoryCore.VictoryTheme.grayscale
|
|
199
|
-
}
|
|
200
|
-
});
|
|
201
|
-
Object.defineProperty(VictoryBar, "getDomain", {
|
|
202
|
-
configurable: true,
|
|
203
|
-
enumerable: true,
|
|
204
|
-
writable: true,
|
|
205
|
-
value: _victoryCore.Domain.getDomainWithZero
|
|
206
|
-
});
|
|
207
|
-
Object.defineProperty(VictoryBar, "getData", {
|
|
208
|
-
configurable: true,
|
|
209
|
-
enumerable: true,
|
|
210
|
-
writable: true,
|
|
211
|
-
value: _victoryCore.Data.getData
|
|
212
|
-
});
|
|
213
|
-
Object.defineProperty(VictoryBar, "getBaseProps", {
|
|
214
|
-
configurable: true,
|
|
215
|
-
enumerable: true,
|
|
216
|
-
writable: true,
|
|
217
|
-
value: function (props) {
|
|
218
|
-
return (0, _helperMethods.getBaseProps)(props, fallbackProps);
|
|
219
|
-
}
|
|
156
|
+
|
|
157
|
+
_defineProperty(VictoryBar, "propTypes", _objectSpread(_objectSpread(_objectSpread({}, _victoryCore.CommonProps.baseProps), _victoryCore.CommonProps.dataProps), {}, {
|
|
158
|
+
alignment: _propTypes.default.oneOf(["start", "middle", "end"]),
|
|
159
|
+
barRatio: _propTypes.default.number,
|
|
160
|
+
barWidth: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.func]),
|
|
161
|
+
cornerRadius: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.func, _propTypes.default.shape({
|
|
162
|
+
top: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.func]),
|
|
163
|
+
topLeft: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.func]),
|
|
164
|
+
topRight: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.func]),
|
|
165
|
+
bottom: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.func]),
|
|
166
|
+
bottomLeft: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.func]),
|
|
167
|
+
bottomRight: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.func])
|
|
168
|
+
})]),
|
|
169
|
+
getPath: _propTypes.default.func,
|
|
170
|
+
horizontal: _propTypes.default.bool
|
|
171
|
+
}));
|
|
172
|
+
|
|
173
|
+
_defineProperty(VictoryBar, "defaultProps", {
|
|
174
|
+
containerComponent: /*#__PURE__*/_react.default.createElement(_victoryCore.VictoryContainer, null),
|
|
175
|
+
data: defaultData,
|
|
176
|
+
dataComponent: /*#__PURE__*/_react.default.createElement(_bar.default, null),
|
|
177
|
+
groupComponent: /*#__PURE__*/_react.default.createElement("g", {
|
|
178
|
+
role: "presentation"
|
|
179
|
+
}),
|
|
180
|
+
labelComponent: /*#__PURE__*/_react.default.createElement(_victoryCore.VictoryLabel, null),
|
|
181
|
+
samples: 50,
|
|
182
|
+
sortOrder: "ascending",
|
|
183
|
+
standalone: true,
|
|
184
|
+
theme: _victoryCore.VictoryTheme.grayscale
|
|
220
185
|
});
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
186
|
+
|
|
187
|
+
_defineProperty(VictoryBar, "getDomain", _victoryCore.Domain.getDomainWithZero);
|
|
188
|
+
|
|
189
|
+
_defineProperty(VictoryBar, "getData", _victoryCore.Data.getData);
|
|
190
|
+
|
|
191
|
+
_defineProperty(VictoryBar, "getBaseProps", function (props) {
|
|
192
|
+
return (0, _helperMethods.getBaseProps)(props, fallbackProps);
|
|
226
193
|
});
|
|
227
194
|
|
|
195
|
+
_defineProperty(VictoryBar, "expectedComponents", ["dataComponent", "labelComponent", "groupComponent", "containerComponent"]);
|
|
196
|
+
|
|
228
197
|
var _default = (0, _victoryCore.addEvents)(VictoryBar);
|
|
229
198
|
|
|
230
199
|
exports.default = _default;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "victory-bar",
|
|
3
|
-
"version": "36.
|
|
3
|
+
"version": "36.4.0",
|
|
4
4
|
"description": "Bar Component for Victory",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"data visualization",
|
|
@@ -19,10 +19,10 @@
|
|
|
19
19
|
"author": "Formidable",
|
|
20
20
|
"license": "MIT",
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"d3-shape": "^1.2.0",
|
|
23
22
|
"lodash": "^4.17.19",
|
|
24
23
|
"prop-types": "^15.5.8",
|
|
25
|
-
"victory-core": "^36.
|
|
24
|
+
"victory-core": "^36.4.0",
|
|
25
|
+
"victory-vendor": "^36.4.0"
|
|
26
26
|
},
|
|
27
27
|
"peerDependencies": {
|
|
28
28
|
"react": "^16.6.0 || ^17.0.0"
|
|
@@ -31,5 +31,5 @@
|
|
|
31
31
|
"version": "yarn run nps build-libs && nps build-dists"
|
|
32
32
|
},
|
|
33
33
|
"sideEffects": false,
|
|
34
|
-
"gitHead": "
|
|
34
|
+
"gitHead": "2e05481eeb34f9801a90023a131a21aa7deff082"
|
|
35
35
|
}
|