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.
- package/LICENSE.txt +30 -0
- package/dist/victory-core.js +4376 -1142
- package/dist/victory-core.min.js +1 -1
- package/es/index.d.ts +6 -0
- package/es/index.js +8 -2
- package/es/victory-accessible-group/victory-accessible-group.js +1 -3
- package/es/victory-animation/victory-animation.js +1 -3
- package/es/victory-clip-container/victory-clip-container.js +1 -3
- package/es/victory-container/victory-container.js +1 -3
- package/es/victory-label/victory-label.js +3 -3
- package/es/victory-portal/portal.js +1 -3
- package/es/victory-portal/victory-portal.js +1 -3
- package/es/victory-primitives/point.js +1 -1
- package/es/victory-transition/victory-transition.js +1 -3
- package/es/victory-util/add-events.js +305 -308
- package/es/victory-util/hooks.js +137 -0
- package/es/victory-util/line-helpers.js +45 -0
- package/es/{victory-primitives/path-helpers.js → victory-util/point-path-helpers.js} +0 -0
- package/es/victory-util/timer.js +1 -3
- package/es/victory-util/wrapper.js +372 -457
- package/lib/index.d.ts +6 -0
- package/lib/index.js +78 -8
- package/lib/victory-accessible-group/victory-accessible-group.js +1 -3
- package/lib/victory-animation/victory-animation.js +1 -3
- package/lib/victory-clip-container/victory-clip-container.js +1 -3
- package/lib/victory-container/victory-container.js +1 -3
- package/lib/victory-label/victory-label.js +3 -3
- package/lib/victory-portal/portal.js +1 -3
- package/lib/victory-portal/victory-portal.js +1 -3
- package/lib/victory-primitives/point.js +10 -10
- package/lib/victory-transition/victory-transition.js +1 -3
- package/lib/victory-util/add-events.js +301 -304
- package/lib/victory-util/hooks.js +162 -0
- package/lib/victory-util/line-helpers.js +56 -0
- package/lib/{victory-primitives/path-helpers.js → victory-util/point-path-helpers.js} +0 -0
- package/lib/victory-util/timer.js +1 -3
- package/lib/victory-util/wrapper.js +389 -446
- package/package.json +7 -3
- package/src/index.d.ts +6 -0
- package/src/index.js +5 -1
- package/src/victory-label/victory-label.js +3 -3
- package/src/victory-primitives/point.js +1 -1
- package/src/victory-util/hooks.js +131 -0
- package/src/victory-util/line-helpers.js +54 -0
- package/src/{victory-primitives/path-helpers.js → victory-util/point-path-helpers.js} +0 -0
- package/src/victory-util/transitions.js +0 -1
- 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
|
-
|
|
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
|
|
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
|
|
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
|
|
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 "
|
|
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) {
|