victory-core 35.11.2 → 36.1.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.
Files changed (47) hide show
  1. package/LICENSE.txt +30 -0
  2. package/dist/victory-core.js +4376 -1142
  3. package/dist/victory-core.min.js +1 -1
  4. package/es/index.d.ts +6 -0
  5. package/es/index.js +8 -2
  6. package/es/victory-accessible-group/victory-accessible-group.js +1 -3
  7. package/es/victory-animation/victory-animation.js +1 -3
  8. package/es/victory-clip-container/victory-clip-container.js +1 -3
  9. package/es/victory-container/victory-container.js +1 -3
  10. package/es/victory-label/victory-label.js +3 -3
  11. package/es/victory-portal/portal.js +1 -3
  12. package/es/victory-portal/victory-portal.js +1 -3
  13. package/es/victory-primitives/point.js +1 -1
  14. package/es/victory-transition/victory-transition.js +1 -3
  15. package/es/victory-util/add-events.js +305 -308
  16. package/es/victory-util/hooks.js +137 -0
  17. package/es/victory-util/line-helpers.js +45 -0
  18. package/es/{victory-primitives/path-helpers.js → victory-util/point-path-helpers.js} +0 -0
  19. package/es/victory-util/timer.js +1 -3
  20. package/es/victory-util/wrapper.js +372 -457
  21. package/lib/index.d.ts +6 -0
  22. package/lib/index.js +78 -8
  23. package/lib/victory-accessible-group/victory-accessible-group.js +1 -3
  24. package/lib/victory-animation/victory-animation.js +1 -3
  25. package/lib/victory-clip-container/victory-clip-container.js +1 -3
  26. package/lib/victory-container/victory-container.js +1 -3
  27. package/lib/victory-label/victory-label.js +3 -3
  28. package/lib/victory-portal/portal.js +1 -3
  29. package/lib/victory-portal/victory-portal.js +1 -3
  30. package/lib/victory-primitives/point.js +10 -10
  31. package/lib/victory-transition/victory-transition.js +1 -3
  32. package/lib/victory-util/add-events.js +301 -304
  33. package/lib/victory-util/hooks.js +162 -0
  34. package/lib/victory-util/line-helpers.js +56 -0
  35. package/lib/{victory-primitives/path-helpers.js → victory-util/point-path-helpers.js} +0 -0
  36. package/lib/victory-util/timer.js +1 -3
  37. package/lib/victory-util/wrapper.js +389 -446
  38. package/package.json +7 -3
  39. package/src/index.d.ts +6 -0
  40. package/src/index.js +5 -1
  41. package/src/victory-label/victory-label.js +3 -3
  42. package/src/victory-primitives/point.js +1 -1
  43. package/src/victory-util/hooks.js +131 -0
  44. package/src/victory-util/line-helpers.js +54 -0
  45. package/src/{victory-primitives/path-helpers.js → victory-util/point-path-helpers.js} +0 -0
  46. package/src/victory-util/transitions.js +0 -1
  47. package/src/victory-util/wrapper.js +422 -518
package/es/index.d.ts CHANGED
@@ -429,6 +429,12 @@ export interface VictoryThemeDefinition {
429
429
  labels?: VictoryLabelStyleObject | VictoryLabelStyleObject[];
430
430
  };
431
431
  } & VictoryCommonThemeProps;
