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
|
@@ -3,9 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
7
|
-
|
|
8
|
-
var _isObject2 = _interopRequireDefault(require("lodash/isObject"));
|
|
6
|
+
exports.VictoryTransition = void 0;
|
|
9
7
|
|
|
10
8
|
var _pick2 = _interopRequireDefault(require("lodash/pick"));
|
|
11
9
|
|
|
@@ -17,7 +15,7 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
17
15
|
|
|
18
16
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
19
17
|
|
|
20
|
-
var _victoryAnimation =
|
|
18
|
+
var _victoryAnimation = require("../victory-animation/victory-animation");
|
|
21
19
|
|
|
22
20
|
var Collection = _interopRequireWildcard(require("../victory-util/collection"));
|
|
23
21
|
|
|
@@ -35,7 +33,7 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
35
33
|
|
|
36
34
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
37
35
|
|
|
38
|
-
function _extends() { _extends = Object.assign
|
|
36
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
39
37
|
|
|
40
38
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
41
39
|
|
|
@@ -45,7 +43,7 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
|
|
|
45
43
|
|
|
46
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); }
|
|
47
45
|
|
|
48
|
-
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); }
|
|
49
47
|
|
|
50
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); }; }
|
|
51
49
|
|
|
@@ -55,9 +53,7 @@ function _assertThisInitialized(self) { if (self === void 0) { throw new Referen
|
|
|
55
53
|
|
|
56
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; } }
|
|
57
55
|
|
|
58
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
59
|
-
|
|
60
|
-
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); }
|
|
61
57
|
|
|
62
58
|
var VictoryTransition = /*#__PURE__*/function (_React$Component) {
|
|
63
59
|
_inherits(VictoryTransition, _React$Component);
|
|
@@ -70,6 +66,9 @@ var VictoryTransition = /*#__PURE__*/function (_React$Component) {
|
|
|
70
66
|
_classCallCheck(this, VictoryTransition);
|
|
71
67
|
|
|
72
68
|
_this = _super.call(this, props, context);
|
|
69
|
+
_this.continuous = void 0;
|
|
70
|
+
_this.timer = void 0;
|
|
71
|
+
_this.transitionProps = void 0;
|
|
73
72
|
_this.state = {
|
|
74
73
|
nodesShouldLoad: false,
|
|
75
74
|
nodesDoneLoad: false
|
|
@@ -77,7 +76,6 @@ var VictoryTransition = /*#__PURE__*/function (_React$Component) {
|
|
|
77
76
|
var child = _this.props.children;
|
|
78
77
|
var polar = child.props.polar;
|
|
79
78
|
_this.continuous = !polar && child.type && child.type.continuous === true;
|
|
80
|
-
_this.getTransitionState = _this.getTransitionState.bind(_assertThisInitialized(_this));
|
|
81
79
|
_this.timer = _this.context.transitionTimer;
|
|
82
80
|
return _this;
|
|
83
81
|
}
|
|
@@ -183,10 +181,12 @@ var VictoryTransition = /*#__PURE__*/function (_React$Component) {
|
|
|
183
181
|
}, {
|
|
184
182
|
key: "pickDomainProps",
|
|
185
183
|
value: function pickDomainProps(props) {
|
|
186
|
-
var
|
|
184
|
+
var _props$animate;
|
|
185
|
+
|
|
186
|
+
var parentState = (_props$animate = props.animate) === null || _props$animate === void 0 ? void 0 : _props$animate.parentState;
|
|
187
187
|
|
|
188
188
|
if (parentState && parentState.nodesWillExit) {
|
|
189
|
-
return this.
|
|
189
|
+
return this.continuous || parentState.continuous ? parentState.nextProps || this.state.nextProps || props : props;
|
|
190
190
|
}
|
|
191
191
|
|
|
192
192
|
return this.continuous && this.state.nodesWillExit ? this.state.nextProps || props : props;
|
|
@@ -205,10 +205,11 @@ var VictoryTransition = /*#__PURE__*/function (_React$Component) {
|
|
|
205
205
|
}, {
|
|
206
206
|
key: "render",
|
|
207
207
|
value: function render() {
|
|
208
|
-
var
|
|
208
|
+
var _this$props$animate,
|
|
209
|
+
_this3 = this;
|
|
209
210
|
|
|
210
211
|
var props = this.pickProps();
|
|
211
|
-
var getTransitionProps = (
|
|
212
|
+
var getTransitionProps = (_this$props$animate = this.props.animate) !== null && _this$props$animate !== void 0 && _this$props$animate.getTransitions ? this.props.animate.getTransitions : Transitions.getTransitionPropsFactory(props, this.state, function (newState) {
|
|
212
213
|
return _this3.setState(newState);
|
|
213
214
|
});
|
|
214
215
|
|
|
@@ -228,7 +229,7 @@ var VictoryTransition = /*#__PURE__*/function (_React$Component) {
|
|
|
228
229
|
var animationWhitelist = props.animationWhitelist || [];
|
|
229
230
|
var whitelist = animationWhitelist.concat(["clipWidth"]);
|
|
230
231
|
var propsToAnimate = whitelist.length ? (0, _pick2.default)(combinedProps, whitelist) : combinedProps;
|
|
231
|
-
return /*#__PURE__*/_react.default.createElement(_victoryAnimation.
|
|
232
|
+
return /*#__PURE__*/_react.default.createElement(_victoryAnimation.VictoryAnimation, _extends({}, combinedProps.animate, {
|
|
232
233
|
data: propsToAnimate
|
|
233
234
|
}), function (newProps) {
|
|
234
235
|
if (child.props.groupComponent) {
|
|
@@ -253,14 +254,12 @@ var VictoryTransition = /*#__PURE__*/function (_React$Component) {
|
|
|
253
254
|
return VictoryTransition;
|
|
254
255
|
}(_react.default.Component);
|
|
255
256
|
|
|
256
|
-
exports.
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
_defineProperty(VictoryTransition, "propTypes", {
|
|
257
|
+
exports.VictoryTransition = VictoryTransition;
|
|
258
|
+
VictoryTransition.displayName = "VictoryTransition";
|
|
259
|
+
VictoryTransition.propTypes = {
|
|
261
260
|
animate: _propTypes.default.oneOfType([_propTypes.default.bool, _propTypes.default.object]),
|
|
262
261
|
animationWhitelist: _propTypes.default.array,
|
|
263
262
|
children: _propTypes.default.node
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
|
|
263
|
+
};
|
|
264
|
+
VictoryTransition.contextType = _timerContext.default;
|
|
265
|
+
//# sourceMappingURL=victory-transition.js.map
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { ComponentEvent } from "./events";
|
|
3
|
+
import * as Events from "./events";
|
|
4
|
+
import { VictoryCommonProps, VictoryDatableProps } from "./common-props";
|
|
5
|
+
import { VictoryLabelableProps } from "../types/prop-types";
|
|
6
|
+
export declare type MixinOptions = {
|
|
7
|
+
components?: Array<{
|
|
8
|
+
name: string;
|
|
9
|
+
index?: string;
|
|
10
|
+
}>;
|
|
11
|
+
};
|
|
12
|
+
export interface EventMixinCommonProps extends VictoryCommonProps, VictoryDatableProps, VictoryLabelableProps {
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* These methods will be implemented by the Mixin,
|
|
16
|
+
* and are accessible to the Wrapped Component.
|
|
17
|
+
*
|
|
18
|
+
* To make your Wrapped Component type-safe, use "interface merging" like so:
|
|
19
|
+
* @example
|
|
20
|
+
* interface MyComponent extends EventsMixinClass<MyProps> {}
|
|
21
|
+
* class MyComponent extends React.Component<MyProps> { ... }
|
|
22
|
+
*/
|
|
23
|
+
export interface EventsMixinClass<TProps> {
|
|
24
|
+
renderContainer(component: React.ReactElement, children: React.ReactElement[]): React.ReactElement;
|
|
25
|
+
cacheValues<TThis>(this: TThis, obj: Partial<TThis>): void;
|
|
26
|
+
getEventState: typeof Events.getEventState;
|
|
27
|
+
renderContinuousData(props: TProps): any;
|
|
28
|
+
animateComponent(props: TProps, defaultAnimationWhitelist: any): any;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* These fields are calculated by the Mixin
|
|
32
|
+
*/
|
|
33
|
+
export interface EventMixinCalculatedValues {
|
|
34
|
+
componentEvents: Array<ComponentEvent>;
|
|
35
|
+
getSharedEventState: (key: string, value: string) => unknown;
|
|
36
|
+
baseProps: Record<string, object>;
|
|
37
|
+
dataKeys: string[];
|
|
38
|
+
hasEvents: unknown;
|
|
39
|
+
events: unknown;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* This represents the class itself, including static fields
|
|
43
|
+
*/
|
|
44
|
+
export interface WrappedComponentClass<TProps> {
|
|
45
|
+
new (props: TProps): React.Component<TProps>;
|
|
46
|
+
getBaseProps?(props: TProps): EventMixinCalculatedValues["baseProps"];
|
|
47
|
+
role?: string;
|
|
48
|
+
expectedComponents?: string[];
|
|
49
|
+
}
|
|
50
|
+
export declare function addEvents<TBase extends WrappedComponentClass<TProps>, TProps extends EventMixinCommonProps>(WrappedComponent: TBase, options?: MixinOptions): {
|
|
51
|
+
new (props: TProps): {
|
|
52
|
+
state: {};
|
|
53
|
+
getEventState: (eventKey: string | number, namespace: string, childType?: string | undefined) => any;
|
|
54
|
+
getScopedEvents: (events: any, namespace: any, childType: any, baseProps: any) => {};
|
|
55
|
+
getEvents: (p: any, target: any, eventKey: any) => any;
|
|
56
|
+
externalMutations: {} | undefined;
|
|
57
|
+
calculatedState: {};
|
|
58
|
+
globalEvents: {};
|
|
59
|
+
prevGlobalEventKeys: string[];
|
|
60
|
+
boundGlobalEvents: {};
|
|
61
|
+
shouldComponentUpdate(nextProps: TProps): boolean;
|
|
62
|
+
componentDidMount(): void;
|
|
63
|
+
componentDidUpdate(prevProps: any): void;
|
|
64
|
+
componentWillUnmount(): void;
|
|
65
|
+
addGlobalListener(key: any): void;
|
|
66
|
+
removeGlobalListener(key: any): void;
|
|
67
|
+
getStateChanges(props: any): {};
|
|
68
|
+
applyExternalMutations(props: any, externalMutations: any): void;
|
|
69
|
+
getCalculatedValues(props: any): EventMixinCalculatedValues;
|
|
70
|
+
getExternalMutations(props: TProps): {} | undefined;
|
|
71
|
+
cacheValues(obj: any): void;
|
|
72
|
+
getBaseProps(props: any, getSharedEventState: any): Record<string, object>;
|
|
73
|
+
getAllEvents(props: any): any;
|
|
74
|
+
getComponentProps(component: any, type: any, index: any): any;
|
|
75
|
+
renderContainer(component: any, children: any): React.DetailedReactHTMLElement<any, HTMLElement>;
|
|
76
|
+
animateComponent(props: TProps, defaultAnimationWhitelist: string[]): JSX.Element;
|
|
77
|
+
renderContinuousData(props: TProps): React.DetailedReactHTMLElement<any, HTMLElement>;
|
|
78
|
+
renderData(props: any, shouldRenderDatum?: (datum: any) => boolean): React.DetailedReactHTMLElement<any, HTMLElement>;
|
|
79
|
+
context: unknown;
|
|
80
|
+
setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<TProps>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
|
|
81
|
+
forceUpdate(callback?: (() => void) | undefined): void;
|
|
82
|
+
render(): React.ReactNode;
|
|
83
|
+
readonly props: Readonly<TProps>;
|
|
84
|
+
refs: {
|
|
85
|
+
[key: string]: React.ReactInstance;
|
|
86
|
+
};
|
|
87
|
+
componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
|
|
88
|
+
getSnapshotBeforeUpdate?(prevProps: Readonly<TProps>, prevState: Readonly<{}>): any;
|
|
89
|
+
componentWillMount?(): void;
|
|
90
|
+
UNSAFE_componentWillMount?(): void;
|
|
91
|
+
componentWillReceiveProps?(nextProps: Readonly<TProps>, nextContext: any): void;
|
|
92
|
+
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<TProps>, nextContext: any): void;
|
|
93
|
+
componentWillUpdate?(nextProps: Readonly<TProps>, nextState: Readonly<{}>, nextContext: any): void;
|
|
94
|
+
UNSAFE_componentWillUpdate?(nextProps: Readonly<TProps>, nextState: Readonly<{}>, nextContext: any): void;
|
|
95
|
+
componentEvents: ComponentEvent[];
|
|
96
|
+
getSharedEventState: (key: string, value: string) => unknown;
|
|
97
|
+
baseProps: Record<string, object>;
|
|
98
|
+
dataKeys: string[];
|
|
99
|
+
hasEvents: unknown;
|
|
100
|
+
events: unknown;
|
|
101
|
+
};
|
|
102
|
+
getBaseProps?(props: TProps): Record<string, object>;
|
|
103
|
+
role?: string | undefined;
|
|
104
|
+
expectedComponents?: string[] | undefined;
|
|
105
|
+
} & TBase;
|
|
106
|
+
//# sourceMappingURL=add-events.d.ts.map
|
|
@@ -3,33 +3,33 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
7
|
-
|
|
8
|
-
var _difference2 = _interopRequireDefault(require("lodash/difference"));
|
|
9
|
-
|
|
10
|
-
var _isNil2 = _interopRequireDefault(require("lodash/isNil"));
|
|
11
|
-
|
|
12
|
-
var _isEmpty2 = _interopRequireDefault(require("lodash/isEmpty"));
|
|
6
|
+
exports.addEvents = addEvents;
|
|
13
7
|
|
|
14
8
|
var _without2 = _interopRequireDefault(require("lodash/without"));
|
|
15
9
|
|
|
16
10
|
var _pick2 = _interopRequireDefault(require("lodash/pick"));
|
|
17
11
|
|
|
12
|
+
var _keys2 = _interopRequireDefault(require("lodash/keys"));
|
|
13
|
+
|
|
14
|
+
var _isNil2 = _interopRequireDefault(require("lodash/isNil"));
|
|
15
|
+
|
|
18
16
|
var _isFunction2 = _interopRequireDefault(require("lodash/isFunction"));
|
|
19
17
|
|
|
20
|
-
var
|
|
18
|
+
var _isEmpty2 = _interopRequireDefault(require("lodash/isEmpty"));
|
|
21
19
|
|
|
22
|
-
var
|
|
20
|
+
var _difference2 = _interopRequireDefault(require("lodash/difference"));
|
|
23
21
|
|
|
24
22
|
var _defaults2 = _interopRequireDefault(require("lodash/defaults"));
|
|
25
23
|
|
|
24
|
+
var _assign2 = _interopRequireDefault(require("lodash/assign"));
|
|
25
|
+
|
|
26
26
|
var _react = _interopRequireDefault(require("react"));
|
|
27
27
|
|
|
28
28
|
var Events = _interopRequireWildcard(require("./events"));
|
|
29
29
|
|
|
30
30
|
var _reactFastCompare = _interopRequireDefault(require("react-fast-compare"));
|
|
31
31
|
|
|
32
|
-
var _victoryTransition =
|
|
32
|
+
var _victoryTransition = require("../victory-transition/victory-transition");
|
|
33
33
|
|
|
34
34
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
35
35
|
|
|
@@ -57,7 +57,7 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
|
|
|
57
57
|
|
|
58
58
|
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); }
|
|
59
59
|
|
|
60
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf
|
|
60
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
61
61
|
|
|
62
62
|
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); }; }
|
|
63
63
|
|
|
@@ -67,8 +67,12 @@ function _assertThisInitialized(self) { if (self === void 0) { throw new Referen
|
|
|
67
67
|
|
|
68
68
|
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; } }
|
|
69
69
|
|
|
70
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
70
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
71
71
|
|
|
72
|
+
// DISCLAIMER:
|
|
73
|
+
// This file is not currently tested, and it is first on the list of files
|
|
74
|
+
// to refactor in our current refactoring effort. Please do not make changes
|
|
75
|
+
// to this file without manual testing and/or refactoring and adding tests.
|
|
72
76
|
var datumHasXandY = function (datum) {
|
|
73
77
|
return !(0, _isNil2.default)(datum._x) && !(0, _isNil2.default)(datum._y);
|
|
74
78
|
}; // used for checking state changes. Expected components can be passed in via options
|
|
@@ -83,44 +87,45 @@ var defaultComponents = [{
|
|
|
83
87
|
name: "labels"
|
|
84
88
|
}];
|
|
85
89
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
90
|
+
function addEvents(WrappedComponent) {
|
|
91
|
+
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
92
|
+
|
|
93
|
+
// @ts-expect-error "TS2545: A mixin class must have a constructor with a single rest parameter of type 'any[]'."
|
|
94
|
+
var AddEventsMixin = /*#__PURE__*/function (_WrappedComponent) {
|
|
95
|
+
_inherits(AddEventsMixin, _WrappedComponent);
|
|
89
96
|
|
|
90
|
-
var _super = _createSuper(
|
|
97
|
+
var _super = _createSuper(AddEventsMixin);
|
|
91
98
|
|
|
92
|
-
function
|
|
99
|
+
function AddEventsMixin(props) {
|
|
93
100
|
var _this;
|
|
94
101
|
|
|
95
|
-
_classCallCheck(this,
|
|
102
|
+
_classCallCheck(this, AddEventsMixin);
|
|
96
103
|
|
|
97
104
|
_this = _super.call(this, props);
|
|
98
|
-
var getScopedEvents = Events.getScopedEvents.bind(_assertThisInitialized(_this));
|
|
99
|
-
var boundGetEvents = Events.getEvents.bind(_assertThisInitialized(_this));
|
|
100
105
|
_this.state = {};
|
|
106
|
+
_this.getEventState = Events.getEventState.bind(_assertThisInitialized(_this));
|
|
107
|
+
_this.getScopedEvents = Events.getScopedEvents.bind(_assertThisInitialized(_this));
|
|
101
108
|
|
|
102
109
|
_this.getEvents = function (p, target, eventKey) {
|
|
103
|
-
return
|
|
110
|
+
return Events.getEvents.call(_assertThisInitialized(_this), p, target, eventKey, _this.getScopedEvents);
|
|
104
111
|
};
|
|
105
112
|
|
|
106
|
-
_this.
|
|
107
|
-
|
|
108
|
-
var calculatedValues = _this.getCalculatedValues(props);
|
|
109
|
-
|
|
110
|
-
_this.cacheValues(calculatedValues);
|
|
111
|
-
|
|
112
|
-
_this.externalMutations = _this.getExternalMutations(props);
|
|
113
|
-
_this.calculatedState = _this.getStateChanges(props);
|
|
113
|
+
_this.externalMutations = _this.getExternalMutations(_this.props);
|
|
114
|
+
_this.calculatedState = _this.getStateChanges(_this.props);
|
|
114
115
|
_this.globalEvents = {};
|
|
115
116
|
_this.prevGlobalEventKeys = [];
|
|
116
117
|
_this.boundGlobalEvents = {};
|
|
118
|
+
|
|
119
|
+
_this.cacheValues(_this.getCalculatedValues(props));
|
|
120
|
+
|
|
117
121
|
return _this;
|
|
118
122
|
}
|
|
119
123
|
|
|
120
|
-
_createClass(
|
|
124
|
+
_createClass(AddEventsMixin, [{
|
|
121
125
|
key: "shouldComponentUpdate",
|
|
122
126
|
value: function shouldComponentUpdate(nextProps) {
|
|
123
|
-
var externalMutations = this.getExternalMutations(nextProps);
|
|
127
|
+
var externalMutations = this.getExternalMutations(nextProps); // @ts-expect-error "Property 'animating' does not exist on type EventMixinCommonProps"
|
|
128
|
+
|
|
124
129
|
var animating = this.props.animating || this.props.animate;
|
|
125
130
|
var newMutation = !(0, _reactFastCompare.default)(externalMutations, this.externalMutations);
|
|
126
131
|
|
|
@@ -217,7 +222,6 @@ var _default = function _default(WrappedComponent, options) {
|
|
|
217
222
|
return (0, _isEmpty2.default)(result) ? undefined : result;
|
|
218
223
|
};
|
|
219
224
|
|
|
220
|
-
options = options || {};
|
|
221
225
|
var components = options.components || defaultComponents;
|
|
222
226
|
var stateChanges = components.map(function (component) {
|
|
223
227
|
if (!props.standalone && component.name === "parent") {
|
|
@@ -290,14 +294,14 @@ var _default = function _default(WrappedComponent, options) {
|
|
|
290
294
|
}, {
|
|
291
295
|
key: "getBaseProps",
|
|
292
296
|
value: function getBaseProps(props, getSharedEventState) {
|
|
293
|
-
getSharedEventState = getSharedEventState || this.getSharedEventState;
|
|
297
|
+
getSharedEventState = getSharedEventState || this.getSharedEventState.bind(this);
|
|
294
298
|
var sharedParentState = getSharedEventState("parent", "parent");
|
|
295
299
|
var parentState = this.getEventState("parent", "parent");
|
|
296
300
|
var baseParentProps = (0, _defaults2.default)({}, parentState, sharedParentState);
|
|
297
301
|
var parentPropsList = baseParentProps.parentControlledProps;
|
|
298
302
|
var parentProps = parentPropsList ? (0, _pick2.default)(baseParentProps, parentPropsList) : {};
|
|
299
303
|
var modifiedProps = (0, _defaults2.default)({}, parentProps, props);
|
|
300
|
-
return
|
|
304
|
+
return typeof WrappedComponent.getBaseProps === "function" ? WrappedComponent.getBaseProps(modifiedProps) : {};
|
|
301
305
|
}
|
|
302
306
|
}, {
|
|
303
307
|
key: "getAllEvents",
|
|
@@ -359,11 +363,14 @@ var _default = function _default(WrappedComponent, options) {
|
|
|
359
363
|
}, {
|
|
360
364
|
key: "animateComponent",
|
|
361
365
|
value: function animateComponent(props, defaultAnimationWhitelist) {
|
|
362
|
-
var
|
|
363
|
-
|
|
366
|
+
var _props$animate;
|
|
367
|
+
|
|
368
|
+
var animationWhitelist = typeof props.animate === "object" && ((_props$animate = props.animate) === null || _props$animate === void 0 ? void 0 : _props$animate.animationWhitelist) || defaultAnimationWhitelist;
|
|
369
|
+
var Comp = this.constructor;
|
|
370
|
+
return /*#__PURE__*/_react.default.createElement(_victoryTransition.VictoryTransition, {
|
|
364
371
|
animate: props.animate,
|
|
365
372
|
animationWhitelist: animationWhitelist
|
|
366
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
373
|
+
}, /*#__PURE__*/_react.default.createElement(Comp, props));
|
|
367
374
|
} // Used by `VictoryLine` and `VictoryArea`
|
|
368
375
|
|
|
369
376
|
}, {
|
|
@@ -420,8 +427,9 @@ var _default = function _default(WrappedComponent, options) {
|
|
|
420
427
|
}
|
|
421
428
|
}]);
|
|
422
429
|
|
|
423
|
-
return
|
|
430
|
+
return AddEventsMixin;
|
|
424
431
|
}(WrappedComponent);
|
|
425
|
-
};
|
|
426
432
|
|
|
427
|
-
|
|
433
|
+
return AddEventsMixin;
|
|
434
|
+
}
|
|
435
|
+
//# sourceMappingURL=add-events.js.map
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { D3Scale } from "../types/prop-types";
|
|
2
|
+
/**
|
|
3
|
+
* Returns the axis (x or y) of a particular axis component
|
|
4
|
+
* @param {Object} props: the props object.
|
|
5
|
+
* @param {Boolean} horizontal: true for horizontal charts
|
|
6
|
+
* @returns {String} the dimension appropriate for the axis given its props
|
|
7
|
+
*/
|
|
8
|
+
export declare function getAxis(props: any): "x" | "y";
|
|
9
|
+
/**
|
|
10
|
+
* Returns all axis components that pass a given predicate
|
|
11
|
+
* @param {Array} childComponents: an array of children
|
|
12
|
+
* @param {Function} predicate: a predicate function that will be called with each
|
|
13
|
+
* @returns {Array} all axis components that pass the given predicate or []
|
|
14
|
+
*/
|
|
15
|
+
export declare function findAxisComponents(childComponents: any, predicate?: any): any;
|
|
16
|
+
/**
|
|
17
|
+
* Returns a single axis component of the desired axis type (x or y)
|
|
18
|
+
* @param {Array} childComponents: an array of children
|
|
19
|
+
* @param {String} axis: desired axis either "x" or "y".
|
|
20
|
+
* @returns {ReactComponent} an axis component of the desired axis or undefined
|
|
21
|
+
*/
|
|
22
|
+
export declare function getAxisComponent(childComponents: any, axis: any): any;
|
|
23
|
+
/**
|
|
24
|
+
* Returns all axis components of the desired axis type (x or y) along with any
|
|
25
|
+
* parent components excluding VictoryChart
|
|
26
|
+
* @param {Array} childComponents: an optional array of children.
|
|
27
|
+
* @param {String} type: desired axis either "dependent" or "independent".
|
|
28
|
+
* @returns {ReactComponent} an axis component of the desired type or undefined
|
|
29
|
+
*/
|
|
30
|
+
export declare function getAxisComponentsWithParent(childComponents: any, type: any): any;
|
|
31
|
+
export declare function getOrigin(domain: any): {
|
|
32
|
+
x: number | Date;
|
|
33
|
+
y: number | Date;
|
|
34
|
+
};
|
|
35
|
+
export declare function getOriginSign(origin: any, domain: any): "positive" | "negative";
|
|
36
|
+
/**
|
|
37
|
+
* @param {Object} props: axis component props
|
|
38
|
+
* @returns {Boolean} true when the axis is vertical
|
|
39
|
+
*/
|
|
40
|
+
export declare function isVertical(props: any): any;
|
|
41
|
+
/**
|
|
42
|
+
* @param {Object} props: axis component props
|
|
43
|
+
* @returns {Boolean} true when tickValues contain strings
|
|
44
|
+
*/
|
|
45
|
+
export declare function stringTicks(props: any): boolean;
|
|
46
|
+
export declare function getTickFormat(props: any, scale: any): any;
|
|
47
|
+
export declare function getTicks(props: any, scale: D3Scale, filterZero?: boolean): number[];
|
|
48
|
+
export declare function getDomain(props: any, axis?: any): any;
|
|
49
|
+
export declare function getAxisValue(props: any, axis: any): any;
|
|
50
|
+
export declare function modifyProps(props: any, fallbackProps: any): any;
|
|
51
|
+
//# sourceMappingURL=axis.d.ts.map
|
package/lib/victory-util/axis.js
CHANGED
|
@@ -261,7 +261,7 @@ function getTickArray(props) {
|
|
|
261
261
|
}) : (0, _range2.default)(1, tickValues.length + 1);
|
|
262
262
|
}
|
|
263
263
|
|
|
264
|
-
var tickArray = ticks ? (0, _uniq2.default)(ticks) : getTicksFromFormat(
|
|
264
|
+
var tickArray = ticks ? (0, _uniq2.default)(ticks) : getTicksFromFormat();
|
|
265
265
|
|
|
266
266
|
var buildTickArray = function (arr) {
|
|
267
267
|
var newTickArray = [];
|
|
@@ -306,11 +306,11 @@ function getTickFormat(props, scale) {
|
|
|
306
306
|
return defaultTickFormat || scaleTickFormat;
|
|
307
307
|
} else if (tickFormat && Array.isArray(tickFormat)) {
|
|
308
308
|
var tickArray = getTickArray(props);
|
|
309
|
-
var tickArrayIndices = tickArray ? tickArray.map(function (v) {
|
|
309
|
+
var tickArrayIndices = tickArray === null || tickArray === void 0 ? void 0 : tickArray.map(function (v) {
|
|
310
310
|
return v.index;
|
|
311
|
-
})
|
|
311
|
+
});
|
|
312
312
|
var filteredTickFormat = tickFormat.filter(function (t, index) {
|
|
313
|
-
return tickArrayIndices.includes(index);
|
|
313
|
+
return tickArrayIndices === null || tickArrayIndices === void 0 ? void 0 : tickArrayIndices.includes(index);
|
|
314
314
|
});
|
|
315
315
|
return function (x, index) {
|
|
316
316
|
return filteredTickFormat[index];
|
|
@@ -343,7 +343,8 @@ function downsampleTicks(ticks, tickCount) {
|
|
|
343
343
|
});
|
|
344
344
|
}
|
|
345
345
|
|
|
346
|
-
function getTicks(props, scale
|
|
346
|
+
function getTicks(props, scale) {
|
|
347
|
+
var filterZero = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
347
348
|
var tickCount = props.tickCount;
|
|
348
349
|
var tickArray = getTickArray(props);
|
|
349
350
|
var tickValues = tickArray ? tickArray.map(function (v) {
|
|
@@ -466,4 +467,5 @@ function modifyProps(props, fallbackProps) {
|
|
|
466
467
|
return Helpers.modifyProps((0, _assign2.default)({}, props, {
|
|
467
468
|
theme: theme
|
|
468
469
|
}), fallbackProps, "axis");
|
|
469
|
-
}
|
|
470
|
+
}
|
|
471
|
+
//# sourceMappingURL=axis.js.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare function containsStrings<T>(collection: Array<T>): boolean;
|
|
2
|
+
export declare function containsDates(collection: Array<number | Date>): boolean;
|
|
3
|
+
export declare function containsNumbers(collection: any): boolean;
|
|
4
|
+
export declare function containsOnlyStrings(collection: any): any;
|
|
5
|
+
export declare function isArrayOfArrays(collection: any): any;
|
|
6
|
+
export declare function removeUndefined(arr: any): any;
|
|
7
|
+
export declare function getMaxValue(arr: Array<number | Date>, ...values: Array<number | Date>): number | Date;
|
|
8
|
+
export declare function getMinValue(arr: Array<number | Date>, ...values: Array<number | Date>): number | Date;
|
|
9
|
+
//# sourceMappingURL=collection.d.ts.map
|
|
@@ -24,9 +24,6 @@ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToAr
|
|
|
24
24
|
|
|
25
25
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
26
26
|
|
|
27
|
-
/* eslint-disable func-style */
|
|
28
|
-
|
|
29
|
-
/* eslint-disable no-use-before-define */
|
|
30
27
|
function isNonEmptyArray(collection) {
|
|
31
28
|
return Array.isArray(collection) && collection.length > 0;
|
|
32
29
|
}
|
|
@@ -71,7 +68,8 @@ function getMaxValue(arr) {
|
|
|
71
68
|
}
|
|
72
69
|
|
|
73
70
|
var array = arr.concat(values);
|
|
74
|
-
return containsDates(array) ? new Date(Math.max.apply(Math, _toConsumableArray(array)))
|
|
71
|
+
return containsDates(array) ? new Date(Math.max.apply(Math, _toConsumableArray(array))) // Dates will be coerced to numbers
|
|
72
|
+
: Math.max.apply(Math, _toConsumableArray(array));
|
|
75
73
|
}
|
|
76
74
|
|
|
77
75
|
function getMinValue(arr) {
|
|
@@ -80,5 +78,7 @@ function getMinValue(arr) {
|
|
|
80
78
|
}
|
|
81
79
|
|
|
82
80
|
var array = arr.concat(values);
|
|
83
|
-
return containsDates(array) ? new Date(Math.min.apply(Math, _toConsumableArray(array)))
|
|
84
|
-
|
|
81
|
+
return containsDates(array) ? new Date(Math.min.apply(Math, _toConsumableArray(array))) // Dates will be coerced to numbers
|
|
82
|
+
: Math.min.apply(Math, _toConsumableArray(array));
|
|
83
|
+
}
|
|
84
|
+
//# sourceMappingURL=collection.js.map
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { OriginType } from "../victory-label/victory-label";
|
|
3
|
+
import { PaddingProps, VictoryThemeDefinition } from "../victory-theme/types";
|
|
4
|
+
import { AnimatePropTypeInterface, CategoryPropType, ColorScalePropType, D3Scale, DataGetterPropType, DomainPaddingPropType, DomainPropType, EventCallbackInterface, RangePropType, ScalePropType, SortOrderPropType, StringOrNumberOrList } from "../types/prop-types";
|
|
5
|
+
import { NumberOrCallback, StringOrCallback } from "../types/callbacks";
|
|
6
|
+
export interface VictoryDatableProps {
|
|
7
|
+
categories?: CategoryPropType;
|
|
8
|
+
data?: readonly any[];
|
|
9
|
+
dataComponent?: React.ReactElement;
|
|
10
|
+
domain?: DomainPropType;
|
|
11
|
+
domainPadding?: DomainPaddingPropType;
|
|
12
|
+
samples?: number;
|
|
13
|
+
sortKey?: DataGetterPropType;
|
|
14
|
+
sortOrder?: SortOrderPropType;
|
|
15
|
+
x?: DataGetterPropType;
|
|
16
|
+
y?: DataGetterPropType;
|
|
17
|
+
y0?: DataGetterPropType;
|
|
18
|
+
}
|
|
19
|
+
export interface VictoryCommonThemeProps {
|
|
20
|
+
animate?: boolean | AnimatePropTypeInterface;
|
|
21
|
+
colorScale?: ColorScalePropType;
|
|
22
|
+
containerComponent?: React.ReactElement;
|
|
23
|
+
domainPadding?: DomainPaddingPropType;
|
|
24
|
+
externalEventMutations?: EventCallbackInterface<string | string[], StringOrNumberOrList>[];
|
|
25
|
+
groupComponent?: React.ReactElement;
|
|
26
|
+
height?: number;
|
|
27
|
+
horizontal?: boolean;
|
|
28
|
+
maxDomain?: number | {
|
|
29
|
+
x?: number;
|
|
30
|
+
y?: number;
|
|
31
|
+
};
|
|
32
|
+
minDomain?: number | {
|
|
33
|
+
x?: number;
|
|
34
|
+
y?: number;
|
|
35
|
+
};
|
|
36
|
+
name?: string;
|
|
37
|
+
origin?: OriginType;
|
|
38
|
+
padding?: PaddingProps;
|
|
39
|
+
polar?: boolean;
|
|
40
|
+
range?: RangePropType;
|
|
41
|
+
scale?: ScalePropType | D3Scale | {
|
|
42
|
+
x?: ScalePropType | D3Scale;
|
|
43
|
+
y?: ScalePropType | D3Scale;
|
|
44
|
+
};
|
|
45
|
+
sharedEvents?: {
|
|
46
|
+
events: any[];
|
|
47
|
+
getEventState: Function;
|
|
48
|
+
};
|
|
49
|
+
singleQuadrantDomainPadding?: boolean | {
|
|
50
|
+
x?: boolean;
|
|
51
|
+
y?: boolean;
|
|
52
|
+
};
|
|
53
|
+
standalone?: boolean;
|
|
54
|
+
width?: number;
|
|
55
|
+
}
|
|
56
|
+
export interface VictoryCommonProps extends VictoryCommonThemeProps {
|
|
57
|
+
theme?: VictoryThemeDefinition;
|
|
58
|
+
}
|
|
59
|
+
export interface VictoryCommonPrimitiveProps {
|
|
60
|
+
active?: boolean;
|
|
61
|
+
ariaLabel?: StringOrCallback;
|
|
62
|
+
className?: string;
|
|
63
|
+
clipPath?: string;
|
|
64
|
+
data?: any;
|
|
65
|
+
desc?: string | Function;
|
|
66
|
+
disableInlineStyles?: boolean;
|
|
67
|
+
events?: object;
|
|
68
|
+
id?: number | string | Function;
|
|
69
|
+
index?: number | string;
|
|
70
|
+
origin?: OriginType;
|
|
71
|
+
polar?: boolean;
|
|
72
|
+
role?: string;
|
|
73
|
+
scale?: any;
|
|
74
|
+
shapeRendering?: string;
|
|
75
|
+
style?: any;
|
|
76
|
+
tabIndex?: NumberOrCallback;
|
|
77
|
+
transform?: string;
|
|
78
|
+
}
|
|
79
|
+
export declare const CommonProps: {
|
|
80
|
+
dataProps: React.WeakValidationMap<VictoryDatableProps>;
|
|
81
|
+
baseProps: React.WeakValidationMap<VictoryCommonProps>;
|
|
82
|
+
primitiveProps: React.WeakValidationMap<VictoryCommonPrimitiveProps>;
|
|
83
|
+
};
|
|
84
|
+
//# sourceMappingURL=common-props.d.ts.map
|