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
|
@@ -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
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.VictoryAccessibleGroup = void 0;
|
|
7
7
|
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
|
|
@@ -19,7 +19,7 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
|
|
|
19
19
|
|
|
20
20
|
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); }
|
|
21
21
|
|
|
22
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf
|
|
22
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
23
23
|
|
|
24
24
|
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); }; }
|
|
25
25
|
|
|
@@ -29,9 +29,7 @@ function _assertThisInitialized(self) { if (self === void 0) { throw new Referen
|
|
|
29
29
|
|
|
30
30
|
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; } }
|
|
31
31
|
|
|
32
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
33
|
-
|
|
34
|
-
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; }
|
|
32
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
35
33
|
|
|
36
34
|
var VictoryAccessibleGroup = /*#__PURE__*/function (_React$Component) {
|
|
37
35
|
_inherits(VictoryAccessibleGroup, _React$Component);
|
|
@@ -72,20 +70,17 @@ var VictoryAccessibleGroup = /*#__PURE__*/function (_React$Component) {
|
|
|
72
70
|
return VictoryAccessibleGroup;
|
|
73
71
|
}(_react.default.Component);
|
|
74
72
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
73
|
+
exports.VictoryAccessibleGroup = VictoryAccessibleGroup;
|
|
74
|
+
VictoryAccessibleGroup.displayName = "VictoryAccessibleGroup";
|
|
75
|
+
VictoryAccessibleGroup.propTypes = {
|
|
78
76
|
"aria-describedby": _propTypes.default.string,
|
|
79
77
|
"aria-label": _propTypes.default.string,
|
|
80
78
|
children: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.node), _propTypes.default.node]),
|
|
81
79
|
className: _propTypes.default.string,
|
|
82
80
|
desc: _propTypes.default.string,
|
|
83
81
|
tabIndex: _propTypes.default.number
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
_defineProperty(VictoryAccessibleGroup, "defaultProps", {
|
|
82
|
+
};
|
|
83
|
+
VictoryAccessibleGroup.defaultProps = {
|
|
87
84
|
className: "VictoryAccessibleGroup"
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
var _default = VictoryAccessibleGroup;
|
|
91
|
-
exports.default = _default;
|
|
85
|
+
};
|
|
86
|
+
//# 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
|
|
@@ -47,7 +47,7 @@ var isInterpolatable = function (obj) {
|
|
|
47
47
|
// component is only going to call the function (in which case it's
|
|
48
48
|
// safely interpolatable) or if it's going to access special properties
|
|
49
49
|
// (in which case our function generated from `interpolateFunction` will
|
|
50
|
-
// most likely cause an error. We could check for enumerable properties
|
|
50
|
+
// most likely cause an error). We could check for enumerable properties
|
|
51
51
|
// on the function object here to see if it's a "plain" function, but
|
|
52
52
|
// let's just require that components prevent such function props from
|
|
53
53
|
// being animated in the first place.
|
|
@@ -105,7 +105,7 @@ var interpolateFunction = function (a, b) {
|
|
|
105
105
|
}
|
|
106
106
|
|
|
107
107
|
return function () {
|
|
108
|
-
/* eslint-disable no-invalid-this */
|
|
108
|
+
/* eslint-disable no-invalid-this, prefer-rest-params */
|
|
109
109
|
var aval = typeof a === "function" ? a.apply(this, arguments) : a;
|
|
110
110
|
var bval = typeof b === "function" ? b.apply(this, arguments) : b;
|
|
111
111
|
return (0, _d3Interpolate.interpolate)(aval, bval)(t);
|
|
@@ -227,14 +227,17 @@ var victoryInterpolator = function (a, b) {
|
|
|
227
227
|
}
|
|
228
228
|
|
|
229
229
|
if ((0, _isPlainObject2.default)(a) || (0, _isPlainObject2.default)(b)) {
|
|
230
|
+
// @ts-expect-error These generics are tough, but they work :)
|
|
230
231
|
return interpolateObject(a, b);
|
|
231
232
|
}
|
|
232
233
|
|
|
233
234
|
if (typeof a === "string" || typeof b === "string") {
|
|
234
235
|
return interpolateString(a, b);
|
|
235
|
-
}
|
|
236
|
+
} // @ts-expect-error These generics are tough, but they work :)
|
|
237
|
+
|
|
236
238
|
|
|
237
239
|
return (0, _d3Interpolate.interpolate)(a, b);
|
|
238
240
|
};
|
|
239
241
|
|
|
240
|
-
exports.victoryInterpolator = victoryInterpolator;
|
|
242
|
+
exports.victoryInterpolator = victoryInterpolator;
|
|
243
|
+
//# 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
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.VictoryAnimation = void 0;
|
|
7
7
|
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
|
|
@@ -43,7 +43,7 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
|
|
|
43
43
|
|
|
44
44
|
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); }
|
|
45
45
|
|
|
46
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf
|
|
46
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
47
47
|
|
|
48
48
|
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); }; }
|
|
49
49
|
|
|
@@ -53,9 +53,7 @@ function _assertThisInitialized(self) { if (self === void 0) { throw new Referen
|
|
|
53
53
|
|
|
54
54
|
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; } }
|
|
55
55
|
|
|
56
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
57
|
-
|
|
58
|
-
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; }
|
|
56
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
59
57
|
|
|
60
58
|
var VictoryAnimation = /*#__PURE__*/function (_React$Component) {
|
|
61
59
|
_inherits(VictoryAnimation, _React$Component);
|
|
@@ -70,6 +68,56 @@ var VictoryAnimation = /*#__PURE__*/function (_React$Component) {
|
|
|
70
68
|
_this = _super.call(this, props, context);
|
|
71
69
|
/* defaults */
|
|
72
70
|
|
|
71
|
+
_this.interpolator = void 0;
|
|
72
|
+
_this.queue = void 0;
|
|
73
|
+
_this.ease = void 0;
|
|
74
|
+
_this.timer = void 0;
|
|
75
|
+
_this.loopID = void 0;
|
|
76
|
+
|
|
77
|
+
_this.functionToBeRunEachFrame = function (elapsed, duration) {
|
|
78
|
+
/*
|
|
79
|
+
step can generate imprecise values, sometimes greater than 1
|
|
80
|
+
if this happens set the state to 1 and return, cancelling the timer
|
|
81
|
+
*/
|
|
82
|
+
duration = duration !== undefined ? duration : _this.props.duration;
|
|
83
|
+
var step = duration ? elapsed / duration : 1;
|
|
84
|
+
|
|
85
|
+
if (step >= 1) {
|
|
86
|
+
_this.setState({
|
|
87
|
+
data: _this.interpolator(1),
|
|
88
|
+
animationInfo: {
|
|
89
|
+
progress: 1,
|
|
90
|
+
animating: false,
|
|
91
|
+
terminating: true
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
if (_this.loopID) {
|
|
96
|
+
_this.timer.unsubscribe(_this.loopID);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
_this.queue.shift();
|
|
100
|
+
|
|
101
|
+
_this.traverseQueue();
|
|
102
|
+
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
/*
|
|
106
|
+
if we're not at the end of the timer, set the state by passing
|
|
107
|
+
current step value that's transformed by the ease function to the
|
|
108
|
+
interpolator, which is cached for performance whenever props are received
|
|
109
|
+
*/
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
_this.setState({
|
|
113
|
+
data: _this.interpolator(_this.ease(step)),
|
|
114
|
+
animationInfo: {
|
|
115
|
+
progress: step,
|
|
116
|
+
animating: step < 1
|
|
117
|
+
}
|
|
118
|
+
});
|
|
119
|
+
};
|
|
120
|
+
|
|
73
121
|
_this.state = {
|
|
74
122
|
data: Array.isArray(_this.props.data) ? _this.props.data[0] : _this.props.data,
|
|
75
123
|
animationInfo: {
|
|
@@ -82,12 +130,6 @@ var VictoryAnimation = /*#__PURE__*/function (_React$Component) {
|
|
|
82
130
|
/* build easing function */
|
|
83
131
|
|
|
84
132
|
_this.ease = d3Ease[_this.toNewName(_this.props.easing)];
|
|
85
|
-
/*
|
|
86
|
-
There is no autobinding of this in ES6 classes
|
|
87
|
-
so we bind functionToBeRunEachFrame to current instance of victory animation class
|
|
88
|
-
*/
|
|
89
|
-
|
|
90
|
-
_this.functionToBeRunEachFrame = _this.functionToBeRunEachFrame.bind(_assertThisInitialized(_this));
|
|
91
133
|
_this.timer = _this.context.animationTimer;
|
|
92
134
|
return _this;
|
|
93
135
|
}
|
|
@@ -188,49 +230,6 @@ var VictoryAnimation = /*#__PURE__*/function (_React$Component) {
|
|
|
188
230
|
}
|
|
189
231
|
/* every frame we... */
|
|
190
232
|
|
|
191
|
-
}, {
|
|
192
|
-
key: "functionToBeRunEachFrame",
|
|
193
|
-
value: function functionToBeRunEachFrame(elapsed, duration) {
|
|
194
|
-
/*
|
|
195
|
-
step can generate imprecise values, sometimes greater than 1
|
|
196
|
-
if this happens set the state to 1 and return, cancelling the timer
|
|
197
|
-
*/
|
|
198
|
-
duration = duration !== undefined ? duration : this.props.duration;
|
|
199
|
-
var step = duration ? elapsed / duration : 1;
|
|
200
|
-
|
|
201
|
-
if (step >= 1) {
|
|
202
|
-
this.setState({
|
|
203
|
-
data: this.interpolator(1),
|
|
204
|
-
animationInfo: {
|
|
205
|
-
progress: 1,
|
|
206
|
-
animating: false,
|
|
207
|
-
terminating: true
|
|
208
|
-
}
|
|
209
|
-
});
|
|
210
|
-
|
|
211
|
-
if (this.loopID) {
|
|
212
|
-
this.timer.unsubscribe(this.loopID);
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
this.queue.shift();
|
|
216
|
-
this.traverseQueue();
|
|
217
|
-
return;
|
|
218
|
-
}
|
|
219
|
-
/*
|
|
220
|
-
if we're not at the end of the timer, set the state by passing
|
|
221
|
-
current step value that's transformed by the ease function to the
|
|
222
|
-
interpolator, which is cached for performance whenever props are received
|
|
223
|
-
*/
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
this.setState({
|
|
227
|
-
data: this.interpolator(this.ease(step)),
|
|
228
|
-
animationInfo: {
|
|
229
|
-
progress: step,
|
|
230
|
-
animating: step < 1
|
|
231
|
-
}
|
|
232
|
-
});
|
|
233
|
-
}
|
|
234
233
|
}, {
|
|
235
234
|
key: "render",
|
|
236
235
|
value: function render() {
|
|
@@ -241,24 +240,21 @@ var VictoryAnimation = /*#__PURE__*/function (_React$Component) {
|
|
|
241
240
|
return VictoryAnimation;
|
|
242
241
|
}(_react.default.Component);
|
|
243
242
|
|
|
244
|
-
exports.
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
_defineProperty(VictoryAnimation, "propTypes", {
|
|
243
|
+
exports.VictoryAnimation = VictoryAnimation;
|
|
244
|
+
VictoryAnimation.displayName = "VictoryAnimation";
|
|
245
|
+
VictoryAnimation.propTypes = {
|
|
249
246
|
children: _propTypes.default.func,
|
|
250
247
|
data: _propTypes.default.oneOfType([_propTypes.default.object, _propTypes.default.array]),
|
|
251
248
|
delay: _propTypes.default.number,
|
|
252
249
|
duration: _propTypes.default.number,
|
|
253
250
|
easing: _propTypes.default.oneOf(["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"]),
|
|
254
251
|
onEnd: _propTypes.default.func
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
_defineProperty(VictoryAnimation, "defaultProps", {
|
|
252
|
+
};
|
|
253
|
+
VictoryAnimation.defaultProps = {
|
|
258
254
|
data: {},
|
|
259
255
|
delay: 0,
|
|
260
256
|
duration: 1000,
|
|
261
257
|
easing: "quadInOut"
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
|
|
258
|
+
};
|
|
259
|
+
VictoryAnimation.contextType = _timerContext.default;
|
|
260
|
+
//# sourceMappingURL=victory-animation.js.map
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import PropTypes from "prop-types";
|
|
3
|
+
import { BlockProps } from "../victory-theme/victory-theme";
|
|
4
|
+
import { OriginType } from "../victory-label/victory-label";
|
|
5
|
+
export interface VictoryClipContainerProps {
|
|
6
|
+
"aria-label"?: string;
|
|
7
|
+
children?: React.ReactElement | React.ReactElement[];
|
|
8
|
+
circleComponent?: React.ReactElement;
|
|
9
|
+
className?: string;
|
|
10
|
+
clipHeight?: number;
|
|
11
|
+
clipId?: number | string;
|
|
12
|
+
clipPadding?: BlockProps;
|
|
13
|
+
clipPathComponent?: React.ReactElement;
|
|
14
|
+
clipWidth?: number;
|
|
15
|
+
events?: React.DOMAttributes<any>;
|
|
16
|
+
groupComponent?: React.ReactElement;
|
|
17
|
+
origin?: OriginType;
|
|
18
|
+
polar?: boolean;
|
|
19
|
+
radius?: number;
|
|
20
|
+
rectComponent?: React.ReactElement;
|
|
21
|
+
translateX?: number;
|
|
22
|
+
translateY?: number;
|
|
23
|
+
}
|
|
24
|
+
export declare class VictoryClipContainer extends React.Component<VictoryClipContainerProps> {
|
|
25
|
+
static displayName: string;
|
|
26
|
+
static role: string;
|
|
27
|
+
static propTypes: {
|
|
28
|
+
"aria-label": PropTypes.Requireable<string>;
|
|
29
|
+
children: PropTypes.Requireable<string | number | boolean | PropTypes.ReactElementLike | PropTypes.ReactNodeArray>;
|
|
30
|
+
circleComponent: PropTypes.Requireable<PropTypes.ReactElementLike>;
|
|
31
|
+
className: PropTypes.Requireable<string>;
|
|
32
|
+
clipHeight: PropTypes.Requireable<number | undefined>;
|
|
33
|
+
clipId: PropTypes.Requireable<string | number>;
|
|
34
|
+
clipPadding: PropTypes.Requireable<PropTypes.InferProps<{
|
|
35
|
+
top: PropTypes.Requireable<number>;
|
|
36
|
+
bottom: PropTypes.Requireable<number>;
|
|
37
|
+
left: PropTypes.Requireable<number>;
|
|
38
|
+
right: PropTypes.Requireable<number>;
|
|
39
|
+
}>>;
|
|
40
|
+
clipPathComponent: PropTypes.Requireable<PropTypes.ReactElementLike>;
|
|
41
|
+
clipWidth: PropTypes.Requireable<number | undefined>;
|
|
42
|
+
events: PropTypes.Requireable<object>;
|
|
43
|
+
groupComponent: PropTypes.Requireable<PropTypes.ReactElementLike>;
|
|
44
|
+
origin: PropTypes.Requireable<PropTypes.InferProps<{
|
|
45
|
+
x: PropTypes.Requireable<number | undefined>;
|
|
46
|
+
y: PropTypes.Requireable<number | undefined>;
|
|
47
|
+
}>>;
|
|
48
|
+
polar: PropTypes.Requireable<boolean>;
|
|
49
|
+
radius: PropTypes.Requireable<number | undefined>;
|
|
50
|
+
style: PropTypes.Requireable<object>;
|
|
51
|
+
tabIndex: PropTypes.Requireable<number>;
|
|
52
|
+
transform: PropTypes.Requireable<string>;
|
|
53
|
+
translateX: PropTypes.Requireable<number>;
|
|
54
|
+
translateY: PropTypes.Requireable<number>;
|
|
55
|
+
};
|
|
56
|
+
static defaultProps: {
|
|
57
|
+
circleComponent: JSX.Element;
|
|
58
|
+
rectComponent: JSX.Element;
|
|
59
|
+
clipPathComponent: JSX.Element;
|
|
60
|
+
groupComponent: JSX.Element;
|
|
61
|
+
};
|
|
62
|
+
private clipId;
|
|
63
|
+
constructor(props: VictoryClipContainerProps);
|
|
64
|
+
calculateAttributes(props: any): {
|
|
65
|
+
x: number;
|
|
66
|
+
y: number;
|
|
67
|
+
width: number;
|
|
68
|
+
height: number;
|
|
69
|
+
};
|
|
70
|
+
renderClippedGroup(props: any, clipId: any): React.DetailedReactHTMLElement<any, HTMLElement>;
|
|
71
|
+
renderGroup(props: any): React.DetailedReactHTMLElement<any, HTMLElement>;
|
|
72
|
+
renderClipComponent(props: any, clipId: any): React.DetailedReactHTMLElement<any, HTMLElement>;
|
|
73
|
+
getClipValue(props: any, axis: any): any;
|
|
74
|
+
getTranslateValue(props: any, axis: any): any;
|
|
75
|
+
render(): React.DetailedReactHTMLElement<any, HTMLElement>;
|
|
76
|
+
}
|
|
77
|
+
//# sourceMappingURL=victory-clip-container.d.ts.map
|