victory-core 36.3.2 → 36.5.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-core.js +15084 -15018
- package/dist/victory-core.min.js +1 -1
- package/es/index.d.ts +38 -941
- package/es/index.js +19 -28
- package/es/types.d.ts +33 -0
- package/es/types.js +1 -0
- package/es/victory-accessible-group/victory-accessible-group.d.ts +25 -0
- package/es/victory-accessible-group/victory-accessible-group.js +35 -45
- package/es/victory-animation/util.d.ts +66 -0
- package/es/victory-animation/util.js +3 -2
- package/es/victory-animation/victory-animation.d.ts +69 -0
- package/es/victory-animation/victory-animation.js +92 -102
- package/es/victory-clip-container/victory-clip-container.d.ts +76 -0
- package/es/victory-clip-container/victory-clip-container.js +75 -82
- package/es/victory-container/victory-container.d.ts +99 -0
- package/es/victory-container/victory-container.js +97 -107
- package/es/victory-label/victory-label.d.ts +61 -0
- package/es/victory-label/victory-label.js +43 -31
- package/es/victory-portal/portal-context.d.ts +11 -0
- package/es/victory-portal/portal-context.js +3 -4
- package/es/victory-portal/portal.d.ts +28 -0
- package/es/victory-portal/portal.js +44 -50
- package/es/victory-portal/victory-portal.d.ts +31 -0
- package/es/victory-portal/victory-portal.js +38 -47
- package/es/victory-primitives/arc.d.ts +21 -0
- package/es/victory-primitives/arc.js +9 -9
- package/es/victory-primitives/background.d.ts +22 -0
- package/es/victory-primitives/background.js +12 -12
- package/es/victory-primitives/border.d.ts +18 -0
- package/es/victory-primitives/border.js +9 -9
- package/es/victory-primitives/circle.d.ts +2 -0
- package/es/victory-primitives/circle.js +17 -10
- package/es/victory-primitives/clip-path.d.ts +14 -0
- package/es/victory-primitives/clip-path.js +6 -6
- package/es/victory-primitives/index.d.ts +14 -0
- package/es/victory-primitives/index.js +14 -0
- package/es/victory-primitives/line-segment.d.ts +19 -0
- package/es/victory-primitives/line-segment.js +9 -9
- package/es/victory-primitives/line.d.ts +2 -0
- package/es/victory-primitives/line.js +17 -10
- package/es/victory-primitives/path.d.ts +2 -0
- package/es/victory-primitives/path.js +15 -8
- package/es/victory-primitives/point.d.ts +21 -0
- package/es/victory-primitives/point.js +15 -23
- package/es/victory-primitives/rect.d.ts +2 -0
- package/es/victory-primitives/rect.js +17 -10
- package/es/victory-primitives/text.d.ts +16 -0
- package/es/victory-primitives/text.js +13 -8
- package/es/victory-primitives/tspan.d.ts +2 -0
- package/es/victory-primitives/tspan.js +7 -6
- package/es/victory-primitives/types.d.ts +7 -0
- package/es/victory-primitives/types.js +1 -0
- package/es/victory-primitives/whisker.d.ts +24 -0
- package/es/victory-primitives/whisker.js +12 -12
- package/es/victory-theme/grayscale.d.ts +2 -0
- package/es/victory-theme/grayscale.js +1 -1
- package/es/victory-theme/material.d.ts +2 -0
- package/es/victory-theme/material.js +1 -1
- package/es/victory-theme/victory-theme-definition.d.ts +244 -0
- package/es/victory-theme/victory-theme-definition.js +1 -0
- package/es/victory-theme/victory-theme.d.ts +5 -0
- package/es/victory-theme/victory-theme.js +6 -5
- package/es/victory-transition/victory-transition.d.ts +59 -0
- package/es/victory-transition/victory-transition.js +38 -44
- package/es/victory-util/add-events.js +328 -319
- package/es/victory-util/axis.js +12 -6
- package/es/victory-util/collection.js +7 -5
- package/es/victory-util/common-props.js +2 -2
- package/es/victory-util/data.js +8 -6
- package/es/victory-util/default-transitions.js +0 -1
- package/es/victory-util/domain.js +7 -5
- package/es/victory-util/events.js +8 -4
- package/es/victory-util/helpers.js +1 -3
- package/es/victory-util/hooks/use-animation-state.js +11 -5
- package/es/victory-util/immutable.js +0 -1
- package/es/victory-util/label-helpers.js +0 -2
- package/es/victory-util/line-helpers.js +1 -1
- package/es/victory-util/log.js +0 -1
- package/es/victory-util/point-path-helpers.d.ts +9 -0
- package/es/victory-util/point-path-helpers.js +59 -61
- package/es/victory-util/scale.js +19 -19
- package/es/victory-util/selection.d.ts +23 -0
- package/es/victory-util/selection.js +0 -2
- package/es/victory-util/style.js +0 -2
- package/es/victory-util/textsize.d.ts +8 -0
- package/es/victory-util/textsize.js +11 -7
- package/es/victory-util/timer-context.d.ts +11 -0
- package/es/victory-util/timer-context.js +1 -1
- package/es/victory-util/timer.d.ts +16 -0
- package/es/victory-util/timer.js +16 -13
- package/es/victory-util/types.d.ts +188 -0
- package/es/victory-util/types.js +1 -0
- package/es/victory-util/user-props.js +44 -4
- package/es/victory-util/wrapper.js +18 -12
- package/lib/index.d.ts +38 -941
- package/lib/index.js +201 -189
- package/lib/types.d.ts +33 -0
- package/lib/types.js +1 -0
- package/lib/victory-accessible-group/victory-accessible-group.d.ts +25 -0
- package/lib/victory-accessible-group/victory-accessible-group.js +37 -45
- package/lib/victory-animation/util.d.ts +66 -0
- package/lib/victory-animation/util.js +4 -3
- package/lib/victory-animation/victory-animation.d.ts +69 -0
- package/lib/victory-animation/victory-animation.js +97 -102
- package/lib/victory-clip-container/victory-clip-container.d.ts +76 -0
- package/lib/victory-clip-container/victory-clip-container.js +81 -82
- package/lib/victory-container/victory-container.d.ts +99 -0
- package/lib/victory-container/victory-container.js +102 -107
- package/lib/victory-label/victory-label.d.ts +61 -0
- package/lib/victory-label/victory-label.js +49 -32
- package/lib/victory-portal/portal-context.d.ts +11 -0
- package/lib/victory-portal/portal-context.js +4 -5
- package/lib/victory-portal/portal.d.ts +28 -0
- package/lib/victory-portal/portal.js +49 -50
- package/lib/victory-portal/victory-portal.d.ts +31 -0
- package/lib/victory-portal/victory-portal.js +43 -47
- package/lib/victory-primitives/arc.d.ts +21 -0
- package/lib/victory-primitives/arc.js +13 -10
- package/lib/victory-primitives/background.d.ts +22 -0
- package/lib/victory-primitives/background.js +16 -13
- package/lib/victory-primitives/border.d.ts +18 -0
- package/lib/victory-primitives/border.js +13 -10
- package/lib/victory-primitives/circle.d.ts +2 -0
- package/lib/victory-primitives/circle.js +17 -8
- package/lib/victory-primitives/clip-path.d.ts +14 -0
- package/lib/victory-primitives/clip-path.js +7 -5
- package/lib/victory-primitives/index.d.ts +14 -0
- package/lib/victory-primitives/index.js +187 -0
- package/lib/victory-primitives/line-segment.d.ts +19 -0
- package/lib/victory-primitives/line-segment.js +13 -10
- package/lib/victory-primitives/line.d.ts +2 -0
- package/lib/victory-primitives/line.js +17 -8
- package/lib/victory-primitives/path.d.ts +2 -0
- package/lib/victory-primitives/path.js +15 -6
- package/lib/victory-primitives/point.d.ts +21 -0
- package/lib/victory-primitives/point.js +21 -25
- package/lib/victory-primitives/rect.d.ts +2 -0
- package/lib/victory-primitives/rect.js +17 -8
- package/lib/victory-primitives/text.d.ts +16 -0
- package/lib/victory-primitives/text.js +14 -7
- package/lib/victory-primitives/tspan.d.ts +2 -0
- package/lib/victory-primitives/tspan.js +7 -4
- package/lib/victory-primitives/types.d.ts +7 -0
- package/lib/victory-primitives/types.js +1 -0
- package/lib/victory-primitives/whisker.d.ts +24 -0
- package/lib/victory-primitives/whisker.js +16 -13
- package/lib/victory-theme/grayscale.d.ts +2 -0
- package/lib/victory-theme/grayscale.js +3 -3
- package/lib/victory-theme/material.d.ts +2 -0
- package/lib/victory-theme/material.js +3 -3
- package/lib/victory-theme/victory-theme-definition.d.ts +244 -0
- package/lib/victory-theme/victory-theme-definition.js +1 -0
- package/lib/victory-theme/victory-theme.d.ts +5 -0
- package/lib/victory-theme/victory-theme.js +22 -8
- package/lib/victory-transition/victory-transition.d.ts +59 -0
- package/lib/victory-transition/victory-transition.js +43 -45
- package/lib/victory-util/add-events.js +326 -316
- package/lib/victory-util/axis.js +20 -11
- package/lib/victory-util/collection.js +10 -8
- package/lib/victory-util/common-props.js +6 -4
- package/lib/victory-util/data.js +13 -7
- package/lib/victory-util/default-transitions.js +1 -2
- package/lib/victory-util/domain.js +11 -5
- package/lib/victory-util/events.js +17 -11
- package/lib/victory-util/helpers.js +14 -16
- package/lib/victory-util/hooks/index.js +4 -4
- package/lib/victory-util/hooks/use-animation-state.js +14 -6
- package/lib/victory-util/immutable.js +3 -5
- package/lib/victory-util/label-helpers.js +6 -6
- package/lib/victory-util/line-helpers.js +4 -2
- package/lib/victory-util/log.js +0 -1
- package/lib/victory-util/point-path-helpers.d.ts +9 -0
- package/lib/victory-util/point-path-helpers.js +86 -73
- package/lib/victory-util/prop-types.js +5 -3
- package/lib/victory-util/scale.js +24 -21
- package/lib/victory-util/selection.d.ts +23 -0
- package/lib/victory-util/selection.js +5 -5
- package/lib/victory-util/style.js +0 -2
- package/lib/victory-util/textsize.d.ts +8 -0
- package/lib/victory-util/textsize.js +12 -8
- package/lib/victory-util/timer-context.d.ts +11 -0
- package/lib/victory-util/timer-context.js +1 -1
- package/lib/victory-util/timer.d.ts +16 -0
- package/lib/victory-util/timer.js +16 -13
- package/lib/victory-util/types.d.ts +188 -0
- package/lib/victory-util/types.js +1 -0
- package/lib/victory-util/user-props.js +53 -6
- package/lib/victory-util/wrapper.js +31 -23
- package/package.json +6 -13
- package/src/index.ts +42 -0
- package/src/types.ts +45 -0
- package/src/victory-accessible-group/{victory-accessible-group.js → victory-accessible-group.tsx} +10 -3
- package/src/victory-animation/{util.js → util.ts} +5 -4
- package/src/victory-animation/{victory-animation.js → victory-animation.tsx} +90 -13
- package/src/victory-clip-container/{victory-clip-container.js → victory-clip-container.tsx} +32 -6
- package/src/victory-container/{victory-container.js → victory-container.tsx} +70 -26
- package/src/victory-label/{victory-label.js → victory-label.tsx} +80 -19
- package/src/victory-portal/portal-context.ts +14 -0
- package/src/victory-portal/{portal.js → portal.tsx} +23 -12
- package/src/victory-portal/{victory-portal.js → victory-portal.tsx} +21 -6
- package/src/victory-primitives/{arc.js → arc.tsx} +15 -5
- package/src/victory-primitives/{background.js → background.tsx} +17 -7
- package/src/victory-primitives/{border.js → border.tsx} +12 -5
- package/src/victory-primitives/{circle.js → circle.tsx} +4 -3
- package/src/victory-primitives/clip-path.tsx +25 -0
- package/src/victory-primitives/index.ts +14 -0
- package/src/victory-primitives/{line-segment.js → line-segment.tsx} +13 -5
- package/src/victory-primitives/{line.js → line.tsx} +4 -3
- package/src/victory-primitives/{path.js → path.tsx} +4 -3
- package/src/victory-primitives/{point.js → point.tsx} +25 -20
- package/src/victory-primitives/{rect.js → rect.tsx} +4 -2
- package/src/victory-primitives/{text.js → text.tsx} +9 -3
- package/src/victory-primitives/tspan.tsx +7 -0
- package/src/victory-primitives/types.ts +19 -0
- package/src/victory-primitives/{whisker.js → whisker.tsx} +20 -7
- package/src/victory-theme/{grayscale.js → grayscale.tsx} +2 -1
- package/src/victory-theme/{material.js → material.tsx} +2 -1
- package/src/victory-theme/victory-theme-definition.ts +261 -0
- package/src/victory-theme/victory-theme.tsx +5 -0
- package/src/victory-transition/{victory-transition.js → victory-transition.tsx} +68 -19
- package/src/victory-util/add-events.js +7 -5
- package/src/victory-util/axis.js +3 -1
- package/src/victory-util/collection.js +0 -1
- package/src/victory-util/common-props.js +2 -2
- package/src/victory-util/data.js +0 -1
- package/src/victory-util/default-transitions.js +0 -1
- package/src/victory-util/domain.js +0 -1
- package/src/victory-util/events.js +1 -1
- package/src/victory-util/helpers.js +0 -1
- package/src/victory-util/immutable.js +0 -1
- package/src/victory-util/label-helpers.js +0 -1
- package/src/victory-util/line-helpers.js +1 -1
- package/src/victory-util/log.js +0 -1
- package/src/victory-util/point-path-helpers.ts +119 -0
- package/src/victory-util/prop-types.js +0 -1
- package/src/victory-util/scale.js +18 -10
- package/src/victory-util/selection.d.ts +23 -0
- package/src/victory-util/selection.js +0 -1
- package/src/victory-util/style.js +0 -1
- package/src/victory-util/textsize.d.ts +8 -0
- package/src/victory-util/{timer-context.js → timer-context.ts} +0 -0
- package/src/victory-util/{timer.js → timer.ts} +20 -5
- package/src/victory-util/transitions.js +0 -1
- package/src/victory-util/types.ts +247 -0
- package/src/victory-util/user-props.js +31 -1
- package/src/victory-util/wrapper.js +0 -1
- package/src/index.d.ts +0 -941
- package/src/index.js +0 -51
- package/src/victory-portal/portal-context.js +0 -10
- package/src/victory-primitives/clip-path.js +0 -18
- package/src/victory-primitives/tspan.js +0 -5
- package/src/victory-theme/victory-theme.js +0 -7
- package/src/victory-util/point-path-helpers.js +0 -121
package/es/index.js
CHANGED
|
@@ -1,28 +1,19 @@
|
|
|
1
1
|
// This rule doesn't play well with namespaced exports
|
|
2
2
|
|
|
3
3
|
/* eslint-disable import/export */
|
|
4
|
-
export
|
|
5
|
-
export
|
|
6
|
-
export
|
|
7
|
-
export
|
|
8
|
-
export
|
|
9
|
-
export
|
|
10
|
-
export
|
|
11
|
-
export
|
|
12
|
-
export
|
|
13
|
-
export
|
|
14
|
-
export
|
|
15
|
-
export {
|
|
16
|
-
|
|
17
|
-
export { default as ClipPath } from "./victory-primitives/clip-path";
|
|
18
|
-
export { default as Line } from "./victory-primitives/line";
|
|
19
|
-
export { default as LineSegment } from "./victory-primitives/line-segment";
|
|
20
|
-
export { default as Path } from "./victory-primitives/path";
|
|
21
|
-
export { default as Point } from "./victory-primitives/point";
|
|
22
|
-
export { default as Rect } from "./victory-primitives/rect";
|
|
23
|
-
export { default as Text } from "./victory-primitives/text";
|
|
24
|
-
export { default as TSpan } from "./victory-primitives/tspan";
|
|
25
|
-
export { default as Whisker } from "./victory-primitives/whisker";
|
|
4
|
+
export * from "./victory-accessible-group/victory-accessible-group";
|
|
5
|
+
export * from "./victory-animation/victory-animation";
|
|
6
|
+
export * from "./victory-container/victory-container";
|
|
7
|
+
export * from "./victory-label/victory-label";
|
|
8
|
+
export * from "./victory-transition/victory-transition";
|
|
9
|
+
export * from "./victory-clip-container/victory-clip-container";
|
|
10
|
+
export * from "./victory-theme/victory-theme";
|
|
11
|
+
export * from "./victory-portal/portal";
|
|
12
|
+
export * from "./victory-portal/portal-context";
|
|
13
|
+
export * from "./victory-portal/victory-portal";
|
|
14
|
+
export * from "./victory-primitives";
|
|
15
|
+
export { Border as Box } from "./victory-primitives"; // victory-util:
|
|
16
|
+
|
|
26
17
|
export { default as addEvents } from "./victory-util/add-events";
|
|
27
18
|
import * as _Collection from "./victory-util/collection";
|
|
28
19
|
export { _Collection as Collection };
|
|
@@ -52,7 +43,6 @@ import * as _Style from "./victory-util/style";
|
|
|
52
43
|
export { _Style as Style };
|
|
53
44
|
import * as _TextSize from "./victory-util/textsize";
|
|
54
45
|
export { _TextSize as TextSize };
|
|
55
|
-
export { default as Timer } from "./victory-util/timer";
|
|
56
46
|
import * as _Transitions from "./victory-util/transitions";
|
|
57
47
|
export { _Transitions as Transitions };
|
|
58
48
|
import * as _UserProps from "./victory-util/user-props";
|
|
@@ -63,11 +53,12 @@ import * as _Wrapper from "./victory-util/wrapper";
|
|
|
63
53
|
export { _Wrapper as Wrapper };
|
|
64
54
|
import * as _Axis from "./victory-util/axis";
|
|
65
55
|
export { _Axis as Axis };
|
|
66
|
-
export { default as TimerContext } from "./victory-util/timer-context";
|
|
67
|
-
export { default as PortalContext } from "./victory-portal/portal-context";
|
|
68
56
|
import * as _Hooks from "./victory-util/hooks";
|
|
69
57
|
export { _Hooks as Hooks };
|
|
70
58
|
import * as _LineHelpers from "./victory-util/line-helpers";
|
|
71
|
-
export { _LineHelpers as LineHelpers };
|
|
72
|
-
|
|
73
|
-
|
|
59
|
+
export { _LineHelpers as LineHelpers };
|
|
60
|
+
export { default as Timer } from "./victory-util/timer";
|
|
61
|
+
import * as _PointPathHelpers from "./victory-util/point-path-helpers";
|
|
62
|
+
export { _PointPathHelpers as PointPathHelpers };
|
|
63
|
+
export { default as TimerContext } from "./victory-util/timer-context";
|
|
64
|
+
export * from "./victory-util/types";
|
package/es/types.d.ts
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This is the first parameter of a callback when a callback is used to
|
|
3
|
+
* resolve the value of a property instead of a concrete value.
|
|
4
|
+
*
|
|
5
|
+
* Note that additional properties here like `scale`, `x`, `y`, etc are resolved
|
|
6
|
+
* values of properties from the VictoryXXXProps for each component.
|
|
7
|
+
*/
|
|
8
|
+
import type { D3Scale } from "./victory-util/types";
|
|
9
|
+
export interface CallbackArgs {
|
|
10
|
+
active?: boolean;
|
|
11
|
+
data?: any;
|
|
12
|
+
datum?: any;
|
|
13
|
+
horizontal?: boolean;
|
|
14
|
+
index: number | string;
|
|
15
|
+
x?: number;
|
|
16
|
+
y?: number;
|
|
17
|
+
scale?: {
|
|
18
|
+
x?: D3Scale;
|
|
19
|
+
y?: D3Scale;
|
|
20
|
+
};
|
|
21
|
+
tick?: any;
|
|
22
|
+
ticks?: any;
|
|
23
|
+
text?: any;
|
|
24
|
+
}
|
|
25
|
+
export declare type VictoryStringOrNumberCallback = (args: CallbackArgs) => string | number;
|
|
26
|
+
export declare type VictoryStringCallback = (args: CallbackArgs) => string;
|
|
27
|
+
export declare type StringOrNumberOrCallback = string | number | VictoryStringOrNumberCallback;
|
|
28
|
+
export declare type StringOrCallback = string | VictoryStringCallback;
|
|
29
|
+
export declare type SliceNumberOrCallback<T, P extends string | number | symbol = never> = number | ((props: Omit<T, P>) => number);
|
|
30
|
+
export declare type CoordinatesPropType = {
|
|
31
|
+
x: number;
|
|
32
|
+
y: number;
|
|
33
|
+
};
|
package/es/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import PropTypes from "prop-types";
|
|
3
|
+
export interface VictoryAccessibleGroupProps {
|
|
4
|
+
desc?: string;
|
|
5
|
+
"aria-describedby"?: string;
|
|
6
|
+
"aria-label"?: string;
|
|
7
|
+
children?: React.ReactElement | React.ReactElement[];
|
|
8
|
+
className?: string;
|
|
9
|
+
tabIndex?: number;
|
|
10
|
+
}
|
|
11
|
+
export declare class VictoryAccessibleGroup extends React.Component<VictoryAccessibleGroupProps> {
|
|
12
|
+
static displayName: string;
|
|
13
|
+
static propTypes: {
|
|
14
|
+
"aria-describedby": PropTypes.Requireable<string>;
|
|
15
|
+
"aria-label": PropTypes.Requireable<string>;
|
|
16
|
+
children: PropTypes.Requireable<string | number | boolean | PropTypes.ReactElementLike | PropTypes.ReactNodeArray>;
|
|
17
|
+
className: PropTypes.Requireable<string>;
|
|
18
|
+
desc: PropTypes.Requireable<string>;
|
|
19
|
+
tabIndex: PropTypes.Requireable<number>;
|
|
20
|
+
};
|
|
21
|
+
static defaultProps: {
|
|
22
|
+
className: string;
|
|
23
|
+
};
|
|
24
|
+
render(): JSX.Element;
|
|
25
|
+
}
|
|
@@ -2,45 +2,52 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
|
|
|
2
2
|
|
|
3
3
|
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); } }
|
|
4
4
|
|
|
5
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
5
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
6
6
|
|
|
7
|
-
function
|
|
7
|
+
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); }
|
|
8
|
+
|
|
9
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
10
|
+
|
|
11
|
+
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); }; }
|
|
12
|
+
|
|
13
|
+
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); }
|
|
8
14
|
|
|
9
15
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
10
16
|
|
|
11
|
-
function
|
|
17
|
+
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; } }
|
|
18
|
+
|
|
19
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
12
20
|
|
|
13
21
|
import React from "react";
|
|
14
22
|
import PropTypes from "prop-types";
|
|
15
|
-
|
|
16
|
-
var VictoryAccessibleGroup =
|
|
17
|
-
/*#__PURE__*/
|
|
18
|
-
function (_React$Component) {
|
|
23
|
+
export var VictoryAccessibleGroup = /*#__PURE__*/function (_React$Component) {
|
|
19
24
|
_inherits(VictoryAccessibleGroup, _React$Component);
|
|
20
25
|
|
|
26
|
+
var _super = _createSuper(VictoryAccessibleGroup);
|
|
27
|
+
|
|
21
28
|
function VictoryAccessibleGroup() {
|
|
22
29
|
_classCallCheck(this, VictoryAccessibleGroup);
|
|
23
30
|
|
|
24
|
-
return
|
|
31
|
+
return _super.apply(this, arguments);
|
|
25
32
|
}
|
|
26
33
|
|
|
27
34
|
_createClass(VictoryAccessibleGroup, [{
|
|
28
35
|
key: "render",
|
|
29
36
|
value: function render() {
|
|
30
|
-
var
|
|
31
|
-
desc =
|
|
32
|
-
children =
|
|
33
|
-
className =
|
|
34
|
-
tabIndex =
|
|
37
|
+
var _this$props = this.props,
|
|
38
|
+
desc = _this$props.desc,
|
|
39
|
+
children = _this$props.children,
|
|
40
|
+
className = _this$props.className,
|
|
41
|
+
tabIndex = _this$props.tabIndex;
|
|
35
42
|
var descId = desc && (this.props["aria-describedby"] || desc.split(" ").join("-"));
|
|
36
|
-
return desc ? React.createElement("g", {
|
|
43
|
+
return desc ? /*#__PURE__*/React.createElement("g", {
|
|
37
44
|
"aria-label": this.props["aria-label"],
|
|
38
45
|
"aria-describedby": descId,
|
|
39
46
|
className: className,
|
|
40
47
|
tabIndex: tabIndex
|
|
41
|
-
}, React.createElement("desc", {
|
|
48
|
+
}, /*#__PURE__*/React.createElement("desc", {
|
|
42
49
|
id: descId
|
|
43
|
-
}, desc), children) : React.createElement("g", {
|
|
50
|
+
}, desc), children) : /*#__PURE__*/React.createElement("g", {
|
|
44
51
|
"aria-label": this.props["aria-label"],
|
|
45
52
|
"aria-describedby": this.props["aria-describedby"],
|
|
46
53
|
className: className,
|
|
@@ -51,32 +58,15 @@ function (_React$Component) {
|
|
|
51
58
|
|
|
52
59
|
return VictoryAccessibleGroup;
|
|
53
60
|
}(React.Component);
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
"aria-describedby": PropTypes.string,
|
|
67
|
-
"aria-label": PropTypes.string,
|
|
68
|
-
children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node]),
|
|
69
|
-
className: PropTypes.string,
|
|
70
|
-
desc: PropTypes.string,
|
|
71
|
-
tabIndex: PropTypes.number
|
|
72
|
-
}
|
|
73
|
-
});
|
|
74
|
-
Object.defineProperty(VictoryAccessibleGroup, "defaultProps", {
|
|
75
|
-
configurable: true,
|
|
76
|
-
enumerable: true,
|
|
77
|
-
writable: true,
|
|
78
|
-
value: {
|
|
79
|
-
className: "VictoryAccessibleGroup"
|
|
80
|
-
}
|
|
81
|
-
});
|
|
82
|
-
export default VictoryAccessibleGroup;
|
|
61
|
+
VictoryAccessibleGroup.displayName = "VictoryAccessibleGroup";
|
|
62
|
+
VictoryAccessibleGroup.propTypes = {
|
|
63
|
+
"aria-describedby": PropTypes.string,
|
|
64
|
+
"aria-label": PropTypes.string,
|
|
65
|
+
children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node]),
|
|
66
|
+
className: PropTypes.string,
|
|
67
|
+
desc: PropTypes.string,
|
|
68
|
+
tabIndex: PropTypes.number
|
|
69
|
+
};
|
|
70
|
+
VictoryAccessibleGroup.defaultProps = {
|
|
71
|
+
className: "VictoryAccessibleGroup"
|
|
72
|
+
};
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
export declare const isInterpolatable: (obj: any) => boolean;
|
|
2
|
+
/**
|
|
3
|
+
* Interpolate immediately to the end value at the given step `when`.
|
|
4
|
+
* Some nicer default behavior might be to jump at the halfway point or return
|
|
5
|
+
* `a` if `t` is 0 (instead of always returning `b`). But d3's default
|
|
6
|
+
* interpolator does not do these things:
|
|
7
|
+
*
|
|
8
|
+
* d3.interpolate('aaa', 'bbb')(0) === 'bbb'
|
|
9
|
+
*
|
|
10
|
+
* ...and things might get wonky if we don't replicate that behavior.
|
|
11
|
+
*
|
|
12
|
+
* @param {any} a - Start value.
|
|
13
|
+
* @param {any} b - End value.
|
|
14
|
+
* @param {Number} when - Step value (0 to 1) at which to jump to `b`.
|
|
15
|
+
* @returns {Function} An interpolation function.
|
|
16
|
+
*/
|
|
17
|
+
export declare const interpolateImmediate: (a: any, b: any, when?: number) => (t: any) => any;
|
|
18
|
+
/**
|
|
19
|
+
* Interpolate to or from a function. The interpolated value will be a function
|
|
20
|
+
* that calls `a` (if it's a function) and `b` (if it's a function) and calls
|
|
21
|
+
* `d3.interpolate` on the resulting values. Note that our function won't
|
|
22
|
+
* necessarily be called (that's up to the component this eventually gets
|
|
23
|
+
* passed to) - but if it does get called, it will return an appropriately
|
|
24
|
+
* interpolated value.
|
|
25
|
+
*
|
|
26
|
+
* @param {any} a - Start value.
|
|
27
|
+
* @param {any} b - End value.
|
|
28
|
+
* @returns {Function} An interpolation function.
|
|
29
|
+
*/
|
|
30
|
+
export declare const interpolateFunction: (a: any, b: any) => (t: any) => any;
|
|
31
|
+
/**
|
|
32
|
+
* Interpolate to or from an object. This method is a modification of the object interpolator in
|
|
33
|
+
* d3-interpolate https://github.com/d3/d3-interpolate/blob/master/src/object.js. This interpolator
|
|
34
|
+
* differs in that it uses our custom interpolators when interpolating the value of each property in
|
|
35
|
+
* an object. This allows the correct interpolation of nested objects, including styles
|
|
36
|
+
*
|
|
37
|
+
* @param {any} a - Start value.
|
|
38
|
+
* @param {any} b - End value.
|
|
39
|
+
* @returns {Function} An interpolation function.
|
|
40
|
+
*/
|
|
41
|
+
export declare const interpolateObject: (a: any, b: any) => (t: any) => {};
|
|
42
|
+
export declare const interpolateString: (a: any, b: any) => any;
|
|
43
|
+
/**
|
|
44
|
+
* By default, the list of interpolators used by `d3.interpolate` has a few
|
|
45
|
+
* downsides:
|
|
46
|
+
*
|
|
47
|
+
* - `null` values get turned into 0.
|
|
48
|
+
* - `undefined`, `function`, and some other value types get turned into NaN.
|
|
49
|
+
* - Boolean types get turned into numbers, which probably will be meaningless
|
|
50
|
+
* to whatever is consuming them.
|
|
51
|
+
* - It tries to interpolate between identical start and end values, doing
|
|
52
|
+
* unnecessary calculations that sometimes result in floating point rounding
|
|
53
|
+
* errors.
|
|
54
|
+
*
|
|
55
|
+
* If only the default interpolators are used, `VictoryAnimation` will happily
|
|
56
|
+
* pass down NaN (and other bad) values as props to the wrapped component.
|
|
57
|
+
* The component will then either use the incorrect values or complain that it
|
|
58
|
+
* was passed props of the incorrect type. This custom interpolator is added
|
|
59
|
+
* using the `d3.interpolators` API, and prevents such cases from happening
|
|
60
|
+
* for most values.
|
|
61
|
+
*
|
|
62
|
+
* @param {any} a - Start value.
|
|
63
|
+
* @param {any} b - End value.
|
|
64
|
+
* @returns {Function|undefined} An interpolation function, if necessary.
|
|
65
|
+
*/
|
|
66
|
+
export declare const victoryInterpolator: <T>(a: T, b: T) => (t: number) => T;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _orderBy from "lodash/orderBy";
|
|
2
2
|
import _isPlainObject from "lodash/isPlainObject";
|
|
3
|
-
import { interpolate } from "d3-interpolate";
|
|
3
|
+
import { interpolate } from "victory-vendor/d3-interpolate";
|
|
4
4
|
export var isInterpolatable = function (obj) {
|
|
5
5
|
// d3 turns null into 0 and undefined into NaN, which we don't want.
|
|
6
6
|
if (obj !== null) {
|
|
@@ -87,7 +87,7 @@ export var interpolateFunction = function (a, b) {
|
|
|
87
87
|
}
|
|
88
88
|
|
|
89
89
|
return function () {
|
|
90
|
-
/* eslint-disable no-invalid-this */
|
|
90
|
+
/* eslint-disable no-invalid-this, prefer-rest-params */
|
|
91
91
|
var aval = typeof a === "function" ? a.apply(this, arguments) : a;
|
|
92
92
|
var bval = typeof b === "function" ? b.apply(this, arguments) : b;
|
|
93
93
|
return interpolate(aval, bval)(t);
|
|
@@ -200,6 +200,7 @@ export var victoryInterpolator = function (a, b) {
|
|
|
200
200
|
}
|
|
201
201
|
|
|
202
202
|
if (_isPlainObject(a) || _isPlainObject(b)) {
|
|
203
|
+
// @ts-expect-error These generics are tough, but they work ok?
|
|
203
204
|
return interpolateObject(a, b);
|
|
204
205
|
}
|
|
205
206
|
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import PropTypes from "prop-types";
|
|
3
|
+
import TimerContext from "../victory-util/timer-context";
|
|
4
|
+
import type Timer from "../victory-util/timer";
|
|
5
|
+
/**
|
|
6
|
+
* Single animation object to interpolate
|
|
7
|
+
*/
|
|
8
|
+
export declare type AnimationStyle = {
|
|
9
|
+
[key: string]: string | number;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Animation styles to interpolate
|
|
13
|
+
*/
|
|
14
|
+
export declare type AnimationData = AnimationStyle | AnimationStyle[];
|
|
15
|
+
export declare type AnimationEasing = "back" | "backIn" | "backOut" | "backInOut" | "bounce" | "bounceIn" | "bounceOut" | "bounceInOut" | "circle" | "circleIn" | "circleOut" | "circleInOut" | "linear" | "linearIn" | "linearOut" | "linearInOut" | "cubic" | "cubicIn" | "cubicOut" | "cubicInOut" | "elastic" | "elasticIn" | "elasticOut" | "elasticInOut" | "exp" | "expIn" | "expOut" | "expInOut" | "poly" | "polyIn" | "polyOut" | "polyInOut" | "quad" | "quadIn" | "quadOut" | "quadInOut" | "sin" | "sinIn" | "sinOut" | "sinInOut";
|
|
16
|
+
export interface VictoryAnimationProps {
|
|
17
|
+
children: (style: AnimationStyle, info: AnimationInfo) => React.ReactNode;
|
|
18
|
+
duration?: number;
|
|
19
|
+
easing?: AnimationEasing;
|
|
20
|
+
delay?: number;
|
|
21
|
+
onEnd?: () => void;
|
|
22
|
+
data: AnimationData;
|
|
23
|
+
}
|
|
24
|
+
export interface VictoryAnimationState {
|
|
25
|
+
data: AnimationStyle;
|
|
26
|
+
animationInfo: AnimationInfo;
|
|
27
|
+
}
|
|
28
|
+
export interface AnimationInfo {
|
|
29
|
+
progress: number;
|
|
30
|
+
animating: boolean;
|
|
31
|
+
terminating?: boolean;
|
|
32
|
+
}
|
|
33
|
+
export interface VictoryAnimation {
|
|
34
|
+
context: React.ContextType<typeof TimerContext>;
|
|
35
|
+
}
|
|
36
|
+
export declare class VictoryAnimation extends React.Component<VictoryAnimationProps, VictoryAnimationState> {
|
|
37
|
+
static displayName: string;
|
|
38
|
+
static propTypes: {
|
|
39
|
+
children: PropTypes.Requireable<(...args: any[]) => any>;
|
|
40
|
+
data: PropTypes.Requireable<object>;
|
|
41
|
+
delay: PropTypes.Requireable<number>;
|
|
42
|
+
duration: PropTypes.Requireable<number>;
|
|
43
|
+
easing: PropTypes.Requireable<string>;
|
|
44
|
+
onEnd: PropTypes.Requireable<(...args: any[]) => any>;
|
|
45
|
+
};
|
|
46
|
+
static defaultProps: {
|
|
47
|
+
data: {};
|
|
48
|
+
delay: number;
|
|
49
|
+
duration: number;
|
|
50
|
+
easing: string;
|
|
51
|
+
};
|
|
52
|
+
static contextType: React.Context<{
|
|
53
|
+
transitionTimer: Timer;
|
|
54
|
+
animationTimer: Timer;
|
|
55
|
+
}>;
|
|
56
|
+
private interpolator;
|
|
57
|
+
private queue;
|
|
58
|
+
private ease;
|
|
59
|
+
private timer;
|
|
60
|
+
private loopID?;
|
|
61
|
+
constructor(props: any, context: any);
|
|
62
|
+
componentDidMount(): void;
|
|
63
|
+
componentDidUpdate(prevProps: any): void;
|
|
64
|
+
componentWillUnmount(): void;
|
|
65
|
+
toNewName(ease: any): string;
|
|
66
|
+
traverseQueue(): void;
|
|
67
|
+
functionToBeRunEachFrame: (elapsed: any, duration: any) => void;
|
|
68
|
+
render(): React.ReactNode;
|
|
69
|
+
}
|