victory-core 36.5.0 → 36.5.3
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 +13817 -10827
- package/dist/victory-core.min.js +1 -1
- package/es/index.d.ts +7 -27
- package/es/index.js +7 -53
- package/es/{types.d.ts → types/callbacks.d.ts} +12 -8
- 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 +1 -0
- package/es/victory-accessible-group/victory-accessible-group.js +2 -1
- package/es/victory-animation/util.d.ts +2 -1
- package/es/victory-animation/util.js +6 -4
- package/es/victory-animation/victory-animation.d.ts +1 -0
- package/es/victory-animation/victory-animation.js +2 -1
- package/es/victory-clip-container/victory-clip-container.d.ts +6 -5
- package/es/victory-clip-container/victory-clip-container.js +2 -1
- package/es/victory-container/victory-container.d.ts +8 -7
- package/es/victory-container/victory-container.js +2 -1
- package/es/victory-label/victory-label.d.ts +3 -2
- package/es/victory-label/victory-label.js +4 -4
- package/es/victory-portal/portal-context.d.ts +1 -0
- package/es/victory-portal/portal-context.js +2 -1
- package/es/victory-portal/portal.d.ts +3 -2
- package/es/victory-portal/portal.js +2 -1
- package/es/victory-portal/victory-portal.d.ts +1 -0
- package/es/victory-portal/victory-portal.js +2 -1
- package/es/victory-primitives/arc.d.ts +31 -2
- package/es/victory-primitives/arc.js +3 -2
- package/es/victory-primitives/background.d.ts +31 -2
- package/es/victory-primitives/background.js +3 -2
- package/es/victory-primitives/border.d.ts +28 -2
- package/es/victory-primitives/border.js +3 -2
- package/es/victory-primitives/circle.d.ts +1 -0
- package/es/victory-primitives/circle.js +2 -1
- package/es/victory-primitives/clip-path.d.ts +2 -1
- package/es/victory-primitives/clip-path.js +2 -1
- package/es/victory-primitives/index.d.ts +1 -0
- package/es/victory-primitives/index.js +2 -1
- package/es/victory-primitives/line-segment.d.ts +29 -2
- package/es/victory-primitives/line-segment.js +3 -2
- package/es/victory-primitives/line.d.ts +1 -0
- package/es/victory-primitives/line.js +2 -1
- package/es/victory-primitives/path.d.ts +1 -0
- package/es/victory-primitives/path.js +2 -1
- package/es/victory-primitives/point.d.ts +30 -2
- package/es/victory-primitives/point.js +3 -2
- package/es/victory-primitives/rect.d.ts +1 -0
- package/es/victory-primitives/rect.js +2 -1
- package/es/victory-primitives/text.d.ts +2 -1
- package/es/victory-primitives/text.js +2 -1
- package/es/victory-primitives/tspan.d.ts +2 -1
- package/es/victory-primitives/tspan.js +2 -1
- package/es/victory-primitives/types.d.ts +2 -1
- package/es/victory-primitives/types.js +2 -1
- package/es/victory-primitives/whisker.d.ts +37 -2
- package/es/victory-primitives/whisker.js +3 -2
- 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 +2 -1
- package/es/victory-theme/grayscale.js +2 -1
- package/es/victory-theme/material.d.ts +2 -1
- package/es/victory-theme/material.js +2 -1
- package/{lib/victory-theme/victory-theme-definition.d.ts → es/victory-theme/types.d.ts} +3 -8
- package/es/victory-theme/types.js +2 -0
- package/es/victory-theme/victory-theme.d.ts +4 -3
- package/es/victory-theme/victory-theme.js +3 -2
- package/es/victory-transition/victory-transition.d.ts +1 -0
- package/es/victory-transition/victory-transition.js +2 -1
- package/es/victory-util/add-events.d.ts +106 -0
- package/es/victory-util/add-events.js +40 -33
- package/es/victory-util/axis.d.ts +51 -0
- package/es/victory-util/axis.js +9 -7
- package/es/victory-util/collection.d.ts +9 -0
- package/es/victory-util/collection.js +6 -4
- 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 -1
- package/es/victory-util/default-transitions.d.ts +5 -0
- package/es/victory-util/default-transitions.js +2 -1
- package/es/victory-util/domain.d.ts +91 -0
- package/es/victory-util/domain.js +6 -2
- 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 -4
- 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 +4 -3
- 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 -4
- 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 -1
- 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 -1
- package/es/victory-util/point-path-helpers.d.ts +1 -0
- package/es/victory-util/point-path-helpers.js +2 -1
- 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 -23
- package/es/victory-util/selection.js +25 -14
- package/es/victory-util/style.d.ts +19 -0
- package/es/victory-util/style.js +2 -1
- package/es/victory-util/textsize.d.ts +37 -8
- package/es/victory-util/textsize.js +9 -6
- package/es/victory-util/timer-context.d.ts +1 -0
- package/es/victory-util/timer-context.js +2 -1
- package/es/victory-util/timer.d.ts +3 -2
- package/es/victory-util/timer.js +2 -1
- 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 +7 -27
- package/lib/index.js +58 -147
- package/lib/{types.d.ts → types/callbacks.d.ts} +12 -8
- 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 +1 -0
- package/lib/victory-accessible-group/victory-accessible-group.js +2 -1
- package/lib/victory-animation/util.d.ts +2 -1
- package/lib/victory-animation/util.js +6 -4
- package/lib/victory-animation/victory-animation.d.ts +1 -0
- package/lib/victory-animation/victory-animation.js +2 -1
- package/lib/victory-clip-container/victory-clip-container.d.ts +6 -5
- package/lib/victory-clip-container/victory-clip-container.js +2 -1
- package/lib/victory-container/victory-container.d.ts +8 -7
- package/lib/victory-container/victory-container.js +2 -1
- package/lib/victory-label/victory-label.d.ts +3 -2
- package/lib/victory-label/victory-label.js +4 -4
- package/lib/victory-portal/portal-context.d.ts +1 -0
- package/lib/victory-portal/portal-context.js +2 -1
- package/lib/victory-portal/portal.d.ts +3 -2
- package/lib/victory-portal/portal.js +2 -1
- package/lib/victory-portal/victory-portal.d.ts +1 -0
- package/lib/victory-portal/victory-portal.js +2 -1
- package/lib/victory-primitives/arc.d.ts +31 -2
- package/lib/victory-primitives/arc.js +4 -3
- package/lib/victory-primitives/background.d.ts +31 -2
- package/lib/victory-primitives/background.js +4 -3
- package/lib/victory-primitives/border.d.ts +28 -2
- package/lib/victory-primitives/border.js +4 -3
- package/lib/victory-primitives/circle.d.ts +1 -0
- package/lib/victory-primitives/circle.js +2 -1
- package/lib/victory-primitives/clip-path.d.ts +2 -1
- package/lib/victory-primitives/clip-path.js +2 -1
- package/lib/victory-primitives/index.d.ts +1 -0
- package/lib/victory-primitives/index.js +2 -1
- package/lib/victory-primitives/line-segment.d.ts +29 -2
- package/lib/victory-primitives/line-segment.js +4 -3
- package/lib/victory-primitives/line.d.ts +1 -0
- package/lib/victory-primitives/line.js +2 -1
- package/lib/victory-primitives/path.d.ts +1 -0
- package/lib/victory-primitives/path.js +2 -1
- package/lib/victory-primitives/point.d.ts +30 -2
- package/lib/victory-primitives/point.js +4 -3
- package/lib/victory-primitives/rect.d.ts +1 -0
- package/lib/victory-primitives/rect.js +2 -1
- package/lib/victory-primitives/text.d.ts +2 -1
- package/lib/victory-primitives/text.js +2 -1
- package/lib/victory-primitives/tspan.d.ts +2 -1
- package/lib/victory-primitives/tspan.js +2 -1
- package/lib/victory-primitives/types.d.ts +2 -1
- package/lib/victory-primitives/types.js +2 -1
- package/lib/victory-primitives/whisker.d.ts +37 -2
- package/lib/victory-primitives/whisker.js +4 -3
- 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 +2 -1
- package/lib/victory-theme/grayscale.js +2 -1
- package/lib/victory-theme/material.d.ts +2 -1
- package/lib/victory-theme/material.js +2 -1
- package/{es/victory-theme/victory-theme-definition.d.ts → lib/victory-theme/types.d.ts} +3 -8
- package/lib/victory-theme/types.js +2 -0
- package/lib/victory-theme/victory-theme.d.ts +4 -3
- package/lib/victory-theme/victory-theme.js +6 -5
- package/lib/victory-transition/victory-transition.d.ts +1 -0
- package/lib/victory-transition/victory-transition.js +2 -1
- package/lib/victory-util/add-events.d.ts +106 -0
- package/lib/victory-util/add-events.js +40 -36
- 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 -4
- 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 -1
- 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 -4
- 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 +4 -3
- 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 -4
- 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 -1
- 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 -1
- package/lib/victory-util/point-path-helpers.d.ts +1 -0
- package/lib/victory-util/point-path-helpers.js +2 -1
- 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 -23
- package/lib/victory-util/selection.js +25 -19
- package/lib/victory-util/style.d.ts +19 -0
- package/lib/victory-util/style.js +2 -1
- package/lib/victory-util/textsize.d.ts +37 -8
- package/lib/victory-util/textsize.js +9 -6
- package/lib/victory-util/timer-context.d.ts +1 -0
- package/lib/victory-util/timer-context.js +2 -1
- package/lib/victory-util/timer.d.ts +3 -2
- package/lib/victory-util/timer.js +2 -1
- 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 +3 -3
- package/src/index.ts +9 -31
- package/src/{types.ts → types/callbacks.ts} +21 -13
- package/src/types/prop-types.ts +195 -0
- package/src/victory-accessible-group/victory-accessible-group.tsx +3 -3
- package/src/victory-animation/util.ts +3 -2
- package/src/victory-animation/victory-animation.tsx +13 -13
- package/src/victory-clip-container/victory-clip-container.tsx +23 -23
- package/src/victory-container/victory-container.tsx +19 -19
- package/src/victory-label/victory-label.tsx +41 -39
- package/src/victory-portal/portal.tsx +1 -1
- package/src/victory-portal/victory-portal.tsx +3 -3
- package/src/victory-primitives/arc.tsx +8 -6
- package/src/victory-primitives/background.tsx +8 -6
- package/src/victory-primitives/border.tsx +8 -6
- package/src/victory-primitives/clip-path.tsx +3 -3
- package/src/victory-primitives/line-segment.tsx +8 -6
- package/src/victory-primitives/point.tsx +10 -8
- package/src/victory-primitives/text.tsx +2 -2
- package/src/victory-primitives/tspan.tsx +1 -1
- package/src/victory-primitives/types.ts +1 -1
- package/src/victory-primitives/whisker.tsx +15 -13
- 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.tsx +62 -62
- package/src/victory-theme/material.tsx +67 -67
- package/src/victory-theme/{victory-theme-definition.ts → types.ts} +10 -14
- package/src/victory-theme/victory-theme.tsx +1 -1
- package/src/victory-transition/victory-transition.tsx +19 -19
- package/src/victory-util/{add-events.js → add-events.tsx} +136 -59
- package/src/victory-util/{axis.js → axis.tsx} +17 -18
- package/src/victory-util/{collection.js → collection.tsx} +14 -10
- package/src/victory-util/common-props.tsx +307 -0
- package/src/victory-util/{data.js → data.ts} +14 -10
- package/src/victory-util/{default-transitions.js → default-transitions.ts} +20 -18
- package/src/victory-util/{domain.js → domain.ts} +26 -23
- package/src/victory-util/{events.js → events.ts} +82 -31
- package/src/victory-util/{helpers.js → helpers.ts} +41 -22
- package/src/victory-util/hooks/{index.js → index.ts} +0 -0
- package/src/victory-util/hooks/use-animation-state.js +12 -12
- package/src/victory-util/hooks/use-previous-props.ts +9 -0
- package/src/victory-util/{immutable.js → immutable.ts} +14 -10
- package/src/victory-util/index.ts +28 -0
- package/src/victory-util/{label-helpers.js → label-helpers.ts} +7 -7
- package/src/victory-util/line-helpers.ts +104 -0
- package/src/victory-util/{log.js → log.ts} +1 -1
- package/src/victory-util/{prop-types.js → prop-types.ts} +103 -101
- package/src/victory-util/{scale.js → scale.ts} +29 -16
- package/src/victory-util/selection.ts +158 -0
- package/src/victory-util/{style.js → style.ts} +3 -3
- package/src/victory-util/{textsize.js → textsize.ts} +32 -17
- package/src/victory-util/timer-context.ts +1 -1
- package/src/victory-util/timer.ts +5 -10
- package/src/victory-util/{transitions.js → transitions.ts} +50 -22
- 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 -33
- package/es/types.js +0 -1
- package/es/victory-theme/victory-theme-definition.js +0 -1
- package/es/victory-util/types.d.ts +0 -188
- package/es/victory-util/types.js +0 -1
- package/lib/types.js +0 -1
- package/lib/victory-theme/victory-theme-definition.js +0 -1
- package/lib/victory-util/types.d.ts +0 -188
- package/lib/victory-util/types.js +0 -1
- 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/selection.d.ts +0 -23
- package/src/victory-util/selection.js +0 -98
- package/src/victory-util/textsize.d.ts +0 -8
- package/src/victory-util/types.ts +0 -247
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import {
|
|
3
|
+
ScaleLinear,
|
|
4
|
+
ScaleLogarithmic,
|
|
5
|
+
ScalePower,
|
|
6
|
+
ScaleTime,
|
|
7
|
+
} from "victory-vendor/d3-scale";
|
|
8
|
+
import {
|
|
9
|
+
AnimationEasing,
|
|
10
|
+
AnimationStyle,
|
|
11
|
+
} from "../victory-animation/victory-animation";
|
|
12
|
+
import { StringOrNumberOrCallback } from "./callbacks";
|
|
13
|
+
|
|
14
|
+
export type AxisType = "x" | "y";
|
|
15
|
+
export type DatumValue = number | string | Date | null | undefined;
|
|
16
|
+
export type Datum = any;
|
|
17
|
+
export type ForAxes<T> = T | { x?: T; y?: T };
|
|
18
|
+
export type ID = number | string;
|
|
19
|
+
export type ValueOrAccessor<ValueType = unknown, PropsType = object> =
|
|
20
|
+
| ValueType
|
|
21
|
+
| ((props: PropsType) => ValueType);
|
|
22
|
+
export type Tuple<T> = [T, T];
|
|
23
|
+
export type ValueOrAxes<T> = T | ForAxes<T>;
|
|
24
|
+
|
|
25
|
+
export type DomainPaddingPropType = ValueOrAxes<PaddingType>;
|
|
26
|
+
export type DomainPropType = ValueOrAxes<DomainTuple>;
|
|
27
|
+
export type DomainValue = number | Date;
|
|
28
|
+
// This should be a tuple type, but every time we use it, it fails with a type error.
|
|
29
|
+
// type number[] is not assignable to type [number, number] | [Date, Date].
|
|
30
|
+
export type DomainTuple = Tuple<number> | Tuple<Date>;
|
|
31
|
+
export type PaddingType = number | Tuple<number>;
|
|
32
|
+
export type RangePropType = ValueOrAxes<RangeTuple>;
|
|
33
|
+
export type RangeTuple = number[];
|
|
34
|
+
export type StringOrNumberOrList = string | number | (string | number)[];
|
|
35
|
+
|
|
36
|
+
export interface Padding {
|
|
37
|
+
top: number;
|
|
38
|
+
bottom: number;
|
|
39
|
+
left: number;
|
|
40
|
+
right: number;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export interface AnimatePropTypeInterface {
|
|
44
|
+
duration?: number;
|
|
45
|
+
onEnd?: () => void;
|
|
46
|
+
onExit?: {
|
|
47
|
+
duration?: number;
|
|
48
|
+
before?: (datum: Datum, index: number, data: Datum[]) => AnimationStyle;
|
|
49
|
+
};
|
|
50
|
+
onEnter?: {
|
|
51
|
+
duration?: number;
|
|
52
|
+
before?: (datum: Datum, index: number, data: Datum[]) => AnimationStyle;
|
|
53
|
+
after?: (datum: Datum, index: number, data: Datum[]) => AnimationStyle;
|
|
54
|
+
};
|
|
55
|
+
onLoad?: {
|
|
56
|
+
duration?: number;
|
|
57
|
+
before?: (datum: Datum, index: number, data: Datum[]) => AnimationStyle;
|
|
58
|
+
after?: (datum: Datum, index: number, data: Datum[]) => AnimationStyle;
|
|
59
|
+
};
|
|
60
|
+
easing?: AnimationEasing;
|
|
61
|
+
animationWhitelist?: string[];
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export interface EventCallbackInterface<TTarget, TEventKey> {
|
|
65
|
+
childName?: string | string[];
|
|
66
|
+
target?: TTarget;
|
|
67
|
+
eventKey?: TEventKey;
|
|
68
|
+
mutation: (props: any) => any;
|
|
69
|
+
callback?: (props: any) => any;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export interface EventPropTypeInterface<TTarget, TEventKey> {
|
|
73
|
+
childName?: string | Array<StringOrNumberOrCallback>;
|
|
74
|
+
target: TTarget;
|
|
75
|
+
eventKey?: TEventKey;
|
|
76
|
+
eventHandlers: {
|
|
77
|
+
[key: string]:
|
|
78
|
+
| {
|
|
79
|
+
(
|
|
80
|
+
event: React.SyntheticEvent<any>,
|
|
81
|
+
props?: any,
|
|
82
|
+
): EventCallbackInterface<TTarget, TEventKey>;
|
|
83
|
+
}
|
|
84
|
+
| {
|
|
85
|
+
(
|
|
86
|
+
event: React.SyntheticEvent<any>,
|
|
87
|
+
props?: any,
|
|
88
|
+
): EventCallbackInterface<TTarget, TEventKey>[];
|
|
89
|
+
}
|
|
90
|
+
| {
|
|
91
|
+
(event: React.SyntheticEvent<any>, props?: any): void;
|
|
92
|
+
};
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
type NumberValue = number | { valueOf(): number };
|
|
97
|
+
/**
|
|
98
|
+
* D3 scale function shape. Don't want to introduce typing dependency to d3
|
|
99
|
+
*/
|
|
100
|
+
export interface D3Scale<TRange = any> {
|
|
101
|
+
(numberValue: NumberValue): number;
|
|
102
|
+
base?: () => number;
|
|
103
|
+
ticks: (count?: number) => number[];
|
|
104
|
+
tickFormat: (count?: number) => (d: number) => string;
|
|
105
|
+
domain: {
|
|
106
|
+
(): number[];
|
|
107
|
+
(domain: NumberValue[]): D3Scale<TRange>;
|
|
108
|
+
};
|
|
109
|
+
range: {
|
|
110
|
+
(): TRange[];
|
|
111
|
+
(range: TRange): D3Scale<TRange>;
|
|
112
|
+
};
|
|
113
|
+
copy: () => this;
|
|
114
|
+
invert: (value: number) => number;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
export type D3ScaleFn<TRange = any, TOutput = any> = () =>
|
|
118
|
+
| ScaleLinear<TRange, TOutput, unknown>
|
|
119
|
+
| ScaleLogarithmic<TRange, TOutput, unknown>
|
|
120
|
+
| ScaleTime<TRange, TOutput, unknown>
|
|
121
|
+
| ScalePower<TRange, TOutput, unknown>;
|
|
122
|
+
|
|
123
|
+
export type ScaleName = "linear" | "time" | "log" | "sqrt";
|
|
124
|
+
export type ScalePropType = ScaleName;
|
|
125
|
+
export type ScaleXYPropType = {
|
|
126
|
+
x: D3Scale;
|
|
127
|
+
y: D3Scale;
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
export type CategoryPropType =
|
|
131
|
+
| string[]
|
|
132
|
+
| { x: string[] }
|
|
133
|
+
| { y: string[] }
|
|
134
|
+
| {
|
|
135
|
+
x: string[];
|
|
136
|
+
y: string[];
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
export type DataGetterPropType = ValueOrAccessor<
|
|
140
|
+
string | string[] | number | number[]
|
|
141
|
+
>;
|
|
142
|
+
|
|
143
|
+
export type InterpolationPropType =
|
|
144
|
+
| "basis"
|
|
145
|
+
| "basisClosed"
|
|
146
|
+
| "basisOpen"
|
|
147
|
+
| "bundle"
|
|
148
|
+
| "cardinal"
|
|
149
|
+
| "cardinalClosed"
|
|
150
|
+
| "cardinalOpen"
|
|
151
|
+
| "catmullRom"
|
|
152
|
+
| "catmullRomClosed"
|
|
153
|
+
| "catmullRomOpen"
|
|
154
|
+
| "linear"
|
|
155
|
+
| "linearClosed"
|
|
156
|
+
| "monotoneX"
|
|
157
|
+
| "monotoneY"
|
|
158
|
+
| "natural"
|
|
159
|
+
| "radial"
|
|
160
|
+
| "step"
|
|
161
|
+
| "stepAfter"
|
|
162
|
+
| "stepBefore";
|
|
163
|
+
|
|
164
|
+
export type ColorScalePropType =
|
|
165
|
+
| "grayscale"
|
|
166
|
+
| "qualitative"
|
|
167
|
+
| "heatmap"
|
|
168
|
+
| "warm"
|
|
169
|
+
| "cool"
|
|
170
|
+
| "red"
|
|
171
|
+
| "green"
|
|
172
|
+
| "blue"
|
|
173
|
+
| string[];
|
|
174
|
+
|
|
175
|
+
export type SortOrderPropType = "ascending" | "descending";
|
|
176
|
+
|
|
177
|
+
export interface VictoryLabelableProps {
|
|
178
|
+
labelComponent?: React.ReactElement;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
export interface VictoryMultiLabelableProps extends VictoryLabelableProps {
|
|
182
|
+
labels?:
|
|
183
|
+
| string[]
|
|
184
|
+
| number[]
|
|
185
|
+
| { (data: any): string | string[] | number | number[] | null };
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
export interface VictorySingleLabelableProps extends VictoryLabelableProps {
|
|
189
|
+
label?: string | { (data: any): string | number | null };
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
export type CoordinatesPropType = {
|
|
193
|
+
x: number;
|
|
194
|
+
y: number;
|
|
195
|
+
};
|
|
@@ -17,15 +17,15 @@ export class VictoryAccessibleGroup extends React.Component<VictoryAccessibleGro
|
|
|
17
17
|
"aria-label": PropTypes.string,
|
|
18
18
|
children: PropTypes.oneOfType([
|
|
19
19
|
PropTypes.arrayOf(PropTypes.node),
|
|
20
|
-
PropTypes.node
|
|
20
|
+
PropTypes.node,
|
|
21
21
|
]),
|
|
22
22
|
className: PropTypes.string,
|
|
23
23
|
desc: PropTypes.string,
|
|
24
|
-
tabIndex: PropTypes.number
|
|
24
|
+
tabIndex: PropTypes.number,
|
|
25
25
|
};
|
|
26
26
|
|
|
27
27
|
static defaultProps = {
|
|
28
|
-
className: "VictoryAccessibleGroup"
|
|
28
|
+
className: "VictoryAccessibleGroup",
|
|
29
29
|
};
|
|
30
30
|
|
|
31
31
|
render() {
|
|
@@ -34,7 +34,7 @@ export const isInterpolatable = function (obj) {
|
|
|
34
34
|
// component is only going to call the function (in which case it's
|
|
35
35
|
// safely interpolatable) or if it's going to access special properties
|
|
36
36
|
// (in which case our function generated from `interpolateFunction` will
|
|
37
|
-
// most likely cause an error. We could check for enumerable properties
|
|
37
|
+
// most likely cause an error). We could check for enumerable properties
|
|
38
38
|
// on the function object here to see if it's a "plain" function, but
|
|
39
39
|
// let's just require that components prevent such function props from
|
|
40
40
|
// being animated in the first place.
|
|
@@ -193,11 +193,12 @@ export const victoryInterpolator = function <T>(a: T, b: T): (t: number) => T {
|
|
|
193
193
|
return interpolateFunction(a, b);
|
|
194
194
|
}
|
|
195
195
|
if (isPlainObject(a) || isPlainObject(b)) {
|
|
196
|
-
// @ts-expect-error These generics are tough, but they work
|
|
196
|
+
// @ts-expect-error These generics are tough, but they work :)
|
|
197
197
|
return interpolateObject(a, b);
|
|
198
198
|
}
|
|
199
199
|
if (typeof a === "string" || typeof b === "string") {
|
|
200
200
|
return interpolateString(a, b);
|
|
201
201
|
}
|
|
202
|
+
// @ts-expect-error These generics are tough, but they work :)
|
|
202
203
|
return interpolate(a, b);
|
|
203
204
|
};
|
|
@@ -131,16 +131,16 @@ export class VictoryAnimation extends React.Component<
|
|
|
131
131
|
"sin",
|
|
132
132
|
"sinIn",
|
|
133
133
|
"sinOut",
|
|
134
|
-
"sinInOut"
|
|
134
|
+
"sinInOut",
|
|
135
135
|
]),
|
|
136
|
-
onEnd: PropTypes.func
|
|
136
|
+
onEnd: PropTypes.func,
|
|
137
137
|
};
|
|
138
138
|
|
|
139
139
|
static defaultProps = {
|
|
140
140
|
data: {},
|
|
141
141
|
delay: 0,
|
|
142
142
|
duration: 1000,
|
|
143
|
-
easing: "quadInOut"
|
|
143
|
+
easing: "quadInOut",
|
|
144
144
|
};
|
|
145
145
|
|
|
146
146
|
static contextType = TimerContext;
|
|
@@ -159,8 +159,8 @@ export class VictoryAnimation extends React.Component<
|
|
|
159
159
|
: this.props.data,
|
|
160
160
|
animationInfo: {
|
|
161
161
|
progress: 0,
|
|
162
|
-
animating: false
|
|
163
|
-
}
|
|
162
|
+
animating: false,
|
|
163
|
+
},
|
|
164
164
|
};
|
|
165
165
|
this.interpolator = null;
|
|
166
166
|
this.queue = Array.isArray(this.props.data) ? this.props.data.slice(1) : [];
|
|
@@ -191,8 +191,8 @@ export class VictoryAnimation extends React.Component<
|
|
|
191
191
|
animationInfo: {
|
|
192
192
|
progress: 1,
|
|
193
193
|
animating: false,
|
|
194
|
-
terminating: true
|
|
195
|
-
}
|
|
194
|
+
terminating: true,
|
|
195
|
+
},
|
|
196
196
|
});
|
|
197
197
|
} else {
|
|
198
198
|
/* cancel existing loop if it exists */
|
|
@@ -240,13 +240,13 @@ export class VictoryAnimation extends React.Component<
|
|
|
240
240
|
setTimeout(() => {
|
|
241
241
|
this.loopID = this.timer.subscribe(
|
|
242
242
|
this.functionToBeRunEachFrame,
|
|
243
|
-
this.props.duration
|
|
243
|
+
this.props.duration!,
|
|
244
244
|
);
|
|
245
245
|
}, this.props.delay);
|
|
246
246
|
} else {
|
|
247
247
|
this.loopID = this.timer.subscribe(
|
|
248
248
|
this.functionToBeRunEachFrame,
|
|
249
|
-
this.props.duration
|
|
249
|
+
this.props.duration!,
|
|
250
250
|
);
|
|
251
251
|
}
|
|
252
252
|
} else if (this.props.onEnd) {
|
|
@@ -267,8 +267,8 @@ export class VictoryAnimation extends React.Component<
|
|
|
267
267
|
animationInfo: {
|
|
268
268
|
progress: 1,
|
|
269
269
|
animating: false,
|
|
270
|
-
terminating: true
|
|
271
|
-
}
|
|
270
|
+
terminating: true,
|
|
271
|
+
},
|
|
272
272
|
});
|
|
273
273
|
if (this.loopID) {
|
|
274
274
|
this.timer.unsubscribe(this.loopID);
|
|
@@ -286,8 +286,8 @@ export class VictoryAnimation extends React.Component<
|
|
|
286
286
|
data: this.interpolator!(this.ease(step)),
|
|
287
287
|
animationInfo: {
|
|
288
288
|
progress: step,
|
|
289
|
-
animating: step < 1
|
|
290
|
-
}
|
|
289
|
+
animating: step < 1,
|
|
290
|
+
},
|
|
291
291
|
});
|
|
292
292
|
};
|
|
293
293
|
|
|
@@ -38,7 +38,7 @@ export class VictoryClipContainer extends React.Component<VictoryClipContainerPr
|
|
|
38
38
|
"aria-label": PropTypes.string,
|
|
39
39
|
children: PropTypes.oneOfType([
|
|
40
40
|
PropTypes.arrayOf(PropTypes.node),
|
|
41
|
-
PropTypes.node
|
|
41
|
+
PropTypes.node,
|
|
42
42
|
]),
|
|
43
43
|
circleComponent: PropTypes.element,
|
|
44
44
|
className: PropTypes.string,
|
|
@@ -48,7 +48,7 @@ export class VictoryClipContainer extends React.Component<VictoryClipContainerPr
|
|
|
48
48
|
top: PropTypes.number,
|
|
49
49
|
bottom: PropTypes.number,
|
|
50
50
|
left: PropTypes.number,
|
|
51
|
-
right: PropTypes.number
|
|
51
|
+
right: PropTypes.number,
|
|
52
52
|
}),
|
|
53
53
|
clipPathComponent: PropTypes.element,
|
|
54
54
|
clipWidth: CustomPropTypes.nonNegative,
|
|
@@ -56,7 +56,7 @@ export class VictoryClipContainer extends React.Component<VictoryClipContainerPr
|
|
|
56
56
|
groupComponent: PropTypes.element,
|
|
57
57
|
origin: PropTypes.shape({
|
|
58
58
|
x: CustomPropTypes.nonNegative,
|
|
59
|
-
y: CustomPropTypes.nonNegative
|
|
59
|
+
y: CustomPropTypes.nonNegative,
|
|
60
60
|
}),
|
|
61
61
|
polar: PropTypes.bool,
|
|
62
62
|
radius: CustomPropTypes.nonNegative,
|
|
@@ -64,14 +64,14 @@ export class VictoryClipContainer extends React.Component<VictoryClipContainerPr
|
|
|
64
64
|
tabIndex: PropTypes.number,
|
|
65
65
|
transform: PropTypes.string,
|
|
66
66
|
translateX: PropTypes.number,
|
|
67
|
-
translateY: PropTypes.number
|
|
67
|
+
translateY: PropTypes.number,
|
|
68
68
|
};
|
|
69
69
|
|
|
70
70
|
static defaultProps = {
|
|
71
71
|
circleComponent: <Circle />,
|
|
72
72
|
rectComponent: <Rect />,
|
|
73
73
|
clipPathComponent: <ClipPath />,
|
|
74
|
-
groupComponent: <g
|
|
74
|
+
groupComponent: <g />,
|
|
75
75
|
};
|
|
76
76
|
private clipId: VictoryClipContainerProps["clipId"];
|
|
77
77
|
|
|
@@ -90,7 +90,7 @@ export class VictoryClipContainer extends React.Component<VictoryClipContainerPr
|
|
|
90
90
|
clipWidth = 0,
|
|
91
91
|
clipHeight = 0,
|
|
92
92
|
translateX = 0,
|
|
93
|
-
translateY = 0
|
|
93
|
+
translateY = 0,
|
|
94
94
|
} = props;
|
|
95
95
|
const clipPadding = Helpers.getPadding({ padding: props.clipPadding });
|
|
96
96
|
const radius = props.radius || Helpers.getRadius(props);
|
|
@@ -99,12 +99,12 @@ export class VictoryClipContainer extends React.Component<VictoryClipContainerPr
|
|
|
99
99
|
y: (polar ? origin.y : translateY) - clipPadding.top,
|
|
100
100
|
width: Math.max(
|
|
101
101
|
(polar ? radius : clipWidth) + clipPadding.left + clipPadding.right,
|
|
102
|
-
0
|
|
102
|
+
0,
|
|
103
103
|
),
|
|
104
104
|
height: Math.max(
|
|
105
105
|
(polar ? radius : clipHeight) + clipPadding.top + clipPadding.bottom,
|
|
106
|
-
0
|
|
107
|
-
)
|
|
106
|
+
0,
|
|
107
|
+
),
|
|
108
108
|
};
|
|
109
109
|
}
|
|
110
110
|
|
|
@@ -117,7 +117,7 @@ export class VictoryClipContainer extends React.Component<VictoryClipContainerPr
|
|
|
117
117
|
children,
|
|
118
118
|
className,
|
|
119
119
|
groupComponent,
|
|
120
|
-
tabIndex
|
|
120
|
+
tabIndex,
|
|
121
121
|
} = props;
|
|
122
122
|
const clipComponent = this.renderClipComponent(props, clipId);
|
|
123
123
|
const groupProps = assign(
|
|
@@ -126,14 +126,14 @@ export class VictoryClipContainer extends React.Component<VictoryClipContainerPr
|
|
|
126
126
|
style,
|
|
127
127
|
transform,
|
|
128
128
|
key: `clipped-group-${clipId}`,
|
|
129
|
-
clipPath: `url(#${clipId})
|
|
129
|
+
clipPath: `url(#${clipId})`,
|
|
130
130
|
},
|
|
131
|
-
events
|
|
131
|
+
events,
|
|
132
132
|
);
|
|
133
133
|
return React.cloneElement(
|
|
134
134
|
groupComponent,
|
|
135
135
|
{ ...groupProps, tabIndex, ...userProps },
|
|
136
|
-
[clipComponent, ...React.Children.toArray(children)]
|
|
136
|
+
[clipComponent, ...React.Children.toArray(children)],
|
|
137
137
|
);
|
|
138
138
|
}
|
|
139
139
|
|
|
@@ -145,7 +145,7 @@ export class VictoryClipContainer extends React.Component<VictoryClipContainerPr
|
|
|
145
145
|
children,
|
|
146
146
|
className,
|
|
147
147
|
groupComponent,
|
|
148
|
-
tabIndex
|
|
148
|
+
tabIndex,
|
|
149
149
|
} = props;
|
|
150
150
|
return React.cloneElement(
|
|
151
151
|
groupComponent,
|
|
@@ -155,11 +155,11 @@ export class VictoryClipContainer extends React.Component<VictoryClipContainerPr
|
|
|
155
155
|
style,
|
|
156
156
|
transform,
|
|
157
157
|
"aria-label": props["aria-label"],
|
|
158
|
-
tabIndex
|
|
158
|
+
tabIndex,
|
|
159
159
|
},
|
|
160
|
-
events
|
|
160
|
+
events,
|
|
161
161
|
),
|
|
162
|
-
children
|
|
162
|
+
children,
|
|
163
163
|
);
|
|
164
164
|
}
|
|
165
165
|
|
|
@@ -173,10 +173,10 @@ export class VictoryClipContainer extends React.Component<VictoryClipContainerPr
|
|
|
173
173
|
translateY = 0,
|
|
174
174
|
circleComponent,
|
|
175
175
|
rectComponent,
|
|
176
|
-
clipPathComponent
|
|
176
|
+
clipPathComponent,
|
|
177
177
|
} = props;
|
|
178
178
|
const { top, bottom, left, right } = Helpers.getPadding({
|
|
179
|
-
padding: props.clipPadding
|
|
179
|
+
padding: props.clipPadding,
|
|
180
180
|
});
|
|
181
181
|
let child;
|
|
182
182
|
if (polar) {
|
|
@@ -184,7 +184,7 @@ export class VictoryClipContainer extends React.Component<VictoryClipContainerPr
|
|
|
184
184
|
const circleProps = {
|
|
185
185
|
r: Math.max(radius + left + right, radius + top + bottom, 0),
|
|
186
186
|
cx: origin.x - left,
|
|
187
|
-
cy: origin.y - top
|
|
187
|
+
cy: origin.y - top,
|
|
188
188
|
};
|
|
189
189
|
child = React.cloneElement(circleComponent, circleProps);
|
|
190
190
|
} else {
|
|
@@ -192,7 +192,7 @@ export class VictoryClipContainer extends React.Component<VictoryClipContainerPr
|
|
|
192
192
|
x: translateX - left,
|
|
193
193
|
y: translateY - top,
|
|
194
194
|
width: Math.max(clipWidth + left + right, 0),
|
|
195
|
-
height: Math.max(clipHeight + top + bottom, 0)
|
|
195
|
+
height: Math.max(clipHeight + top + bottom, 0),
|
|
196
196
|
};
|
|
197
197
|
child = React.cloneElement(rectComponent, rectProps);
|
|
198
198
|
}
|
|
@@ -200,7 +200,7 @@ export class VictoryClipContainer extends React.Component<VictoryClipContainerPr
|
|
|
200
200
|
return React.cloneElement(
|
|
201
201
|
clipPathComponent,
|
|
202
202
|
assign({ key: `clip-path-${clipId}` }, props, { clipId }),
|
|
203
|
-
child
|
|
203
|
+
child,
|
|
204
204
|
);
|
|
205
205
|
}
|
|
206
206
|
|
|
@@ -233,7 +233,7 @@ export class VictoryClipContainer extends React.Component<VictoryClipContainerPr
|
|
|
233
233
|
clipHeight,
|
|
234
234
|
clipWidth,
|
|
235
235
|
translateX,
|
|
236
|
-
translateY
|
|
236
|
+
translateY,
|
|
237
237
|
});
|
|
238
238
|
return this.renderClippedGroup(clipProps, this.clipId);
|
|
239
239
|
}
|
|
@@ -8,8 +8,8 @@ import TimerContext from "../victory-util/timer-context";
|
|
|
8
8
|
import * as Helpers from "../victory-util/helpers";
|
|
9
9
|
import * as UserProps from "../victory-util/user-props";
|
|
10
10
|
import { OriginType } from "../victory-label/victory-label";
|
|
11
|
-
import { D3Scale } from "../
|
|
12
|
-
import { VictoryThemeDefinition } from "../victory-theme/
|
|
11
|
+
import { D3Scale } from "../types/prop-types";
|
|
12
|
+
import { VictoryThemeDefinition } from "../victory-theme/types";
|
|
13
13
|
|
|
14
14
|
export interface VictoryContainerProps {
|
|
15
15
|
"aria-describedby"?: string;
|
|
@@ -51,7 +51,7 @@ export class VictoryContainer extends React.Component<VictoryContainerProps> {
|
|
|
51
51
|
"aria-labelledby": PropTypes.string,
|
|
52
52
|
children: PropTypes.oneOfType([
|
|
53
53
|
PropTypes.arrayOf(PropTypes.node),
|
|
54
|
-
PropTypes.node
|
|
54
|
+
PropTypes.node,
|
|
55
55
|
]),
|
|
56
56
|
className: PropTypes.string,
|
|
57
57
|
containerId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
@@ -62,7 +62,7 @@ export class VictoryContainer extends React.Component<VictoryContainerProps> {
|
|
|
62
62
|
name: PropTypes.string,
|
|
63
63
|
origin: PropTypes.shape({
|
|
64
64
|
x: CustomPropTypes.nonNegative,
|
|
65
|
-
y: CustomPropTypes.nonNegative
|
|
65
|
+
y: CustomPropTypes.nonNegative,
|
|
66
66
|
}),
|
|
67
67
|
ouiaId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
68
68
|
ouiaSafe: PropTypes.bool,
|
|
@@ -77,7 +77,7 @@ export class VictoryContainer extends React.Component<VictoryContainerProps> {
|
|
|
77
77
|
tabIndex: PropTypes.number,
|
|
78
78
|
theme: PropTypes.object,
|
|
79
79
|
title: PropTypes.string,
|
|
80
|
-
width: CustomPropTypes.nonNegative
|
|
80
|
+
width: CustomPropTypes.nonNegative,
|
|
81
81
|
};
|
|
82
82
|
|
|
83
83
|
static defaultProps = {
|
|
@@ -85,7 +85,7 @@ export class VictoryContainer extends React.Component<VictoryContainerProps> {
|
|
|
85
85
|
portalComponent: <Portal />,
|
|
86
86
|
portalZIndex: 99,
|
|
87
87
|
responsive: true,
|
|
88
|
-
role: "img"
|
|
88
|
+
role: "img",
|
|
89
89
|
};
|
|
90
90
|
|
|
91
91
|
static contextType = TimerContext;
|
|
@@ -151,7 +151,7 @@ export class VictoryContainer extends React.Component<VictoryContainerProps> {
|
|
|
151
151
|
return {
|
|
152
152
|
...(ouiaId && { "data-ouia-component-id": ouiaId }),
|
|
153
153
|
...(ouiaType && { "data-ouia-component-type": ouiaType }),
|
|
154
|
-
...(ouiaSafe !== undefined && { "data-ouia-safe": ouiaSafe })
|
|
154
|
+
...(ouiaSafe !== undefined && { "data-ouia-safe": ouiaSafe }),
|
|
155
155
|
};
|
|
156
156
|
}
|
|
157
157
|
|
|
@@ -164,7 +164,7 @@ export class VictoryContainer extends React.Component<VictoryContainerProps> {
|
|
|
164
164
|
width,
|
|
165
165
|
height,
|
|
166
166
|
portalZIndex,
|
|
167
|
-
responsive
|
|
167
|
+
responsive,
|
|
168
168
|
} = props;
|
|
169
169
|
const children = this.getChildren(props);
|
|
170
170
|
const dimensions = responsive
|
|
@@ -174,13 +174,13 @@ export class VictoryContainer extends React.Component<VictoryContainerProps> {
|
|
|
174
174
|
{
|
|
175
175
|
pointerEvents: "none",
|
|
176
176
|
touchAction: "none",
|
|
177
|
-
position: "relative"
|
|
177
|
+
position: "relative",
|
|
178
178
|
} as const,
|
|
179
|
-
dimensions
|
|
179
|
+
dimensions,
|
|
180
180
|
);
|
|
181
181
|
const portalDivStyle = assign(
|
|
182
182
|
{ zIndex: portalZIndex, position: "absolute", top: 0, left: 0 } as const,
|
|
183
|
-
dimensions
|
|
183
|
+
dimensions,
|
|
184
184
|
);
|
|
185
185
|
const svgStyle = assign({ pointerEvents: "all" }, dimensions);
|
|
186
186
|
const portalSvgStyle = assign({ overflow: "visible" }, dimensions);
|
|
@@ -189,14 +189,14 @@ export class VictoryContainer extends React.Component<VictoryContainerProps> {
|
|
|
189
189
|
height,
|
|
190
190
|
viewBox: svgProps.viewBox,
|
|
191
191
|
preserveAspectRatio: svgProps.preserveAspectRatio,
|
|
192
|
-
style: portalSvgStyle
|
|
192
|
+
style: portalSvgStyle,
|
|
193
193
|
};
|
|
194
194
|
return (
|
|
195
195
|
<PortalContext.Provider
|
|
196
196
|
value={{
|
|
197
197
|
portalUpdate: this.portalUpdate,
|
|
198
198
|
portalRegister: this.portalRegister,
|
|
199
|
-
portalDeregister: this.portalDeregister
|
|
199
|
+
portalDeregister: this.portalDeregister,
|
|
200
200
|
}}
|
|
201
201
|
>
|
|
202
202
|
<div
|
|
@@ -217,7 +217,7 @@ export class VictoryContainer extends React.Component<VictoryContainerProps> {
|
|
|
217
217
|
<div style={portalDivStyle}>
|
|
218
218
|
{React.cloneElement(portalComponent, {
|
|
219
219
|
...portalProps,
|
|
220
|
-
ref: this.savePortalRef
|
|
220
|
+
ref: this.savePortalRef,
|
|
221
221
|
})}
|
|
222
222
|
</div>
|
|
223
223
|
</div>
|
|
@@ -235,12 +235,12 @@ export class VictoryContainer extends React.Component<VictoryContainerProps> {
|
|
|
235
235
|
desc,
|
|
236
236
|
tabIndex,
|
|
237
237
|
preserveAspectRatio,
|
|
238
|
-
role
|
|
238
|
+
role,
|
|
239
239
|
} = this.props;
|
|
240
240
|
|
|
241
241
|
const style = responsive
|
|
242
242
|
? this.props.style
|
|
243
|
-
: Helpers.omit(this.props.style
|
|
243
|
+
: Helpers.omit(this.props.style!, ["height", "width"]);
|
|
244
244
|
|
|
245
245
|
const userProps = UserProps.getSafeUserProps(this.props);
|
|
246
246
|
|
|
@@ -253,7 +253,7 @@ export class VictoryContainer extends React.Component<VictoryContainerProps> {
|
|
|
253
253
|
"aria-labelledby":
|
|
254
254
|
[
|
|
255
255
|
title && this.getIdForElement("title"),
|
|
256
|
-
this.props["aria-labelledby"]
|
|
256
|
+
this.props["aria-labelledby"],
|
|
257
257
|
]
|
|
258
258
|
.filter(Boolean)
|
|
259
259
|
.join(" ") || undefined,
|
|
@@ -263,9 +263,9 @@ export class VictoryContainer extends React.Component<VictoryContainerProps> {
|
|
|
263
263
|
.join(" ") || undefined,
|
|
264
264
|
viewBox: responsive ? `0 0 ${width} ${height}` : undefined,
|
|
265
265
|
preserveAspectRatio: responsive ? preserveAspectRatio : undefined,
|
|
266
|
-
...userProps
|
|
266
|
+
...userProps,
|
|
267
267
|
},
|
|
268
|
-
events
|
|
268
|
+
events,
|
|
269
269
|
);
|
|
270
270
|
return this.renderContainer(this.props, svgProps, style);
|
|
271
271
|
}
|