victory-chart 37.3.0 → 37.3.2
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 +4 -0
- package/dist/victory-chart.js +16 -46
- package/dist/victory-chart.min.js +1 -1
- package/es/helper-methods.js +0 -2
- package/lib/helper-methods.js +0 -2
- package/package.json +9 -13
- package/src/helper-methods.tsx +0 -2
package/CHANGELOG.md
CHANGED
package/dist/victory-chart.js
CHANGED
|
@@ -34,8 +34,6 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
34
34
|
/* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-util/wrapper.js");
|
|
35
35
|
/* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-util/scale.js");
|
|
36
36
|
|
|
37
|
-
/* eslint-disable no-use-before-define */
|
|
38
|
-
|
|
39
37
|
|
|
40
38
|
|
|
41
39
|
const fallbackProps = {
|
|
@@ -5406,8 +5404,6 @@ const isEqual = (a, b) => {
|
|
|
5406
5404
|
}
|
|
5407
5405
|
return a === b;
|
|
5408
5406
|
};
|
|
5409
|
-
|
|
5410
|
-
// eslint-disable-next-line complexity
|
|
5411
5407
|
const getOffset = (props, calculatedValues) => {
|
|
5412
5408
|
const {
|
|
5413
5409
|
scale,
|
|
@@ -5450,8 +5446,6 @@ const getOffset = (props, calculatedValues) => {
|
|
|
5450
5446
|
y: offsetY
|
|
5451
5447
|
};
|
|
5452
5448
|
};
|
|
5453
|
-
|
|
5454
|
-
// eslint-disable-next-line complexity
|
|
5455
5449
|
const getHorizontalOffset = (props, calculatedValues) => {
|
|
5456
5450
|
const {
|
|
5457
5451
|
scale,
|
|
@@ -5592,8 +5586,6 @@ const getOrientation = props => {
|
|
|
5592
5586
|
};
|
|
5593
5587
|
return props.dependentAxis ? defaultOrientations.dependent : defaultOrientations.independent;
|
|
5594
5588
|
};
|
|
5595
|
-
|
|
5596
|
-
// eslint-disable-next-line complexity
|
|
5597
5589
|
const getCalculatedValues = props => {
|
|
5598
5590
|
const defaultStyles = getStyleObject(props);
|
|
5599
5591
|
const style = getStyles(props, defaultStyles);
|
|
@@ -5720,7 +5712,6 @@ const getBaseProps = (initialProps, fallbackProps) => {
|
|
|
5720
5712
|
[otherAxis]: props.scale[otherAxis]
|
|
5721
5713
|
} : undefined
|
|
5722
5714
|
};
|
|
5723
|
-
// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion
|
|
5724
5715
|
return ticks.reduce((childProps, tickValue, index) => {
|
|
5725
5716
|
const tick = stringTicks ? stringTicks[index] : tickValue;
|
|
5726
5717
|
const text = tickFormat(tickValue, index, ticks);
|
|
@@ -5808,7 +5799,7 @@ const options = {
|
|
|
5808
5799
|
}]
|
|
5809
5800
|
};
|
|
5810
5801
|
|
|
5811
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-
|
|
5802
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
5812
5803
|
|
|
5813
5804
|
class VictoryAxisBase extends (react__WEBPACK_IMPORTED_MODULE_1___default().Component) {
|
|
5814
5805
|
static animationWhitelist = ["style", "domain", "range", "tickCount", "tickValues", "offsetX", "offsetY", "padding", "width", "height"];
|
|
@@ -6057,7 +6048,7 @@ const interpolateFunction = function (a, b) {
|
|
|
6057
6048
|
return b;
|
|
6058
6049
|
}
|
|
6059
6050
|
return function () {
|
|
6060
|
-
/* eslint-disable
|
|
6051
|
+
/* eslint-disable prefer-rest-params */
|
|
6061
6052
|
const aval = typeof a === "function" ? a.apply(this, arguments) : a;
|
|
6062
6053
|
const bval = typeof b === "function" ? b.apply(this, arguments) : b;
|
|
6063
6054
|
return (0,victory_vendor_d3_interpolate__WEBPACK_IMPORTED_MODULE_2__.interpolate)(aval, bval)(t);
|
|
@@ -6449,9 +6440,9 @@ const VictoryContainer = initialProps => {
|
|
|
6449
6440
|
...style,
|
|
6450
6441
|
width: responsive ? style?.width : dimensions.width,
|
|
6451
6442
|
height: responsive ? style?.height : dimensions.height,
|
|
6452
|
-
pointerEvents: "none",
|
|
6453
|
-
touchAction: "none",
|
|
6454
|
-
position: "relative"
|
|
6443
|
+
pointerEvents: style?.pointerEvents ?? "none",
|
|
6444
|
+
touchAction: style?.touchAction ?? "none",
|
|
6445
|
+
position: style?.position ?? "relative"
|
|
6455
6446
|
},
|
|
6456
6447
|
"data-ouia-component-id": ouiaId,
|
|
6457
6448
|
"data-ouia-component-type": ouiaType,
|
|
@@ -8827,7 +8818,7 @@ class VictoryTransition extends (react__WEBPACK_IMPORTED_MODULE_2___default().Co
|
|
|
8827
8818
|
componentDidMount() {
|
|
8828
8819
|
this.setState({
|
|
8829
8820
|
nodesShouldLoad: true
|
|
8830
|
-
});
|
|
8821
|
+
});
|
|
8831
8822
|
}
|
|
8832
8823
|
shouldComponentUpdate(nextProps) {
|
|
8833
8824
|
if (!react_fast_compare__WEBPACK_IMPORTED_MODULE_3___default()(this.props, nextProps)) {
|
|
@@ -9041,7 +9032,7 @@ const defaultComponents = [{
|
|
|
9041
9032
|
function addEvents(WrappedComponent, options) {
|
|
9042
9033
|
if (options === void 0) {
|
|
9043
9034
|
options = {};
|
|
9044
|
-
} // eslint-disable-next-line @typescript-eslint/no-empty-
|
|
9035
|
+
} // eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
9045
9036
|
// @ts-expect-error "TS2545: A mixin class must have a constructor with a single rest parameter of type 'any[]'."
|
|
9046
9037
|
class AddEventsMixin extends WrappedComponent {
|
|
9047
9038
|
constructor(props) {
|
|
@@ -9596,7 +9587,7 @@ function getTicks(props, scale, filterZero) {
|
|
|
9596
9587
|
* @param {String} axis: either x or y
|
|
9597
9588
|
* @returns {Array} returns a domain from tickValues
|
|
9598
9589
|
*/
|
|
9599
|
-
|
|
9590
|
+
|
|
9600
9591
|
function getDomainFromData(props, axis) {
|
|
9601
9592
|
const {
|
|
9602
9593
|
polar,
|
|
@@ -9793,7 +9784,6 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
9793
9784
|
|
|
9794
9785
|
|
|
9795
9786
|
|
|
9796
|
-
/* eslint-disable no-use-before-define */
|
|
9797
9787
|
|
|
9798
9788
|
|
|
9799
9789
|
|
|
@@ -9919,8 +9909,6 @@ function formatDataFromDomain(dataset, domain, defaultBaseline) {
|
|
|
9919
9909
|
const isUnderMinY = underMin(minDomainY);
|
|
9920
9910
|
const isOverMaxX = overMax(maxDomainX);
|
|
9921
9911
|
const isOverMaxY = overMax(maxDomainY);
|
|
9922
|
-
|
|
9923
|
-
// eslint-disable-next-line complexity
|
|
9924
9912
|
return dataset.map(datum => {
|
|
9925
9913
|
let {
|
|
9926
9914
|
_x,
|
|
@@ -10031,7 +10019,6 @@ function formatData(dataset, props, expectedKeys) {
|
|
|
10031
10019
|
};
|
|
10032
10020
|
}
|
|
10033
10021
|
const data = preformattedData ? dataset : dataset.reduce((dataArr, datum, index) => {
|
|
10034
|
-
// eslint-disable-line complexity
|
|
10035
10022
|
const parsedDatum = parseDatum(datum);
|
|
10036
10023
|
const fallbackValues = {
|
|
10037
10024
|
x: index,
|
|
@@ -10224,7 +10211,6 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
10224
10211
|
|
|
10225
10212
|
|
|
10226
10213
|
|
|
10227
|
-
/* eslint-disable no-use-before-define */
|
|
10228
10214
|
|
|
10229
10215
|
|
|
10230
10216
|
|
|
@@ -10280,8 +10266,6 @@ function getExtremeFromData(dataset, axis, type) {
|
|
|
10280
10266
|
}, initialValue);
|
|
10281
10267
|
return containsDate ? new Date(result) : result;
|
|
10282
10268
|
}
|
|
10283
|
-
|
|
10284
|
-
// eslint-disable-next-line max-statements
|
|
10285
10269
|
function padDomain(domain, props, axis) {
|
|
10286
10270
|
if (!props.domainPadding) {
|
|
10287
10271
|
return domain;
|
|
@@ -10617,7 +10601,6 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
10617
10601
|
|
|
10618
10602
|
|
|
10619
10603
|
|
|
10620
|
-
/* eslint-disable no-use-before-define */
|
|
10621
10604
|
|
|
10622
10605
|
const GLOBAL_EVENT_REGEX = /^onGlobal(.*)$/;
|
|
10623
10606
|
|
|
@@ -10665,11 +10648,10 @@ getScopedEvents) {
|
|
|
10665
10648
|
*/
|
|
10666
10649
|
const getAllEvents = () => {
|
|
10667
10650
|
// Mandatory usage: `getEvents.bind(this)`
|
|
10668
|
-
|
|
10651
|
+
|
|
10669
10652
|
if (Array.isArray(this.componentEvents)) {
|
|
10670
10653
|
return Array.isArray(props.events) ? this.componentEvents.concat(...props.events) : this.componentEvents;
|
|
10671
10654
|
}
|
|
10672
|
-
/* eslint-enable no-invalid-this */
|
|
10673
10655
|
return props.events;
|
|
10674
10656
|
};
|
|
10675
10657
|
const allEvents = getAllEvents();
|
|
@@ -10694,7 +10676,7 @@ function getScopedEvents(events, namespace, childType, baseProps) {
|
|
|
10694
10676
|
}
|
|
10695
10677
|
|
|
10696
10678
|
// Mandatory usage: `getScopedEvents.bind(this)`
|
|
10697
|
-
|
|
10679
|
+
|
|
10698
10680
|
const newBaseProps = baseProps || this.baseProps;
|
|
10699
10681
|
// returns the original base props or base state of a given target element
|
|
10700
10682
|
const getTargetProps = (identifier, type) => {
|
|
@@ -10703,7 +10685,6 @@ function getScopedEvents(events, namespace, childType, baseProps) {
|
|
|
10703
10685
|
target,
|
|
10704
10686
|
key
|
|
10705
10687
|
} = identifier;
|
|
10706
|
-
// eslint-disable-next-line no-invalid-this
|
|
10707
10688
|
const baseType = type === "props" ? newBaseProps : this.state || {};
|
|
10708
10689
|
const base = childName === undefined || childName === null || !baseType[childName] ? baseType : baseType[childName];
|
|
10709
10690
|
return key === "parent" ? base.parent : base[key] && base[key][target];
|
|
@@ -10730,7 +10711,6 @@ function getScopedEvents(events, namespace, childType, baseProps) {
|
|
|
10730
10711
|
|
|
10731
10712
|
// returns the state object with mutated props applied for a single key
|
|
10732
10713
|
const getMutationObject = (key, childName) => {
|
|
10733
|
-
// eslint-disable-next-line no-invalid-this
|
|
10734
10714
|
const baseState = this.state || {};
|
|
10735
10715
|
if (!(0,_helpers__WEBPACK_IMPORTED_MODULE_4__.isFunction)(eventReturn.mutation)) {
|
|
10736
10716
|
return baseState;
|
|
@@ -10803,11 +10783,9 @@ function getScopedEvents(events, namespace, childType, baseProps) {
|
|
|
10803
10783
|
// into a state mutation, and calls setState
|
|
10804
10784
|
// eslint-disable-next-line max-params
|
|
10805
10785
|
const onEvent = (evt, childProps, eventKey, eventName) => {
|
|
10806
|
-
// eslint-disable-next-line no-invalid-this
|
|
10807
10786
|
const eventReturn = events[eventName](evt, childProps, eventKey, this);
|
|
10808
10787
|
if (!lodash_isEmpty__WEBPACK_IMPORTED_MODULE_3___default()(eventReturn)) {
|
|
10809
10788
|
const callbacks = compileCallbacks(eventReturn);
|
|
10810
|
-
// eslint-disable-next-line no-invalid-this
|
|
10811
10789
|
this.setState(parseEventReturn(eventReturn, eventKey), callbacks);
|
|
10812
10790
|
}
|
|
10813
10791
|
};
|
|
@@ -10837,7 +10815,7 @@ function getPartialEvents(events, eventKey, childProps) {
|
|
|
10837
10815
|
// eslint-disable-next-line max-params
|
|
10838
10816
|
function getEventState(eventKey, namespace, childType) {
|
|
10839
10817
|
// Mandatory usage: `getEventState.bind(this)`
|
|
10840
|
-
|
|
10818
|
+
|
|
10841
10819
|
const state = this.state || {};
|
|
10842
10820
|
if (!childType) {
|
|
10843
10821
|
return eventKey === "parent" ? state[eventKey] && state[eventKey][namespace] || state[eventKey] : state[eventKey] && state[eventKey][namespace];
|
|
@@ -11030,7 +11008,6 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
11030
11008
|
|
|
11031
11009
|
|
|
11032
11010
|
|
|
11033
|
-
/* eslint-disable no-use-before-define */
|
|
11034
11011
|
|
|
11035
11012
|
// Private Functions
|
|
11036
11013
|
|
|
@@ -11642,7 +11619,6 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
11642
11619
|
/* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_defaults__WEBPACK_IMPORTED_MODULE_0__);
|
|
11643
11620
|
/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./helpers */ "../../victory-core/es/victory-util/helpers.js");
|
|
11644
11621
|
|
|
11645
|
-
/* eslint-disable no-use-before-define */
|
|
11646
11622
|
|
|
11647
11623
|
// Private Functions
|
|
11648
11624
|
|
|
@@ -11962,7 +11938,6 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
11962
11938
|
/* harmony import */ var _collection__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./collection */ "../../victory-core/es/victory-util/collection.js");
|
|
11963
11939
|
/* harmony import */ var victory_vendor_d3_scale__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! victory-vendor/d3-scale */ "../../victory-vendor/es/d3-scale.js");
|
|
11964
11940
|
|
|
11965
|
-
/* eslint-disable no-use-before-define */
|
|
11966
11941
|
|
|
11967
11942
|
|
|
11968
11943
|
|
|
@@ -12753,8 +12728,6 @@ function getChildBeforeLoad(animate, child, data, cb) {
|
|
|
12753
12728
|
clipWidth: 0
|
|
12754
12729
|
};
|
|
12755
12730
|
}
|
|
12756
|
-
|
|
12757
|
-
// eslint-disable-next-line max-params
|
|
12758
12731
|
function getChildOnLoad(animate, data, cb) {
|
|
12759
12732
|
const newAnimate = Object.assign({}, animate, {
|
|
12760
12733
|
onEnd: cb
|
|
@@ -12777,7 +12750,7 @@ function getChildOnLoad(animate, data, cb) {
|
|
|
12777
12750
|
};
|
|
12778
12751
|
}
|
|
12779
12752
|
|
|
12780
|
-
// eslint-disable-next-line max-params
|
|
12753
|
+
// eslint-disable-next-line max-params
|
|
12781
12754
|
function getChildPropsOnExit(animate, child, data, exitingNodes, cb) {
|
|
12782
12755
|
// Whether or not _this_ child has exiting nodes, we want the exit-
|
|
12783
12756
|
// transition for all children to have the same duration, delay, etc.
|
|
@@ -12801,7 +12774,7 @@ function getChildPropsOnExit(animate, child, data, exitingNodes, cb) {
|
|
|
12801
12774
|
};
|
|
12802
12775
|
}
|
|
12803
12776
|
|
|
12804
|
-
// eslint-disable-next-line max-params
|
|
12777
|
+
// eslint-disable-next-line max-params
|
|
12805
12778
|
function getChildPropsBeforeEnter(animate, child, data, enteringNodes, cb) {
|
|
12806
12779
|
let newAnimate = animate;
|
|
12807
12780
|
let newData = data;
|
|
@@ -12826,7 +12799,7 @@ function getChildPropsBeforeEnter(animate, child, data, enteringNodes, cb) {
|
|
|
12826
12799
|
};
|
|
12827
12800
|
}
|
|
12828
12801
|
|
|
12829
|
-
// eslint-disable-next-line max-params
|
|
12802
|
+
// eslint-disable-next-line max-params
|
|
12830
12803
|
function getChildPropsOnEnter(animate, data, enteringNodes, cb) {
|
|
12831
12804
|
// Whether or not _this_ child has entering nodes, we want the entering-
|
|
12832
12805
|
// transition for all children to have the same duration, delay, etc.
|
|
@@ -12933,8 +12906,6 @@ function getTransitionPropsFactory(props, state, setState) {
|
|
|
12933
12906
|
}
|
|
12934
12907
|
return {};
|
|
12935
12908
|
};
|
|
12936
|
-
|
|
12937
|
-
// eslint-disable-next-line max-statements, complexity, max-len
|
|
12938
12909
|
return function getTransitionProps(child, index) {
|
|
12939
12910
|
const data = getChildData(child) || [];
|
|
12940
12911
|
const animate = lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({}, props.animate, child.props.animate);
|
|
@@ -13322,7 +13293,6 @@ function getDefaultDomainPadding(props, axis, childComponents) {
|
|
|
13322
13293
|
};
|
|
13323
13294
|
}
|
|
13324
13295
|
function getDomainFromChildren(props, axis, childComponents) {
|
|
13325
|
-
// eslint-disable-line max-statements, complexity, max-len
|
|
13326
13296
|
const children = childComponents ? childComponents.slice(0) : react__WEBPACK_IMPORTED_MODULE_4___default().Children.toArray(props.children);
|
|
13327
13297
|
const parentData = props.data ? _data__WEBPACK_IMPORTED_MODULE_7__.getData(props) : undefined;
|
|
13328
13298
|
const {
|
|
@@ -14004,7 +13974,7 @@ const fallbackProps = {
|
|
|
14004
13974
|
padding: 50
|
|
14005
13975
|
};
|
|
14006
13976
|
|
|
14007
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-
|
|
13977
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
14008
13978
|
|
|
14009
13979
|
class VictoryPolarAxisBase extends (react__WEBPACK_IMPORTED_MODULE_1___default().Component) {
|
|
14010
13980
|
static animationWhitelist = ["style", "domain", "range", "tickCount", "tickValues", "padding", "width", "height"];
|
|
@@ -14194,7 +14164,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
14194
14164
|
// to refactor in our current refactoring effort. Please do not make changes
|
|
14195
14165
|
// to this file without manual testing and/or refactoring and adding tests.
|
|
14196
14166
|
|
|
14197
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-
|
|
14167
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
14198
14168
|
|
|
14199
14169
|
class VictorySharedEvents extends (react__WEBPACK_IMPORTED_MODULE_3___default().Component) {
|
|
14200
14170
|
static displayName = "VictorySharedEvents";
|