victory-core 36.4.1 → 36.5.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/dist/victory-core.js +14463 -11478
- package/dist/victory-core.min.js +1 -1
- package/dist/victory-core.min.js.LICENSE.txt +19 -0
- package/es/index.d.ts +18 -941
- package/es/index.js +18 -73
- package/es/types/callbacks.d.ts +37 -0
- package/es/types/callbacks.js +2 -0
- package/es/types/prop-types.d.ts +130 -0
- package/es/types/prop-types.js +2 -0
- package/es/victory-accessible-group/victory-accessible-group.d.ts +26 -0
- package/es/victory-accessible-group/victory-accessible-group.js +9 -16
- package/es/victory-animation/util.d.ts +67 -0
- package/es/victory-animation/util.js +7 -4
- package/es/victory-animation/victory-animation.d.ts +70 -0
- package/es/victory-animation/victory-animation.js +60 -67
- package/es/victory-clip-container/victory-clip-container.d.ts +77 -0
- package/es/victory-clip-container/victory-clip-container.js +16 -21
- package/es/victory-container/victory-container.d.ts +100 -0
- package/es/victory-container/victory-container.js +32 -31
- package/es/victory-label/victory-label.d.ts +62 -0
- package/es/victory-label/victory-label.js +14 -9
- package/es/victory-portal/portal-context.d.ts +12 -0
- package/es/victory-portal/portal-context.js +3 -3
- package/es/victory-portal/portal.d.ts +29 -0
- package/es/victory-portal/portal.js +26 -33
- package/es/victory-portal/victory-portal.d.ts +32 -0
- package/es/victory-portal/victory-portal.js +24 -22
- package/es/victory-primitives/arc.d.ts +50 -0
- package/es/victory-primitives/arc.js +4 -5
- package/es/victory-primitives/background.d.ts +51 -0
- package/es/victory-primitives/background.js +5 -6
- package/es/victory-primitives/border.d.ts +44 -0
- package/es/victory-primitives/border.js +4 -5
- package/es/victory-primitives/circle.d.ts +3 -0
- package/es/victory-primitives/circle.js +11 -7
- package/es/victory-primitives/clip-path.d.ts +15 -0
- package/es/victory-primitives/clip-path.js +6 -5
- package/es/victory-primitives/index.d.ts +15 -0
- package/es/victory-primitives/index.js +15 -0
- package/es/victory-primitives/line-segment.d.ts +46 -0
- package/es/victory-primitives/line-segment.js +4 -5
- package/es/victory-primitives/line.d.ts +3 -0
- package/es/victory-primitives/line.js +11 -7
- package/es/victory-primitives/path.d.ts +3 -0
- package/es/victory-primitives/path.js +9 -5
- package/es/victory-primitives/point.d.ts +49 -0
- package/es/victory-primitives/point.js +10 -19
- package/es/victory-primitives/rect.d.ts +3 -0
- package/es/victory-primitives/rect.js +11 -7
- package/es/victory-primitives/text.d.ts +17 -0
- package/es/victory-primitives/text.js +7 -5
- package/es/victory-primitives/tspan.d.ts +3 -0
- package/es/victory-primitives/tspan.js +7 -5
- package/es/victory-primitives/types.d.ts +8 -0
- package/es/victory-primitives/types.js +2 -0
- package/es/victory-primitives/whisker.d.ts +59 -0
- package/es/victory-primitives/whisker.js +4 -5
- package/es/victory-state/defaults.d.ts +3 -0
- package/es/victory-state/defaults.js +3 -0
- package/es/victory-state/helpers/get-axis-data.d.ts +3 -0
- package/es/victory-state/helpers/get-axis-data.js +15 -0
- package/es/victory-state/helpers/get-data.d.ts +15 -0
- package/es/victory-state/helpers/get-data.js +88 -0
- package/es/victory-state/helpers/get-domain.d.ts +6 -0
- package/es/victory-state/helpers/get-domain.js +68 -0
- package/es/victory-state/helpers/get-range.d.ts +6 -0
- package/es/victory-state/helpers/get-range.js +37 -0
- package/es/victory-state/helpers/get-scale.d.ts +6 -0
- package/es/victory-state/helpers/get-scale.js +59 -0
- package/es/victory-state/index.d.ts +3 -0
- package/es/victory-state/index.js +3 -0
- package/es/victory-state/types.d.ts +24 -0
- package/es/victory-state/types.js +2 -0
- package/es/victory-state/victory-provider.d.ts +19 -0
- package/es/victory-state/victory-provider.js +118 -0
- package/es/victory-theme/grayscale.d.ts +3 -0
- package/es/victory-theme/grayscale.js +3 -2
- package/es/victory-theme/material.d.ts +3 -0
- package/es/victory-theme/material.js +3 -2
- package/es/victory-theme/types.d.ts +239 -0
- package/es/victory-theme/types.js +2 -0
- package/es/victory-theme/victory-theme.d.ts +6 -0
- package/es/victory-theme/victory-theme.js +8 -6
- package/es/victory-transition/victory-transition.d.ts +60 -0
- package/es/victory-transition/victory-transition.js +20 -23
- package/es/victory-util/add-events.d.ts +106 -0
- package/es/victory-util/add-events.js +44 -34
- package/es/victory-util/axis.d.ts +51 -0
- package/es/victory-util/axis.js +9 -8
- package/es/victory-util/collection.d.ts +9 -0
- package/es/victory-util/collection.js +6 -6
- package/es/victory-util/common-props.d.ts +84 -0
- package/es/victory-util/common-props.js +29 -12
- package/es/victory-util/data.d.ts +75 -0
- package/es/victory-util/data.js +2 -3
- package/es/victory-util/default-transitions.d.ts +5 -0
- package/es/victory-util/default-transitions.js +2 -2
- package/es/victory-util/domain.d.ts +91 -0
- package/es/victory-util/domain.js +6 -4
- package/es/victory-util/events.d.ts +65 -0
- package/es/victory-util/events.js +13 -8
- package/es/victory-util/helpers.d.ts +61 -0
- package/es/victory-util/helpers.js +8 -6
- package/es/victory-util/hooks/index.d.ts +3 -0
- package/es/victory-util/hooks/index.js +2 -1
- package/es/victory-util/hooks/use-animation-state.js +2 -1
- package/es/victory-util/hooks/use-previous-props.d.ts +2 -0
- package/es/victory-util/hooks/use-previous-props.js +4 -3
- package/es/victory-util/immutable.d.ts +12 -0
- package/es/victory-util/immutable.js +5 -5
- package/es/victory-util/index.d.ts +29 -0
- package/es/victory-util/index.js +48 -0
- package/es/victory-util/label-helpers.d.ts +27 -0
- package/es/victory-util/label-helpers.js +2 -3
- package/es/victory-util/line-helpers.d.ts +5 -0
- package/es/victory-util/line-helpers.js +24 -6
- package/es/victory-util/log.d.ts +2 -0
- package/es/victory-util/log.js +2 -2
- package/es/victory-util/point-path-helpers.d.ts +10 -0
- package/es/victory-util/point-path-helpers.js +60 -61
- package/es/victory-util/prop-types.d.ts +51 -0
- package/es/victory-util/prop-types.js +35 -44
- package/es/victory-util/scale.d.ts +10 -0
- package/es/victory-util/scale.js +14 -6
- package/es/victory-util/selection.d.ts +25 -0
- package/es/victory-util/selection.js +25 -16
- package/es/victory-util/style.d.ts +19 -0
- package/es/victory-util/style.js +2 -3
- package/es/victory-util/textsize.d.ts +37 -0
- package/es/victory-util/textsize.js +9 -6
- package/es/victory-util/timer-context.d.ts +12 -0
- package/es/victory-util/timer-context.js +2 -1
- package/es/victory-util/timer.d.ts +17 -0
- package/es/victory-util/timer.js +15 -9
- package/es/victory-util/transitions.d.ts +49 -0
- package/es/victory-util/transitions.js +5 -4
- package/es/victory-util/type-helpers.d.ts +10 -0
- package/es/victory-util/type-helpers.js +28 -0
- package/es/victory-util/user-props.d.ts +21 -0
- package/es/victory-util/user-props.js +6 -5
- package/es/victory-util/with-container.d.ts +5 -0
- package/es/victory-util/with-container.js +32 -0
- package/es/victory-util/wrapper.d.ts +38 -0
- package/es/victory-util/wrapper.js +4 -3
- package/lib/index.d.ts +18 -941
- package/lib/index.js +224 -311
- package/lib/types/callbacks.d.ts +37 -0
- package/lib/types/callbacks.js +2 -0
- package/lib/types/prop-types.d.ts +130 -0
- package/lib/types/prop-types.js +2 -0
- package/lib/victory-accessible-group/victory-accessible-group.d.ts +26 -0
- package/lib/victory-accessible-group/victory-accessible-group.js +10 -15
- package/lib/victory-animation/util.d.ts +67 -0
- package/lib/victory-animation/util.js +7 -4
- package/lib/victory-animation/victory-animation.d.ts +70 -0
- package/lib/victory-animation/victory-animation.js +61 -65
- package/lib/victory-clip-container/victory-clip-container.d.ts +77 -0
- package/lib/victory-clip-container/victory-clip-container.js +20 -22
- package/lib/victory-container/victory-container.d.ts +100 -0
- package/lib/victory-container/victory-container.js +35 -31
- package/lib/victory-label/victory-label.d.ts +62 -0
- package/lib/victory-label/victory-label.js +20 -14
- package/lib/victory-portal/portal-context.d.ts +12 -0
- package/lib/victory-portal/portal-context.js +3 -3
- package/lib/victory-portal/portal.d.ts +29 -0
- package/lib/victory-portal/portal.js +27 -31
- package/lib/victory-portal/victory-portal.d.ts +32 -0
- package/lib/victory-portal/victory-portal.js +25 -20
- package/lib/victory-primitives/arc.d.ts +50 -0
- package/lib/victory-primitives/arc.js +7 -7
- package/lib/victory-primitives/background.d.ts +51 -0
- package/lib/victory-primitives/background.js +9 -9
- package/lib/victory-primitives/border.d.ts +44 -0
- package/lib/victory-primitives/border.js +7 -7
- package/lib/victory-primitives/circle.d.ts +3 -0
- package/lib/victory-primitives/circle.js +12 -6
- package/lib/victory-primitives/clip-path.d.ts +15 -0
- package/lib/victory-primitives/clip-path.js +7 -4
- package/lib/victory-primitives/index.d.ts +15 -0
- package/lib/victory-primitives/index.js +188 -0
- package/lib/victory-primitives/line-segment.d.ts +46 -0
- package/lib/victory-primitives/line-segment.js +7 -7
- package/lib/victory-primitives/line.d.ts +3 -0
- package/lib/victory-primitives/line.js +12 -6
- package/lib/victory-primitives/path.d.ts +3 -0
- package/lib/victory-primitives/path.js +10 -4
- package/lib/victory-primitives/point.d.ts +49 -0
- package/lib/victory-primitives/point.js +15 -22
- package/lib/victory-primitives/rect.d.ts +3 -0
- package/lib/victory-primitives/rect.js +12 -6
- package/lib/victory-primitives/text.d.ts +17 -0
- package/lib/victory-primitives/text.js +8 -4
- package/lib/victory-primitives/tspan.d.ts +3 -0
- package/lib/victory-primitives/tspan.js +8 -4
- package/lib/victory-primitives/types.d.ts +8 -0
- package/lib/victory-primitives/types.js +2 -0
- package/lib/victory-primitives/whisker.d.ts +59 -0
- package/lib/victory-primitives/whisker.js +7 -7
- package/lib/victory-state/defaults.d.ts +3 -0
- package/lib/victory-state/defaults.js +11 -0
- package/lib/victory-state/helpers/get-axis-data.d.ts +3 -0
- package/lib/victory-state/helpers/get-axis-data.js +23 -0
- package/lib/victory-state/helpers/get-data.d.ts +15 -0
- package/lib/victory-state/helpers/get-data.js +99 -0
- package/lib/victory-state/helpers/get-domain.d.ts +6 -0
- package/lib/victory-state/helpers/get-domain.js +82 -0
- package/lib/victory-state/helpers/get-range.d.ts +6 -0
- package/lib/victory-state/helpers/get-range.js +46 -0
- package/lib/victory-state/helpers/get-scale.d.ts +6 -0
- package/lib/victory-state/helpers/get-scale.js +74 -0
- package/lib/victory-state/index.d.ts +3 -0
- package/lib/victory-state/index.js +32 -0
- package/lib/victory-state/types.d.ts +24 -0
- package/lib/victory-state/types.js +2 -0
- package/lib/victory-state/victory-provider.d.ts +19 -0
- package/lib/victory-state/victory-provider.js +144 -0
- package/lib/victory-theme/grayscale.d.ts +3 -0
- package/lib/victory-theme/grayscale.js +4 -3
- package/lib/victory-theme/material.d.ts +3 -0
- package/lib/victory-theme/material.js +4 -3
- package/lib/victory-theme/types.d.ts +239 -0
- package/lib/victory-theme/types.js +2 -0
- package/lib/victory-theme/victory-theme.d.ts +6 -0
- package/lib/victory-theme/victory-theme.js +23 -8
- package/lib/victory-transition/victory-transition.d.ts +60 -0
- package/lib/victory-transition/victory-transition.js +22 -23
- package/lib/victory-util/add-events.d.ts +106 -0
- package/lib/victory-util/add-events.js +48 -40
- package/lib/victory-util/axis.d.ts +51 -0
- package/lib/victory-util/axis.js +8 -6
- package/lib/victory-util/collection.d.ts +9 -0
- package/lib/victory-util/collection.js +6 -6
- package/lib/victory-util/common-props.d.ts +84 -0
- package/lib/victory-util/common-props.js +27 -12
- package/lib/victory-util/data.d.ts +75 -0
- package/lib/victory-util/data.js +2 -1
- package/lib/victory-util/default-transitions.d.ts +5 -0
- package/lib/victory-util/default-transitions.js +2 -2
- package/lib/victory-util/domain.d.ts +91 -0
- package/lib/victory-util/domain.js +6 -2
- package/lib/victory-util/events.d.ts +65 -0
- package/lib/victory-util/events.js +13 -9
- package/lib/victory-util/helpers.d.ts +61 -0
- package/lib/victory-util/helpers.js +8 -6
- package/lib/victory-util/hooks/index.d.ts +3 -0
- package/lib/victory-util/hooks/index.js +2 -1
- package/lib/victory-util/hooks/use-animation-state.js +2 -1
- package/lib/victory-util/hooks/use-previous-props.d.ts +2 -0
- package/lib/victory-util/hooks/use-previous-props.js +5 -6
- package/lib/victory-util/immutable.d.ts +12 -0
- package/lib/victory-util/immutable.js +5 -6
- package/lib/victory-util/index.d.ts +29 -0
- package/lib/victory-util/index.js +181 -0
- package/lib/victory-util/label-helpers.d.ts +27 -0
- package/lib/victory-util/label-helpers.js +2 -3
- package/lib/victory-util/line-helpers.d.ts +5 -0
- package/lib/victory-util/line-helpers.js +28 -7
- package/lib/victory-util/log.d.ts +2 -0
- package/lib/victory-util/log.js +2 -2
- package/lib/victory-util/point-path-helpers.d.ts +10 -0
- package/lib/victory-util/point-path-helpers.js +87 -73
- package/lib/victory-util/prop-types.d.ts +51 -0
- package/lib/victory-util/prop-types.js +36 -44
- package/lib/victory-util/scale.d.ts +10 -0
- package/lib/victory-util/scale.js +14 -5
- package/lib/victory-util/selection.d.ts +25 -0
- package/lib/victory-util/selection.js +25 -21
- package/lib/victory-util/style.d.ts +19 -0
- package/lib/victory-util/style.js +2 -3
- package/lib/victory-util/textsize.d.ts +37 -0
- package/lib/victory-util/textsize.js +9 -6
- package/lib/victory-util/timer-context.d.ts +12 -0
- package/lib/victory-util/timer-context.js +2 -1
- package/lib/victory-util/timer.d.ts +17 -0
- package/lib/victory-util/timer.js +15 -9
- package/lib/victory-util/transitions.d.ts +49 -0
- package/lib/victory-util/transitions.js +5 -4
- package/lib/victory-util/type-helpers.d.ts +10 -0
- package/lib/victory-util/type-helpers.js +45 -0
- package/lib/victory-util/user-props.d.ts +21 -0
- package/lib/victory-util/user-props.js +6 -5
- package/lib/victory-util/with-container.d.ts +5 -0
- package/lib/victory-util/with-container.js +44 -0
- package/lib/victory-util/wrapper.d.ts +38 -0
- package/lib/victory-util/wrapper.js +4 -3
- package/package.json +4 -4
- package/src/index.ts +17 -0
- package/src/types/callbacks.ts +53 -0
- package/src/types/prop-types.ts +195 -0
- package/src/victory-accessible-group/{victory-accessible-group.js → victory-accessible-group.tsx} +13 -6
- package/src/victory-animation/{util.js → util.ts} +6 -4
- package/src/victory-animation/{victory-animation.js → victory-animation.tsx} +100 -23
- package/src/victory-clip-container/{victory-clip-container.js → victory-clip-container.tsx} +52 -28
- package/src/victory-container/{victory-container.js → victory-container.tsx} +86 -42
- package/src/victory-label/{victory-label.js → victory-label.tsx} +108 -49
- package/src/victory-portal/portal-context.ts +14 -0
- package/src/victory-portal/{portal.js → portal.tsx} +24 -13
- package/src/victory-portal/{victory-portal.js → victory-portal.tsx} +24 -9
- package/src/victory-primitives/{arc.js → arc.tsx} +22 -10
- package/src/victory-primitives/{background.js → background.tsx} +24 -12
- package/src/victory-primitives/{border.js → border.tsx} +19 -10
- 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} +20 -10
- 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} +33 -26
- package/src/victory-primitives/{rect.js → rect.tsx} +4 -2
- package/src/victory-primitives/{text.js → text.tsx} +10 -4
- package/src/victory-primitives/tspan.tsx +7 -0
- package/src/victory-primitives/types.ts +19 -0
- package/src/victory-primitives/{whisker.js → whisker.tsx} +34 -19
- package/src/victory-state/defaults.ts +2 -0
- package/src/victory-state/helpers/get-axis-data.ts +14 -0
- package/src/victory-state/helpers/get-data.ts +79 -0
- package/src/victory-state/helpers/get-domain.ts +62 -0
- package/src/victory-state/helpers/get-range.ts +39 -0
- package/src/victory-state/helpers/get-scale.ts +64 -0
- package/src/victory-state/index.ts +2 -0
- package/src/victory-state/types.ts +32 -0
- package/src/victory-state/victory-provider.tsx +116 -0
- package/src/victory-theme/{grayscale.js → grayscale.tsx} +63 -62
- package/src/victory-theme/{material.js → material.tsx} +68 -67
- package/src/victory-theme/types.ts +257 -0
- package/src/victory-theme/victory-theme.tsx +5 -0
- package/src/victory-transition/{victory-transition.js → victory-transition.tsx} +82 -33
- package/src/victory-util/{add-events.js → add-events.tsx} +142 -60
- package/src/victory-util/{axis.js → axis.tsx} +17 -19
- package/src/victory-util/{collection.js → collection.tsx} +14 -11
- package/src/victory-util/common-props.tsx +307 -0
- package/src/victory-util/{data.js → data.ts} +14 -11
- package/src/victory-util/{default-transitions.js → default-transitions.ts} +20 -19
- package/src/victory-util/{domain.js → domain.ts} +26 -24
- package/src/victory-util/{events.js → events.ts} +83 -32
- package/src/victory-util/{helpers.js → helpers.ts} +41 -23
- package/src/victory-util/hooks/{index.js → index.ts} +0 -0
- package/src/victory-util/hooks/use-animation-state.js +10 -10
- package/src/victory-util/hooks/use-previous-props.ts +9 -0
- package/src/victory-util/{immutable.js → immutable.ts} +14 -11
- package/src/victory-util/index.ts +28 -0
- package/src/victory-util/{label-helpers.js → label-helpers.ts} +7 -8
- package/src/victory-util/line-helpers.ts +104 -0
- package/src/victory-util/{log.js → log.ts} +1 -2
- package/src/victory-util/point-path-helpers.ts +119 -0
- package/src/victory-util/{prop-types.js → prop-types.ts} +103 -102
- package/src/victory-util/{scale.js → scale.ts} +29 -17
- package/src/victory-util/selection.ts +158 -0
- package/src/victory-util/{style.js → style.ts} +3 -4
- package/src/victory-util/{textsize.js → textsize.ts} +32 -17
- package/src/victory-util/{timer-context.js → timer-context.ts} +1 -1
- package/src/victory-util/{timer.js → timer.ts} +16 -6
- package/src/victory-util/{transitions.js → transitions.ts} +50 -23
- package/src/victory-util/type-helpers.ts +50 -0
- package/src/victory-util/{user-props.js → user-props.ts} +16 -11
- package/src/victory-util/with-container.tsx +41 -0
- package/src/victory-util/{wrapper.js → wrapper.tsx} +38 -34
- 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/common-props.js +0 -197
- package/src/victory-util/hooks/use-previous-props.js +0 -9
- package/src/victory-util/line-helpers.js +0 -54
- package/src/victory-util/point-path-helpers.js +0 -121
- package/src/victory-util/selection.js +0 -99
package/es/index.js
CHANGED
|
@@ -1,73 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
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
|
-
export
|
|
17
|
-
export
|
|
18
|
-
|
|
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";
|
|
26
|
-
export { default as addEvents } from "./victory-util/add-events";
|
|
27
|
-
import * as _Collection from "./victory-util/collection";
|
|
28
|
-
export { _Collection as Collection };
|
|
29
|
-
import * as _Data from "./victory-util/data";
|
|
30
|
-
export { _Data as Data };
|
|
31
|
-
import * as _DefaultTransitions from "./victory-util/default-transitions";
|
|
32
|
-
export { _DefaultTransitions as DefaultTransitions };
|
|
33
|
-
import * as _Domain from "./victory-util/domain";
|
|
34
|
-
export { _Domain as Domain };
|
|
35
|
-
import * as _Events from "./victory-util/events";
|
|
36
|
-
export { _Events as Events };
|
|
37
|
-
import * as _Helpers from "./victory-util/helpers";
|
|
38
|
-
export { _Helpers as Helpers };
|
|
39
|
-
import * as _Immutable from "./victory-util/immutable";
|
|
40
|
-
export { _Immutable as Immutable };
|
|
41
|
-
import * as _LabelHelpers from "./victory-util/label-helpers";
|
|
42
|
-
export { _LabelHelpers as LabelHelpers };
|
|
43
|
-
import * as _Log from "./victory-util/log";
|
|
44
|
-
export { _Log as Log };
|
|
45
|
-
import * as _PropTypes from "./victory-util/prop-types";
|
|
46
|
-
export { _PropTypes as PropTypes };
|
|
47
|
-
import * as _Scale from "./victory-util/scale";
|
|
48
|
-
export { _Scale as Scale };
|
|
49
|
-
import * as _Selection from "./victory-util/selection";
|
|
50
|
-
export { _Selection as Selection };
|
|
51
|
-
import * as _Style from "./victory-util/style";
|
|
52
|
-
export { _Style as Style };
|
|
53
|
-
import * as _TextSize from "./victory-util/textsize";
|
|
54
|
-
export { _TextSize as TextSize };
|
|
55
|
-
export { default as Timer } from "./victory-util/timer";
|
|
56
|
-
import * as _Transitions from "./victory-util/transitions";
|
|
57
|
-
export { _Transitions as Transitions };
|
|
58
|
-
import * as _UserProps from "./victory-util/user-props";
|
|
59
|
-
export { _UserProps as UserProps };
|
|
60
|
-
import * as _CommonProps from "./victory-util/common-props";
|
|
61
|
-
export { _CommonProps as CommonProps };
|
|
62
|
-
import * as _Wrapper from "./victory-util/wrapper";
|
|
63
|
-
export { _Wrapper as Wrapper };
|
|
64
|
-
import * as _Axis from "./victory-util/axis";
|
|
65
|
-
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
|
-
import * as _Hooks from "./victory-util/hooks";
|
|
69
|
-
export { _Hooks as Hooks };
|
|
70
|
-
import * as _LineHelpers from "./victory-util/line-helpers";
|
|
71
|
-
export { _LineHelpers as LineHelpers }; // TODO: Fix this default export
|
|
72
|
-
|
|
73
|
-
export { default as PointPathHelpers } from "./victory-util/point-path-helpers";
|
|
1
|
+
export * from "./types/callbacks";
|
|
2
|
+
export * from "./types/prop-types";
|
|
3
|
+
export * from "./victory-accessible-group/victory-accessible-group";
|
|
4
|
+
export * from "./victory-animation/victory-animation";
|
|
5
|
+
export * from "./victory-container/victory-container";
|
|
6
|
+
export * from "./victory-label/victory-label";
|
|
7
|
+
export * from "./victory-transition/victory-transition";
|
|
8
|
+
export * from "./victory-clip-container/victory-clip-container";
|
|
9
|
+
export * from "./victory-theme/types";
|
|
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";
|
|
16
|
+
export * from "./victory-util";
|
|
17
|
+
export * from "./victory-state";
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { D3Scale, Datum, ID } from "./prop-types";
|
|
2
|
+
import { BlockProps, OrientationTypes } from "../victory-theme/types";
|
|
3
|
+
/**
|
|
4
|
+
* This is the first parameter of a callback when a callback is used to
|
|
5
|
+
* resolve the value of a property instead of a concrete value.
|
|
6
|
+
*
|
|
7
|
+
* Note that additional properties here like `scale`, `x`, `y`, etc are resolved
|
|
8
|
+
* values of properties from the VictoryXXXProps for each component.
|
|
9
|
+
*/
|
|
10
|
+
export interface CallbackArgs {
|
|
11
|
+
active?: boolean;
|
|
12
|
+
data?: Datum[];
|
|
13
|
+
datum?: Datum;
|
|
14
|
+
horizontal?: boolean;
|
|
15
|
+
index: ID;
|
|
16
|
+
x?: number;
|
|
17
|
+
y?: number;
|
|
18
|
+
scale?: {
|
|
19
|
+
x?: D3Scale;
|
|
20
|
+
y?: D3Scale;
|
|
21
|
+
};
|
|
22
|
+
tick?: any;
|
|
23
|
+
ticks?: any;
|
|
24
|
+
text?: any;
|
|
25
|
+
}
|
|
26
|
+
export declare type VictoryStringOrNumberCallback = (args: CallbackArgs) => string | number;
|
|
27
|
+
export declare type VictoryStringCallback = (args: CallbackArgs) => string;
|
|
28
|
+
export declare type StringOrNumberOrCallback = string | number | VictoryStringOrNumberCallback;
|
|
29
|
+
export declare type StringOrCallback = string | VictoryStringCallback;
|
|
30
|
+
export declare type SliceNumberOrCallback<T, P extends string | number | symbol = never> = number | ((props: Omit<T, P>) => number);
|
|
31
|
+
export declare type VictoryNumberCallback = (args: CallbackArgs) => number;
|
|
32
|
+
export declare type VictoryPaddingCallback = (args: CallbackArgs) => number | BlockProps;
|
|
33
|
+
export declare type VictoryOrientationCallback = (args: CallbackArgs) => OrientationTypes;
|
|
34
|
+
export declare type NumberOrCallback = number | VictoryNumberCallback;
|
|
35
|
+
export declare type PaddingOrCallback = number | BlockProps | VictoryPaddingCallback;
|
|
36
|
+
export declare type OrientationOrCallback = OrientationTypes | VictoryOrientationCallback;
|
|
37
|
+
//# sourceMappingURL=callbacks.d.ts.map
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { ScaleLinear, ScaleLogarithmic, ScalePower, ScaleTime } from "victory-vendor/d3-scale";
|
|
3
|
+
import { AnimationEasing, AnimationStyle } from "../victory-animation/victory-animation";
|
|
4
|
+
import { StringOrNumberOrCallback } from "./callbacks";
|
|
5
|
+
export declare type AxisType = "x" | "y";
|
|
6
|
+
export declare type DatumValue = number | string | Date | null | undefined;
|
|
7
|
+
export declare type Datum = any;
|
|
8
|
+
export declare type ForAxes<T> = T | {
|
|
9
|
+
x?: T;
|
|
10
|
+
y?: T;
|
|
11
|
+
};
|
|
12
|
+
export declare type ID = number | string;
|
|
13
|
+
export declare type ValueOrAccessor<ValueType = unknown, PropsType = object> = ValueType | ((props: PropsType) => ValueType);
|
|
14
|
+
export declare type Tuple<T> = [T, T];
|
|
15
|
+
export declare type ValueOrAxes<T> = T | ForAxes<T>;
|
|
16
|
+
export declare type DomainPaddingPropType = ValueOrAxes<PaddingType>;
|
|
17
|
+
export declare type DomainPropType = ValueOrAxes<DomainTuple>;
|
|
18
|
+
export declare type DomainValue = number | Date;
|
|
19
|
+
export declare type DomainTuple = Tuple<number> | Tuple<Date>;
|
|
20
|
+
export declare type PaddingType = number | Tuple<number>;
|
|
21
|
+
export declare type RangePropType = ValueOrAxes<RangeTuple>;
|
|
22
|
+
export declare type RangeTuple = number[];
|
|
23
|
+
export declare type StringOrNumberOrList = string | number | (string | number)[];
|
|
24
|
+
export interface Padding {
|
|
25
|
+
top: number;
|
|
26
|
+
bottom: number;
|
|
27
|
+
left: number;
|
|
28
|
+
right: number;
|
|
29
|
+
}
|
|
30
|
+
export interface AnimatePropTypeInterface {
|
|
31
|
+
duration?: number;
|
|
32
|
+
onEnd?: () => void;
|
|
33
|
+
onExit?: {
|
|
34
|
+
duration?: number;
|
|
35
|
+
before?: (datum: Datum, index: number, data: Datum[]) => AnimationStyle;
|
|
36
|
+
};
|
|
37
|
+
onEnter?: {
|
|
38
|
+
duration?: number;
|
|
39
|
+
before?: (datum: Datum, index: number, data: Datum[]) => AnimationStyle;
|
|
40
|
+
after?: (datum: Datum, index: number, data: Datum[]) => AnimationStyle;
|
|
41
|
+
};
|
|
42
|
+
onLoad?: {
|
|
43
|
+
duration?: number;
|
|
44
|
+
before?: (datum: Datum, index: number, data: Datum[]) => AnimationStyle;
|
|
45
|
+
after?: (datum: Datum, index: number, data: Datum[]) => AnimationStyle;
|
|
46
|
+
};
|
|
47
|
+
easing?: AnimationEasing;
|
|
48
|
+
animationWhitelist?: string[];
|
|
49
|
+
}
|
|
50
|
+
export interface EventCallbackInterface<TTarget, TEventKey> {
|
|
51
|
+
childName?: string | string[];
|
|
52
|
+
target?: TTarget;
|
|
53
|
+
eventKey?: TEventKey;
|
|
54
|
+
mutation: (props: any) => any;
|
|
55
|
+
callback?: (props: any) => any;
|
|
56
|
+
}
|
|
57
|
+
export interface EventPropTypeInterface<TTarget, TEventKey> {
|
|
58
|
+
childName?: string | Array<StringOrNumberOrCallback>;
|
|
59
|
+
target: TTarget;
|
|
60
|
+
eventKey?: TEventKey;
|
|
61
|
+
eventHandlers: {
|
|
62
|
+
[key: string]: {
|
|
63
|
+
(event: React.SyntheticEvent<any>, props?: any): EventCallbackInterface<TTarget, TEventKey>;
|
|
64
|
+
} | {
|
|
65
|
+
(event: React.SyntheticEvent<any>, props?: any): EventCallbackInterface<TTarget, TEventKey>[];
|
|
66
|
+
} | {
|
|
67
|
+
(event: React.SyntheticEvent<any>, props?: any): void;
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
declare type NumberValue = number | {
|
|
72
|
+
valueOf(): number;
|
|
73
|
+
};
|
|
74
|
+
/**
|
|
75
|
+
* D3 scale function shape. Don't want to introduce typing dependency to d3
|
|
76
|
+
*/
|
|
77
|
+
export interface D3Scale<TRange = any> {
|
|
78
|
+
(numberValue: NumberValue): number;
|
|
79
|
+
base?: () => number;
|
|
80
|
+
ticks: (count?: number) => number[];
|
|
81
|
+
tickFormat: (count?: number) => (d: number) => string;
|
|
82
|
+
domain: {
|
|
83
|
+
(): number[];
|
|
84
|
+
(domain: NumberValue[]): D3Scale<TRange>;
|
|
85
|
+
};
|
|
86
|
+
range: {
|
|
87
|
+
(): TRange[];
|
|
88
|
+
(range: TRange): D3Scale<TRange>;
|
|
89
|
+
};
|
|
90
|
+
copy: () => this;
|
|
91
|
+
invert: (value: number) => number;
|
|
92
|
+
}
|
|
93
|
+
export declare type D3ScaleFn<TRange = any, TOutput = any> = () => ScaleLinear<TRange, TOutput, unknown> | ScaleLogarithmic<TRange, TOutput, unknown> | ScaleTime<TRange, TOutput, unknown> | ScalePower<TRange, TOutput, unknown>;
|
|
94
|
+
export declare type ScaleName = "linear" | "time" | "log" | "sqrt";
|
|
95
|
+
export declare type ScalePropType = ScaleName;
|
|
96
|
+
export declare type ScaleXYPropType = {
|
|
97
|
+
x: D3Scale;
|
|
98
|
+
y: D3Scale;
|
|
99
|
+
};
|
|
100
|
+
export declare type CategoryPropType = string[] | {
|
|
101
|
+
x: string[];
|
|
102
|
+
} | {
|
|
103
|
+
y: string[];
|
|
104
|
+
} | {
|
|
105
|
+
x: string[];
|
|
106
|
+
y: string[];
|
|
107
|
+
};
|
|
108
|
+
export declare type DataGetterPropType = ValueOrAccessor<string | string[] | number | number[]>;
|
|
109
|
+
export declare type InterpolationPropType = "basis" | "basisClosed" | "basisOpen" | "bundle" | "cardinal" | "cardinalClosed" | "cardinalOpen" | "catmullRom" | "catmullRomClosed" | "catmullRomOpen" | "linear" | "linearClosed" | "monotoneX" | "monotoneY" | "natural" | "radial" | "step" | "stepAfter" | "stepBefore";
|
|
110
|
+
export declare type ColorScalePropType = "grayscale" | "qualitative" | "heatmap" | "warm" | "cool" | "red" | "green" | "blue" | string[];
|
|
111
|
+
export declare type SortOrderPropType = "ascending" | "descending";
|
|
112
|
+
export interface VictoryLabelableProps {
|
|
113
|
+
labelComponent?: React.ReactElement;
|
|
114
|
+
}
|
|
115
|
+
export interface VictoryMultiLabelableProps extends VictoryLabelableProps {
|
|
116
|
+
labels?: string[] | number[] | {
|
|
117
|
+
(data: any): string | string[] | number | number[] | null;
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
export interface VictorySingleLabelableProps extends VictoryLabelableProps {
|
|
121
|
+
label?: string | {
|
|
122
|
+
(data: any): string | number | null;
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
export declare type CoordinatesPropType = {
|
|
126
|
+
x: number;
|
|
127
|
+
y: number;
|
|
128
|
+
};
|
|
129
|
+
export {};
|
|
130
|
+
//# sourceMappingURL=prop-types.d.ts.map
|
|
@@ -0,0 +1,26 @@
|
|
|
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
|
+
}
|
|
26
|
+
//# sourceMappingURL=victory-accessible-group.d.ts.map
|
|
@@ -6,7 +6,7 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
|
|
|
6
6
|
|
|
7
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
8
|
|
|
9
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf
|
|
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
10
|
|
|
11
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
12
|
|
|
@@ -16,14 +16,11 @@ function _assertThisInitialized(self) { if (self === void 0) { throw new Referen
|
|
|
16
16
|
|
|
17
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
18
|
|
|
19
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
20
|
-
|
|
21
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
19
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
22
20
|
|
|
23
21
|
import React from "react";
|
|
24
22
|
import PropTypes from "prop-types";
|
|
25
|
-
|
|
26
|
-
var VictoryAccessibleGroup = /*#__PURE__*/function (_React$Component) {
|
|
23
|
+
export var VictoryAccessibleGroup = /*#__PURE__*/function (_React$Component) {
|
|
27
24
|
_inherits(VictoryAccessibleGroup, _React$Component);
|
|
28
25
|
|
|
29
26
|
var _super = _createSuper(VictoryAccessibleGroup);
|
|
@@ -61,20 +58,16 @@ var VictoryAccessibleGroup = /*#__PURE__*/function (_React$Component) {
|
|
|
61
58
|
|
|
62
59
|
return VictoryAccessibleGroup;
|
|
63
60
|
}(React.Component);
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
_defineProperty(VictoryAccessibleGroup, "propTypes", {
|
|
61
|
+
VictoryAccessibleGroup.displayName = "VictoryAccessibleGroup";
|
|
62
|
+
VictoryAccessibleGroup.propTypes = {
|
|
68
63
|
"aria-describedby": PropTypes.string,
|
|
69
64
|
"aria-label": PropTypes.string,
|
|
70
65
|
children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node]),
|
|
71
66
|
className: PropTypes.string,
|
|
72
67
|
desc: PropTypes.string,
|
|
73
68
|
tabIndex: PropTypes.number
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
_defineProperty(VictoryAccessibleGroup, "defaultProps", {
|
|
69
|
+
};
|
|
70
|
+
VictoryAccessibleGroup.defaultProps = {
|
|
77
71
|
className: "VictoryAccessibleGroup"
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
export default VictoryAccessibleGroup;
|
|
72
|
+
};
|
|
73
|
+
//# sourceMappingURL=victory-accessible-group.js.map
|
|
@@ -0,0 +1,67 @@
|
|
|
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) => (t: number) => 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;
|
|
67
|
+
//# sourceMappingURL=util.d.ts.map
|
|
@@ -35,7 +35,7 @@ export var isInterpolatable = function (obj) {
|
|
|
35
35
|
// component is only going to call the function (in which case it's
|
|
36
36
|
// safely interpolatable) or if it's going to access special properties
|
|
37
37
|
// (in which case our function generated from `interpolateFunction` will
|
|
38
|
-
// most likely cause an error. We could check for enumerable properties
|
|
38
|
+
// most likely cause an error). We could check for enumerable properties
|
|
39
39
|
// on the function object here to see if it's a "plain" function, but
|
|
40
40
|
// let's just require that components prevent such function props from
|
|
41
41
|
// being animated in the first place.
|
|
@@ -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,12 +200,15 @@ 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 :)
|
|
203
204
|
return interpolateObject(a, b);
|
|
204
205
|
}
|
|
205
206
|
|
|
206
207
|
if (typeof a === "string" || typeof b === "string") {
|
|
207
208
|
return interpolateString(a, b);
|
|
208
|
-
}
|
|
209
|
+
} // @ts-expect-error These generics are tough, but they work :)
|
|
210
|
+
|
|
209
211
|
|
|
210
212
|
return interpolate(a, b);
|
|
211
|
-
};
|
|
213
|
+
};
|
|
214
|
+
//# sourceMappingURL=util.js.map
|
|
@@ -0,0 +1,70 @@
|
|
|
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
|
+
}
|
|
70
|
+
//# sourceMappingURL=victory-animation.d.ts.map
|