432
+ histogram?: {
433
+ style?: {
434
+ data?: VictoryStyleObject;
435
+ labels?: VictoryLabelStyleObject | VictoryLabelStyleObject[];
436
+ };
437
+ } & VictoryCommonThemeProps;
432
438
  independentAxis?: {
433
439
  style?: {
434
440
  axis?: VictoryStyleObject;
package/es/index.js CHANGED
@@ -57,8 +57,14 @@ import * as _Transitions from "./victory-util/transitions";
57
57
  export { _Transitions as Transitions };
58
58
  import * as _CommonProps from "./victory-util/common-props";
59
59
  export { _CommonProps as CommonProps };
60
- export { default as Wrapper } from "./victory-util/wrapper";
60
+ import * as _Wrapper from "./victory-util/wrapper";
61
+ export { _Wrapper as Wrapper };
61
62
  import * as _Axis from "./victory-util/axis";
62
63
  export { _Axis as Axis };
63
64
  export { default as TimerContext } from "./victory-util/timer-context";
64
- export { default as PortalContext } from "./victory-portal/portal-context";
65
+ export { default as PortalContext } from "./victory-portal/portal-context";
66
+ export * from "./victory-util/hooks";
67
+ import * as _LineHelpers from "./victory-util/line-helpers";
68
+ export { _LineHelpers as LineHelpers }; // TODO: Fix this default export
69
+
70
+ export { default as PointPathHelpers } from "./victory-util/point-path-helpers";
@@ -13,9 +13,7 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
13
13
  import React from "react";
14
14
  import PropTypes from "prop-types";
15
15
 
16
- var VictoryAccessibleGroup =
17
- /*#__PURE__*/
18
- function (_React$Component) {
16
+ var VictoryAccessibleGroup = /*#__PURE__*/function (_React$Component) {
19
17
  _inherits(VictoryAccessibleGroup, _React$Component);
20
18
 
21
19
  function VictoryAccessibleGroup() {
@@ -26,9 +26,7 @@ import { victoryInterpolator } from "./util";
26
26
  import TimerContext from "../victory-util/timer-context";
27
27
  import isEqual from "react-fast-compare";
28
28
 
29
- var VictoryAnimation =
30
- /*#__PURE__*/
31
- function (_React$Component) {
29
+ var VictoryAnimation = /*#__PURE__*/function (_React$Component) {
32
30
  _inherits(VictoryAnimation, _React$Component);
33
31
 
34
32
  function VictoryAnimation(props, context) {
@@ -35,9 +35,7 @@ import ClipPath from "../victory-primitives/clip-path";
35
35
  import Circle from "../victory-primitives/circle";
36
36
  import Rect from "../victory-primitives/rect";
37
37
 
38
- var VictoryClipContainer =
39
- /*#__PURE__*/
40
- function (_React$Component) {
38
+ var VictoryClipContainer = /*#__PURE__*/function (_React$Component) {
41
39
  _inherits(VictoryClipContainer, _React$Component);
42
40
 
43
41
  function VictoryClipContainer(props) {
@@ -30,9 +30,7 @@ import PortalContext from "../victory-portal/portal-context";
30
30
  import TimerContext from "../victory-util/timer-context";
31
31
  import * as Helpers from "../victory-util/helpers";
32
32
 
33
- var VictoryContainer =
34
- /*#__PURE__*/
35
- function (_React$Component) {
33
+ var VictoryContainer = /*#__PURE__*/function (_React$Component) {
36
34
  _inherits(VictoryContainer, _React$Component);
37
35
 
38
36
  function VictoryContainer(props) {
@@ -69,7 +69,7 @@ var getSingleValue = function (prop) {
69
69
  return Array.isArray(prop) ? prop[index] || prop[0] : prop;
70
70
  };
71
71
 
72
- var useMultiLineBackgrounds = function (props) {
72
+ var shouldUseMultilineBackgrounds = function (props) {
73
73
  var backgroundStyle = props.backgroundStyle,
74
74
  backgroundPadding = props.backgroundPadding;
75
75
  return Array.isArray(backgroundStyle) && !_isEmpty(backgroundStyle) || Array.isArray(backgroundPadding) && !_isEmpty(backgroundPadding);
@@ -361,7 +361,7 @@ var getChildBackgrounds = function (calculatedProps, tspanValues) {
361
361
  };
362
362
 
363
363
  var getBackgroundElement = function (calculatedProps, tspanValues) {
364
- return useMultiLineBackgrounds(calculatedProps) ? getChildBackgrounds(calculatedProps, tspanValues) : getFullBackground(calculatedProps, tspanValues);
364
+ return shouldUseMultilineBackgrounds(calculatedProps) ? getChildBackgrounds(calculatedProps, tspanValues) : getFullBackground(calculatedProps, tspanValues);
365
365
  };
366
366
 
367
367
  var calculateSpanDy = function (tspanValues, i, calculatedProps) {
@@ -372,7 +372,7 @@ var calculateSpanDy = function (tspanValues, i, calculatedProps) {
372
372
  var previousCaps = previous.fontSize - previous.capHeight;
373
373
  var currentCaps = current.fontSize - current.capHeight;
374
374
  var textHeight = previousHeight - previous.fontSize / 2 + current.fontSize / 2 - previousHeight / 2 + currentHeight / 2 - currentCaps / 2 + previousCaps / 2;
375
- return useMultiLineBackgrounds(calculatedProps) ? textHeight + current.backgroundPadding.top + previous.backgroundPadding.bottom : textHeight;
375
+ return shouldUseMultilineBackgrounds(calculatedProps) ? textHeight + current.backgroundPadding.top + previous.backgroundPadding.bottom : textHeight;
376
376
  };
377
377
 
378
378
  var getTSpanDy = function (tspanValues, calculatedProps, i) {
@@ -16,9 +16,7 @@ import React from "react";
16
16
  import PropTypes from "prop-types";
17
17
  import * as CustomPropTypes from "../victory-util/prop-types";
18
18
 
19
- var Portal =
20
- /*#__PURE__*/
21
- function (_React$Component) {
19
+ var Portal = /*#__PURE__*/function (_React$Component) {
22
20
  _inherits(Portal, _React$Component);
23
21
 
24
22
  function Portal(props) {
@@ -18,9 +18,7 @@ import * as Log from "../victory-util/log";
18
18
  import * as Helpers from "../victory-util/helpers";
19
19
  import PortalContext from "./portal-context";
20
20
 
21
- var VictoryPortal =
22
- /*#__PURE__*/
23
- function (_React$Component) {
21
+ var VictoryPortal = /*#__PURE__*/function (_React$Component) {
24
22
  _inherits(VictoryPortal, _React$Component);
25
23
 
26
24
  function VictoryPortal() {
@@ -7,7 +7,7 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
7
7
  import React from "react";
8
8
  import PropTypes from "prop-types";
9
9
  import * as Helpers from "../victory-util/helpers";
10
- import pathHelpers from "./path-helpers";
10
+ import pathHelpers from "../victory-util/point-path-helpers";
11
11
  import * as CommonProps from "../victory-util/common-props";
12
12
  import Path from "./path";
13
13
 
@@ -26,9 +26,7 @@ import TimerContext from "../victory-util/timer-context";
26
26
  import * as Transitions from "../victory-util/transitions";
27
27
  import isEqual from "react-fast-compare";
28
28
 
29
- var VictoryTransition =
30
- /*#__PURE__*/
31
- function (_React$Component) {
29
+ var VictoryTransition = /*#__PURE__*/function (_React$Component) {
32
30
  _inherits(VictoryTransition, _React$Component);
33
31
 
34
32
  function VictoryTransition(props, context) {