victory-histogram 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 CHANGED
@@ -1,5 +1,13 @@
1
1
  # victory-histogram
2
2
 
3
+ ## 37.3.2
4
+
5
+ ## 37.3.1
6
+
7
+ ### Patch Changes
8
+
9
+ - Remove duplicate types from interfaces ([#2940](https://github.com/FormidableLabs/victory/pull/2940))
10
+
3
11
  ## 37.3.0
4
12
 
5
13
  ## 37.2.0
@@ -333,7 +333,7 @@ const fallbackProps = {
333
333
  };
334
334
  const defaultData = [];
335
335
 
336
- // eslint-disable-next-line @typescript-eslint/no-empty-interface
336
+ // eslint-disable-next-line @typescript-eslint/no-empty-object-type
337
337
 
338
338
  /**
339
339
  * Draw SVG histogram charts with React. VictoryHistogram is a composable component, so it doesn't include axes
@@ -5036,9 +5036,9 @@ const defaultProps = {
5036
5036
  role: "presentation",
5037
5037
  shapeRendering: "auto"
5038
5038
  };
5039
-
5039
+ const Bar = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_1__.forwardRef)(
5040
5040
  // eslint-disable-next-line prefer-arrow-callback
5041
- const Bar = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_1__.forwardRef)(function Bar(initialProps, ref) {
5041
+ function Bar(initialProps, ref) {
5042
5042
  const props = evaluateProps(lodash_defaults__WEBPACK_IMPORTED_MODULE_0___default()({}, initialProps, defaultProps));
5043
5043
  const {
5044
5044
  polar,
@@ -5147,7 +5147,6 @@ const circle = (center, radius) => ({
5147
5147
  // Left-most point is returned as 0th element of array
5148
5148
  // Right-most point is returned as 1st elemennt of array
5149
5149
  intersection(circle1) {
5150
- // eslint-disable-line max-statements
5151
5150
  const P0 = this.center;
5152
5151
  const P1 = circle1.center;
5153
5152
  const r0 = this.radius;
@@ -5469,8 +5468,6 @@ const getVerticalBarPoints = (position, sign, cr) => {
5469
5468
  y0,
5470
5469
  y1
5471
5470
  } = position;
5472
-
5473
- // eslint-disable-next-line max-statements, max-len
5474
5471
  const getHalfPoints = side => {
5475
5472
  const isLeft = side === "Left";
5476
5473
  const signL = isLeft ? 1 : -1;
@@ -5554,8 +5551,6 @@ const getHorizontalBarPoints = (position, sign, cr) => {
5554
5551
  } = position;
5555
5552
  const x0 = position.x0 < position.x1 ? position.x0 : position.x1;
5556
5553
  const x1 = position.x0 < position.x1 ? position.x1 : position.x0;
5557
-
5558
- // eslint-disable-next-line max-statements, max-len
5559
5554
  const getHalfPoints = side => {
5560
5555
  const isTop = side === "top";
5561
5556
  const signL = isTop ? -1 : 1;
@@ -5635,8 +5630,6 @@ const getHorizontalBarPoints = (position, sign, cr) => {
5635
5630
  // eslint-disable-next-line no-magic-numbers
5636
5631
  bottomPoints[3], bottomPoints[2]];
5637
5632
  };
5638
-
5639
- // eslint-disable-next-line max-params
5640
5633
  const getVerticalBarPath = (props, width, cornerRadius) => {
5641
5634
  const position = getPosition(props, width);
5642
5635
  const sign = position.y0 > position.y1 ? 1 : -1;
@@ -5644,8 +5637,6 @@ const getVerticalBarPath = (props, width, cornerRadius) => {
5644
5637
  const points = getVerticalBarPoints(position, sign, cornerRadius);
5645
5638
  return mapPointsToPath(points, cornerRadius, direction);
5646
5639
  };
5647
-
5648
- // eslint-disable-next-line max-params
5649
5640
  const getHorizontalBarPath = (props, width, cornerRadius) => {
5650
5641
  const position = getPosition(props, width);
5651
5642
  const sign = position.x0 < position.x1 ? 1 : -1;
@@ -5703,8 +5694,6 @@ const getVerticalPolarBarPath = (props, cornerRadius) => {
5703
5694
  leftMiddle
5704
5695
  };
5705
5696
  };
5706
-
5707
- // eslint-disable-next-line max-statements
5708
5697
  const getTopPath = () => {
5709
5698
  const {
5710
5699
  topRight,
@@ -5747,8 +5736,6 @@ const getVerticalPolarBarPath = (props, cornerRadius) => {
5747
5736
  coords: subCoords[i].split(",")
5748
5737
  }));
5749
5738
  };
5750
-
5751
- // eslint-disable-next-line max-statements
5752
5739
  const getBottomPath = () => {
5753
5740
  const {
5754
5741
  bottomRight,
@@ -5909,7 +5896,7 @@ const interpolateFunction = function (a, b) {
5909
5896
  return b;
5910
5897
  }
5911
5898
  return function () {
5912
- /* eslint-disable no-invalid-this, prefer-rest-params */
5899
+ /* eslint-disable prefer-rest-params */
5913
5900
  const aval = typeof a === "function" ? a.apply(this, arguments) : a;
5914
5901
  const bval = typeof b === "function" ? b.apply(this, arguments) : b;
5915
5902
  return (0,victory_vendor_d3_interpolate__WEBPACK_IMPORTED_MODULE_2__.interpolate)(aval, bval)(t);
@@ -6301,9 +6288,9 @@ const VictoryContainer = initialProps => {
6301
6288
  ...style,
6302
6289
  width: responsive ? style?.width : dimensions.width,
6303
6290
  height: responsive ? style?.height : dimensions.height,
6304
- pointerEvents: "none",
6305
- touchAction: "none",
6306
- position: "relative"
6291
+ pointerEvents: style?.pointerEvents ?? "none",
6292
+ touchAction: style?.touchAction ?? "none",
6293
+ position: style?.position ?? "relative"
6307
6294
  },
6308
6295
  "data-ouia-component-id": ouiaId,
6309
6296
  "data-ouia-component-type": ouiaType,
@@ -8358,7 +8345,7 @@ class VictoryTransition extends (react__WEBPACK_IMPORTED_MODULE_2___default().Co
8358
8345
  componentDidMount() {
8359
8346
  this.setState({
8360
8347
  nodesShouldLoad: true
8361
- }); // eslint-disable-line react/no-did-mount-set-state
8348
+ });
8362
8349
  }
8363
8350
  shouldComponentUpdate(nextProps) {
8364
8351
  if (!react_fast_compare__WEBPACK_IMPORTED_MODULE_3___default()(this.props, nextProps)) {
@@ -8572,7 +8559,7 @@ const defaultComponents = [{
8572
8559
  function addEvents(WrappedComponent, options) {
8573
8560
  if (options === void 0) {
8574
8561
  options = {};
8575
- } // eslint-disable-next-line @typescript-eslint/no-empty-interface
8562
+ } // eslint-disable-next-line @typescript-eslint/no-empty-object-type
8576
8563
  // @ts-expect-error "TS2545: A mixin class must have a constructor with a single rest parameter of type 'any[]'."
8577
8564
  class AddEventsMixin extends WrappedComponent {
8578
8565
  constructor(props) {
@@ -8941,7 +8928,6 @@ __webpack_require__.r(__webpack_exports__);
8941
8928
 
8942
8929
 
8943
8930
 
8944
- /* eslint-disable no-use-before-define */
8945
8931
 
8946
8932
 
8947
8933
 
@@ -9067,8 +9053,6 @@ function formatDataFromDomain(dataset, domain, defaultBaseline) {
9067
9053
  const isUnderMinY = underMin(minDomainY);
9068
9054
  const isOverMaxX = overMax(maxDomainX);
9069
9055
  const isOverMaxY = overMax(maxDomainY);
9070
-
9071
- // eslint-disable-next-line complexity
9072
9056
  return dataset.map(datum => {
9073
9057
  let {
9074
9058
  _x,
@@ -9179,7 +9163,6 @@ function formatData(dataset, props, expectedKeys) {
9179
9163
  };
9180
9164
  }
9181
9165
  const data = preformattedData ? dataset : dataset.reduce((dataArr, datum, index) => {
9182
- // eslint-disable-line complexity
9183
9166
  const parsedDatum = parseDatum(datum);
9184
9167
  const fallbackValues = {
9185
9168
  x: index,
@@ -9372,7 +9355,6 @@ __webpack_require__.r(__webpack_exports__);
9372
9355
 
9373
9356
 
9374
9357
 
9375
- /* eslint-disable no-use-before-define */
9376
9358
 
9377
9359
 
9378
9360
 
@@ -9428,8 +9410,6 @@ function getExtremeFromData(dataset, axis, type) {
9428
9410
  }, initialValue);
9429
9411
  return containsDate ? new Date(result) : result;
9430
9412
  }
9431
-
9432
- // eslint-disable-next-line max-statements
9433
9413
  function padDomain(domain, props, axis) {
9434
9414
  if (!props.domainPadding) {
9435
9415
  return domain;
@@ -9765,7 +9745,6 @@ __webpack_require__.r(__webpack_exports__);
9765
9745
 
9766
9746
 
9767
9747
 
9768
- /* eslint-disable no-use-before-define */
9769
9748
 
9770
9749
  const GLOBAL_EVENT_REGEX = /^onGlobal(.*)$/;
9771
9750
 
@@ -9813,11 +9792,10 @@ getScopedEvents) {
9813
9792
  */
9814
9793
  const getAllEvents = () => {
9815
9794
  // Mandatory usage: `getEvents.bind(this)`
9816
- /* eslint-disable no-invalid-this */
9795
+
9817
9796
  if (Array.isArray(this.componentEvents)) {
9818
9797
  return Array.isArray(props.events) ? this.componentEvents.concat(...props.events) : this.componentEvents;
9819
9798
  }
9820
- /* eslint-enable no-invalid-this */
9821
9799
  return props.events;
9822
9800
  };
9823
9801
  const allEvents = getAllEvents();
@@ -9842,7 +9820,7 @@ function getScopedEvents(events, namespace, childType, baseProps) {
9842
9820
  }
9843
9821
 
9844
9822
  // Mandatory usage: `getScopedEvents.bind(this)`
9845
- // eslint-disable-next-line no-invalid-this
9823
+
9846
9824
  const newBaseProps = baseProps || this.baseProps;
9847
9825
  // returns the original base props or base state of a given target element
9848
9826
  const getTargetProps = (identifier, type) => {
@@ -9851,7 +9829,6 @@ function getScopedEvents(events, namespace, childType, baseProps) {
9851
9829
  target,
9852
9830
  key
9853
9831
  } = identifier;
9854
- // eslint-disable-next-line no-invalid-this
9855
9832
  const baseType = type === "props" ? newBaseProps : this.state || {};
9856
9833
  const base = childName === undefined || childName === null || !baseType[childName] ? baseType : baseType[childName];
9857
9834
  return key === "parent" ? base.parent : base[key] && base[key][target];
@@ -9878,7 +9855,6 @@ function getScopedEvents(events, namespace, childType, baseProps) {
9878
9855
 
9879
9856
  // returns the state object with mutated props applied for a single key
9880
9857
  const getMutationObject = (key, childName) => {
9881
- // eslint-disable-next-line no-invalid-this
9882
9858
  const baseState = this.state || {};
9883
9859
  if (!(0,_helpers__WEBPACK_IMPORTED_MODULE_4__.isFunction)(eventReturn.mutation)) {
9884
9860
  return baseState;
@@ -9951,11 +9927,9 @@ function getScopedEvents(events, namespace, childType, baseProps) {
9951
9927
  // into a state mutation, and calls setState
9952
9928
  // eslint-disable-next-line max-params
9953
9929
  const onEvent = (evt, childProps, eventKey, eventName) => {
9954
- // eslint-disable-next-line no-invalid-this
9955
9930
  const eventReturn = events[eventName](evt, childProps, eventKey, this);
9956
9931
  if (!lodash_isEmpty__WEBPACK_IMPORTED_MODULE_3___default()(eventReturn)) {
9957
9932
  const callbacks = compileCallbacks(eventReturn);
9958
- // eslint-disable-next-line no-invalid-this
9959
9933
  this.setState(parseEventReturn(eventReturn, eventKey), callbacks);
9960
9934
  }
9961
9935
  };
@@ -9985,7 +9959,7 @@ function getPartialEvents(events, eventKey, childProps) {
9985
9959
  // eslint-disable-next-line max-params
9986
9960
  function getEventState(eventKey, namespace, childType) {
9987
9961
  // Mandatory usage: `getEventState.bind(this)`
9988
- // eslint-disable-next-line no-invalid-this
9962
+
9989
9963
  const state = this.state || {};
9990
9964
  if (!childType) {
9991
9965
  return eventKey === "parent" ? state[eventKey] && state[eventKey][namespace] || state[eventKey] : state[eventKey] && state[eventKey][namespace];
@@ -10178,7 +10152,6 @@ __webpack_require__.r(__webpack_exports__);
10178
10152
 
10179
10153
 
10180
10154
 
10181
- /* eslint-disable no-use-before-define */
10182
10155
 
10183
10156
  // Private Functions
10184
10157
 
@@ -10647,7 +10620,6 @@ __webpack_require__.r(__webpack_exports__);
10647
10620
  /* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_defaults__WEBPACK_IMPORTED_MODULE_0__);
10648
10621
  /* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./helpers */ "../../victory-core/es/victory-util/helpers.js");
10649
10622
 
10650
- /* eslint-disable no-use-before-define */
10651
10623
 
10652
10624
  // Private Functions
10653
10625
 
@@ -10967,7 +10939,6 @@ __webpack_require__.r(__webpack_exports__);
10967
10939
  /* harmony import */ var _collection__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./collection */ "../../victory-core/es/victory-util/collection.js");
10968
10940
  /* harmony import */ var victory_vendor_d3_scale__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! victory-vendor/d3-scale */ "../../victory-vendor/es/d3-scale.js");
10969
10941
 
10970
- /* eslint-disable no-use-before-define */
10971
10942
 
10972
10943
 
10973
10944
 
@@ -11758,8 +11729,6 @@ function getChildBeforeLoad(animate, child, data, cb) {
11758
11729
  clipWidth: 0
11759
11730
  };
11760
11731
  }
11761
-
11762
- // eslint-disable-next-line max-params
11763
11732
  function getChildOnLoad(animate, data, cb) {
11764
11733
  const newAnimate = Object.assign({}, animate, {
11765
11734
  onEnd: cb
@@ -11782,7 +11751,7 @@ function getChildOnLoad(animate, data, cb) {
11782
11751
  };
11783
11752
  }
11784
11753
 
11785
- // eslint-disable-next-line max-params, max-len
11754
+ // eslint-disable-next-line max-params
11786
11755
  function getChildPropsOnExit(animate, child, data, exitingNodes, cb) {
11787
11756
  // Whether or not _this_ child has exiting nodes, we want the exit-
11788
11757
  // transition for all children to have the same duration, delay, etc.
@@ -11806,7 +11775,7 @@ function getChildPropsOnExit(animate, child, data, exitingNodes, cb) {
11806
11775
  };
11807
11776
  }
11808
11777
 
11809
- // eslint-disable-next-line max-params,max-len
11778
+ // eslint-disable-next-line max-params
11810
11779
  function getChildPropsBeforeEnter(animate, child, data, enteringNodes, cb) {
11811
11780
  let newAnimate = animate;
11812
11781
  let newData = data;
@@ -11831,7 +11800,7 @@ function getChildPropsBeforeEnter(animate, child, data, enteringNodes, cb) {
11831
11800
  };
11832
11801
  }
11833
11802
 
11834
- // eslint-disable-next-line max-params, max-len
11803
+ // eslint-disable-next-line max-params
11835
11804
  function getChildPropsOnEnter(animate, data, enteringNodes, cb) {
11836
11805
  // Whether or not _this_ child has entering nodes, we want the entering-
11837
11806
  // transition for all children to have the same duration, delay, etc.
@@ -11938,8 +11907,6 @@ function getTransitionPropsFactory(props, state, setState) {
11938
11907
  }
11939
11908
  return {};
11940
11909
  };
11941
-
11942
- // eslint-disable-next-line max-statements, complexity, max-len
11943
11910
  return function getTransitionProps(child, index) {
11944
11911
  const data = getChildData(child) || [];
11945
11912
  const animate = lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({}, props.animate, child.props.animate);