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
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import _difference from "lodash/difference";
|
|
2
|
-
import _isNil from "lodash/isNil";
|
|
3
|
-
import _isEmpty from "lodash/isEmpty";
|
|
4
1
|
import _without from "lodash/without";
|
|
5
2
|
import _pick from "lodash/pick";
|
|
6
|
-
import _isFunction from "lodash/isFunction";
|
|
7
3
|
import _keys from "lodash/keys";
|
|
8
|
-
import
|
|
4
|
+
import _isNil from "lodash/isNil";
|
|
5
|
+
import _isFunction from "lodash/isFunction";
|
|
6
|
+
import _isEmpty from "lodash/isEmpty";
|
|
7
|
+
import _difference from "lodash/difference";
|
|
9
8
|
import _defaults from "lodash/defaults";
|
|
9
|
+
import _assign from "lodash/assign";
|
|
10
10
|
|
|
11
11
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
12
12
|
|
|
@@ -28,7 +28,7 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
|
|
|
28
28
|
|
|
29
29
|
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); }
|
|
30
30
|
|
|
31
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf
|
|
31
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
32
32
|
|
|
33
33
|
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); }; }
|
|
34
34
|
|
|
@@ -38,14 +38,18 @@ function _assertThisInitialized(self) { if (self === void 0) { throw new Referen
|
|
|
38
38
|
|
|
39
39
|
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; } }
|
|
40
40
|
|
|
41
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
41
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
42
42
|
|
|
43
43
|
/*global window:false */
|
|
44
44
|
import React from "react";
|
|
45
45
|
import * as Events from "./events";
|
|
46
46
|
import isEqual from "react-fast-compare";
|
|
47
|
-
import VictoryTransition from "../victory-transition/victory-transition";
|
|
47
|
+
import { VictoryTransition } from "../victory-transition/victory-transition";
|
|
48
48
|
|
|
49
|
+
// DISCLAIMER:
|
|
50
|
+
// This file is not currently tested, and it is first on the list of files
|
|
51
|
+
// to refactor in our current refactoring effort. Please do not make changes
|
|
52
|
+
// to this file without manual testing and/or refactoring and adding tests.
|
|
49
53
|
var datumHasXandY = function (datum) {
|
|
50
54
|
return !_isNil(datum._x) && !_isNil(datum._y);
|
|
51
55
|
}; // used for checking state changes. Expected components can be passed in via options
|
|
@@ -59,44 +63,45 @@ var defaultComponents = [{
|
|
|
59
63
|
}, {
|
|
60
64
|
name: "labels"
|
|
61
65
|
}];
|
|
62
|
-
export
|
|
63
|
-
|
|
64
|
-
|
|
66
|
+
export function addEvents(WrappedComponent) {
|
|
67
|
+
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
68
|
+
|
|
69
|
+
// @ts-expect-error "TS2545: A mixin class must have a constructor with a single rest parameter of type 'any[]'."
|
|
70
|
+
var AddEventsMixin = /*#__PURE__*/function (_WrappedComponent) {
|
|
71
|
+
_inherits(AddEventsMixin, _WrappedComponent);
|
|
65
72
|
|
|
66
|
-
var _super = _createSuper(
|
|
73
|
+
var _super = _createSuper(AddEventsMixin);
|
|
67
74
|
|
|
68
|
-
function
|
|
75
|
+
function AddEventsMixin(props) {
|
|
69
76
|
var _this;
|
|
70
77
|
|
|
71
|
-
_classCallCheck(this,
|
|
78
|
+
_classCallCheck(this, AddEventsMixin);
|
|
72
79
|
|
|
73
80
|
_this = _super.call(this, props);
|
|
74
|
-
var getScopedEvents = Events.getScopedEvents.bind(_assertThisInitialized(_this));
|
|
75
|
-
var boundGetEvents = Events.getEvents.bind(_assertThisInitialized(_this));
|
|
76
81
|
_this.state = {};
|
|
82
|
+
_this.getEventState = Events.getEventState.bind(_assertThisInitialized(_this));
|
|
83
|
+
_this.getScopedEvents = Events.getScopedEvents.bind(_assertThisInitialized(_this));
|
|
77
84
|
|
|
78
85
|
_this.getEvents = function (p, target, eventKey) {
|
|
79
|
-
return
|
|
86
|
+
return Events.getEvents.call(_assertThisInitialized(_this), p, target, eventKey, _this.getScopedEvents);
|
|
80
87
|
};
|
|
81
88
|
|
|
82
|
-
_this.
|
|
83
|
-
|
|
84
|
-
var calculatedValues = _this.getCalculatedValues(props);
|
|
85
|
-
|
|
86
|
-
_this.cacheValues(calculatedValues);
|
|
87
|
-
|
|
88
|
-
_this.externalMutations = _this.getExternalMutations(props);
|
|
89
|
-
_this.calculatedState = _this.getStateChanges(props);
|
|
89
|
+
_this.externalMutations = _this.getExternalMutations(_this.props);
|
|
90
|
+
_this.calculatedState = _this.getStateChanges(_this.props);
|
|
90
91
|
_this.globalEvents = {};
|
|
91
92
|
_this.prevGlobalEventKeys = [];
|
|
92
93
|
_this.boundGlobalEvents = {};
|
|
94
|
+
|
|
95
|
+
_this.cacheValues(_this.getCalculatedValues(props));
|
|
96
|
+
|
|
93
97
|
return _this;
|
|
94
98
|
}
|
|
95
99
|
|
|
96
|
-
_createClass(
|
|
100
|
+
_createClass(AddEventsMixin, [{
|
|
97
101
|
key: "shouldComponentUpdate",
|
|
98
102
|
value: function shouldComponentUpdate(nextProps) {
|
|
99
|
-
var externalMutations = this.getExternalMutations(nextProps);
|
|
103
|
+
var externalMutations = this.getExternalMutations(nextProps); // @ts-expect-error "Property 'animating' does not exist on type EventMixinCommonProps"
|
|
104
|
+
|
|
100
105
|
var animating = this.props.animating || this.props.animate;
|
|
101
106
|
var newMutation = !isEqual(externalMutations, this.externalMutations);
|
|
102
107
|
|
|
@@ -200,7 +205,6 @@ export default (function (WrappedComponent, options) {
|
|
|
200
205
|
return _isEmpty(result) ? undefined : result;
|
|
201
206
|
};
|
|
202
207
|
|
|
203
|
-
options = options || {};
|
|
204
208
|
var components = options.components || defaultComponents;
|
|
205
209
|
var stateChanges = components.map(function (component) {
|
|
206
210
|
if (!props.standalone && component.name === "parent") {
|
|
@@ -275,7 +279,7 @@ export default (function (WrappedComponent, options) {
|
|
|
275
279
|
}, {
|
|
276
280
|
key: "getBaseProps",
|
|
277
281
|
value: function getBaseProps(props, getSharedEventState) {
|
|
278
|
-
getSharedEventState = getSharedEventState || this.getSharedEventState;
|
|
282
|
+
getSharedEventState = getSharedEventState || this.getSharedEventState.bind(this);
|
|
279
283
|
var sharedParentState = getSharedEventState("parent", "parent");
|
|
280
284
|
var parentState = this.getEventState("parent", "parent");
|
|
281
285
|
|
|
@@ -286,7 +290,7 @@ export default (function (WrappedComponent, options) {
|
|
|
286
290
|
|
|
287
291
|
var modifiedProps = _defaults({}, parentProps, props);
|
|
288
292
|
|
|
289
|
-
return
|
|
293
|
+
return typeof WrappedComponent.getBaseProps === "function" ? WrappedComponent.getBaseProps(modifiedProps) : {};
|
|
290
294
|
}
|
|
291
295
|
}, {
|
|
292
296
|
key: "getAllEvents",
|
|
@@ -351,11 +355,14 @@ export default (function (WrappedComponent, options) {
|
|
|
351
355
|
}, {
|
|
352
356
|
key: "animateComponent",
|
|
353
357
|
value: function animateComponent(props, defaultAnimationWhitelist) {
|
|
354
|
-
var
|
|
358
|
+
var _props$animate;
|
|
359
|
+
|
|
360
|
+
var animationWhitelist = typeof props.animate === "object" && ((_props$animate = props.animate) === null || _props$animate === void 0 ? void 0 : _props$animate.animationWhitelist) || defaultAnimationWhitelist;
|
|
361
|
+
var Comp = this.constructor;
|
|
355
362
|
return /*#__PURE__*/React.createElement(VictoryTransition, {
|
|
356
363
|
animate: props.animate,
|
|
357
364
|
animationWhitelist: animationWhitelist
|
|
358
|
-
}, /*#__PURE__*/React.createElement(
|
|
365
|
+
}, /*#__PURE__*/React.createElement(Comp, props));
|
|
359
366
|
} // Used by `VictoryLine` and `VictoryArea`
|
|
360
367
|
|
|
361
368
|
}, {
|
|
@@ -414,6 +421,9 @@ export default (function (WrappedComponent, options) {
|
|
|
414
421
|
}
|
|
415
422
|
}]);
|
|
416
423
|
|
|
417
|
-
return
|
|
424
|
+
return AddEventsMixin;
|
|
418
425
|
}(WrappedComponent);
|
|
419
|
-
|
|
426
|
+
|
|
427
|
+
return AddEventsMixin;
|
|
428
|
+
}
|
|
429
|
+
//# 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/es/victory-util/axis.js
CHANGED
|
@@ -23,18 +23,17 @@ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToAr
|
|
|
23
23
|
|
|
24
24
|
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; }
|
|
25
25
|
|
|
26
|
-
/* eslint-disable func-style */
|
|
27
26
|
import React from "react";
|
|
28
27
|
import * as Collection from "./collection";
|
|
29
28
|
import * as Domain from "./domain";
|
|
30
29
|
import * as Helpers from "./helpers";
|
|
30
|
+
|
|
31
31
|
/**
|
|
32
32
|
* Returns the axis (x or y) of a particular axis component
|
|
33
33
|
* @param {Object} props: the props object.
|
|
34
34
|
* @param {Boolean} horizontal: true for horizontal charts
|
|
35
35
|
* @returns {String} the dimension appropriate for the axis given its props
|
|
36
36
|
*/
|
|
37
|
-
|
|
38
37
|
export function getAxis(props) {
|
|
39
38
|
var dependentAxis = props.dependentAxis;
|
|
40
39
|
return dependentAxis ? "y" : "x";
|
|
@@ -220,7 +219,7 @@ function getTickArray(props) {
|
|
|
220
219
|
}) : _range(1, tickValues.length + 1);
|
|
221
220
|
}
|
|
222
221
|
|
|
223
|
-
var tickArray = ticks ? _uniq(ticks) : getTicksFromFormat(
|
|
222
|
+
var tickArray = ticks ? _uniq(ticks) : getTicksFromFormat();
|
|
224
223
|
|
|
225
224
|
var buildTickArray = function (arr) {
|
|
226
225
|
var newTickArray = [];
|
|
@@ -265,11 +264,11 @@ export function getTickFormat(props, scale) {
|
|
|
265
264
|
return defaultTickFormat || scaleTickFormat;
|
|
266
265
|
} else if (tickFormat && Array.isArray(tickFormat)) {
|
|
267
266
|
var tickArray = getTickArray(props);
|
|
268
|
-
var tickArrayIndices = tickArray ? tickArray.map(function (v) {
|
|
267
|
+
var tickArrayIndices = tickArray === null || tickArray === void 0 ? void 0 : tickArray.map(function (v) {
|
|
269
268
|
return v.index;
|
|
270
|
-
})
|
|
269
|
+
});
|
|
271
270
|
var filteredTickFormat = tickFormat.filter(function (t, index) {
|
|
272
|
-
return tickArrayIndices.includes(index);
|
|
271
|
+
return tickArrayIndices === null || tickArrayIndices === void 0 ? void 0 : tickArrayIndices.includes(index);
|
|
273
272
|
});
|
|
274
273
|
return function (x, index) {
|
|
275
274
|
return filteredTickFormat[index];
|
|
@@ -303,7 +302,8 @@ function downsampleTicks(ticks, tickCount) {
|
|
|
303
302
|
});
|
|
304
303
|
}
|
|
305
304
|
|
|
306
|
-
export function getTicks(props, scale
|
|
305
|
+
export function getTicks(props, scale) {
|
|
306
|
+
var filterZero = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
307
307
|
var tickCount = props.tickCount;
|
|
308
308
|
var tickArray = getTickArray(props);
|
|
309
309
|
var tickValues = tickArray ? tickArray.map(function (v) {
|
|
@@ -425,4 +425,5 @@ export function modifyProps(props, fallbackProps) {
|
|
|
425
425
|
return Helpers.modifyProps(_assign({}, props, {
|
|
426
426
|
theme: theme
|
|
427
427
|
}), fallbackProps, "axis");
|
|
428
|
-
}
|
|
428
|
+
}
|
|
429
|
+
//# 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
|
|
@@ -10,9 +10,6 @@ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToAr
|
|
|
10
10
|
|
|
11
11
|
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; }
|
|
12
12
|
|
|
13
|
-
/* eslint-disable func-style */
|
|
14
|
-
|
|
15
|
-
/* eslint-disable no-use-before-define */
|
|
16
13
|
function isNonEmptyArray(collection) {
|
|
17
14
|
return Array.isArray(collection) && collection.length > 0;
|
|
18
15
|
}
|
|
@@ -51,7 +48,8 @@ export function getMaxValue(arr) {
|
|
|
51
48
|
}
|
|
52
49
|
|
|
53
50
|
var array = arr.concat(values);
|
|
54
|
-
return containsDates(array) ? new Date(Math.max.apply(Math, _toConsumableArray(array)))
|
|
51
|
+
return containsDates(array) ? new Date(Math.max.apply(Math, _toConsumableArray(array))) // Dates will be coerced to numbers
|
|
52
|
+
: Math.max.apply(Math, _toConsumableArray(array));
|
|
55
53
|
}
|
|
56
54
|
export function getMinValue(arr) {
|
|
57
55
|
for (var _len2 = arguments.length, values = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
|
@@ -59,5 +57,7 @@ export function getMinValue(arr) {
|
|
|
59
57
|
}
|
|
60
58
|
|
|
61
59
|
var array = arr.concat(values);
|
|
62
|
-
return containsDates(array) ? new Date(Math.min.apply(Math, _toConsumableArray(array)))
|
|
63
|
-
|
|
60
|
+
return containsDates(array) ? new Date(Math.min.apply(Math, _toConsumableArray(array))) // Dates will be coerced to numbers
|
|
61
|
+
: Math.min.apply(Math, _toConsumableArray(array));
|
|
62
|
+
}
|
|
63
|
+
//# 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
|
|
@@ -1,42 +1,47 @@
|
|
|
1
1
|
import PropTypes from "prop-types";
|
|
2
2
|
import * as CustomPropTypes from "./prop-types";
|
|
3
|
-
|
|
3
|
+
var dataProps = {
|
|
4
|
+
// @ts-expect-error TODO: synchronize the type with this PropTypes
|
|
4
5
|
categories: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.string), PropTypes.shape({
|
|
5
6
|
x: PropTypes.arrayOf(PropTypes.string),
|
|
6
7
|
y: PropTypes.arrayOf(PropTypes.string)
|
|
7
8
|
})]),
|
|
9
|
+
// @ts-expect-error TODO: synchronize the type with this PropTypes
|
|
8
10
|
data: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),
|
|
9
11
|
dataComponent: PropTypes.element,
|
|
10
12
|
disableInlineStyles: PropTypes.bool,
|
|
11
13
|
labelComponent: PropTypes.element,
|
|
12
14
|
labels: PropTypes.oneOfType([PropTypes.func, PropTypes.array]),
|
|
13
15
|
samples: CustomPropTypes.nonNegative,
|
|
14
|
-
sortKey: PropTypes.oneOfType([PropTypes.func, CustomPropTypes.allOfType([CustomPropTypes.integer, CustomPropTypes.nonNegative]), PropTypes.string, PropTypes.arrayOf(PropTypes.string)]),
|
|
16
|
+
sortKey: PropTypes.oneOfType([PropTypes.func, CustomPropTypes.allOfType([CustomPropTypes.integer, CustomPropTypes.nonNegative]), PropTypes.string, PropTypes.arrayOf(PropTypes.string.isRequired)]),
|
|
15
17
|
sortOrder: PropTypes.oneOf(["ascending", "descending"]),
|
|
16
18
|
style: PropTypes.shape({
|
|
17
19
|
parent: PropTypes.object,
|
|
18
20
|
data: PropTypes.object,
|
|
19
21
|
labels: PropTypes.object
|
|
20
22
|
}),
|
|
21
|
-
x: PropTypes.oneOfType([PropTypes.func, CustomPropTypes.allOfType([CustomPropTypes.integer, CustomPropTypes.nonNegative]), PropTypes.string, PropTypes.arrayOf(PropTypes.string)]),
|
|
22
|
-
y: PropTypes.oneOfType([PropTypes.func, CustomPropTypes.allOfType([CustomPropTypes.integer, CustomPropTypes.nonNegative]), PropTypes.string, PropTypes.arrayOf(PropTypes.string)]),
|
|
23
|
-
y0: PropTypes.oneOfType([PropTypes.func, CustomPropTypes.allOfType([CustomPropTypes.integer, CustomPropTypes.nonNegative]), PropTypes.string, PropTypes.arrayOf(PropTypes.string)])
|
|
23
|
+
x: PropTypes.oneOfType([PropTypes.func, CustomPropTypes.allOfType([CustomPropTypes.integer, CustomPropTypes.nonNegative]), PropTypes.string, PropTypes.arrayOf(PropTypes.string.isRequired)]),
|
|
24
|
+
y: PropTypes.oneOfType([PropTypes.func, CustomPropTypes.allOfType([CustomPropTypes.integer, CustomPropTypes.nonNegative]), PropTypes.string, PropTypes.arrayOf(PropTypes.string.isRequired)]),
|
|
25
|
+
y0: PropTypes.oneOfType([PropTypes.func, CustomPropTypes.allOfType([CustomPropTypes.integer, CustomPropTypes.nonNegative]), PropTypes.string, PropTypes.arrayOf(PropTypes.string.isRequired)])
|
|
24
26
|
};
|
|
25
|
-
|
|
27
|
+
var baseProps = {
|
|
26
28
|
animate: PropTypes.oneOfType([PropTypes.bool, PropTypes.object]),
|
|
27
29
|
containerComponent: PropTypes.element,
|
|
28
30
|
domain: PropTypes.oneOfType([CustomPropTypes.domain, PropTypes.shape({
|
|
29
31
|
x: CustomPropTypes.domain,
|
|
30
32
|
y: CustomPropTypes.domain
|
|
31
33
|
})]),
|
|
34
|
+
// @ts-expect-error TODO: synchronize the type with this PropTypes
|
|
32
35
|
maxDomain: PropTypes.oneOfType([PropTypes.number, PropTypes.instanceOf(Date), PropTypes.shape({
|
|
33
36
|
x: PropTypes.oneOfType([PropTypes.number, PropTypes.instanceOf(Date)]),
|
|
34
37
|
y: PropTypes.oneOfType([PropTypes.number, PropTypes.instanceOf(Date)])
|
|
35
38
|
})]),
|
|
39
|
+
// @ts-expect-error TODO: synchronize the type with this PropTypes
|
|
36
40
|
minDomain: PropTypes.oneOfType([PropTypes.number, PropTypes.instanceOf(Date), PropTypes.shape({
|
|
37
41
|
x: PropTypes.oneOfType([PropTypes.number, PropTypes.instanceOf(Date)]),
|
|
38
42
|
y: PropTypes.oneOfType([PropTypes.number, PropTypes.instanceOf(Date)])
|
|
39
43
|
})]),
|
|
44
|
+
// @ts-expect-error TODO: synchronize the type with this PropTypes
|
|
40
45
|
domainPadding: PropTypes.oneOfType([PropTypes.shape({
|
|
41
46
|
x: PropTypes.oneOfType([PropTypes.number, PropTypes.arrayOf(PropTypes.number)]),
|
|
42
47
|
y: PropTypes.oneOfType([PropTypes.number, PropTypes.arrayOf(PropTypes.number)])
|
|
@@ -47,6 +52,7 @@ export var baseProps = {
|
|
|
47
52
|
eventKey: PropTypes.oneOfType([PropTypes.array, CustomPropTypes.allOfType([CustomPropTypes.integer, CustomPropTypes.nonNegative]), PropTypes.string]),
|
|
48
53
|
eventHandlers: PropTypes.object
|
|
49
54
|
})),
|
|
55
|
+
// @ts-expect-error TODO: synchronize the type with this PropTypes
|
|
50
56
|
externalEventMutations: PropTypes.arrayOf(PropTypes.shape({
|
|
51
57
|
callback: PropTypes.func,
|
|
52
58
|
childName: PropTypes.oneOfType([PropTypes.string, PropTypes.array]),
|
|
@@ -57,10 +63,12 @@ export var baseProps = {
|
|
|
57
63
|
groupComponent: PropTypes.element,
|
|
58
64
|
height: CustomPropTypes.nonNegative,
|
|
59
65
|
name: PropTypes.string,
|
|
66
|
+
// @ts-expect-error TODO: synchronize the type with this PropTypes
|
|
60
67
|
origin: PropTypes.shape({
|
|
61
68
|
x: PropTypes.number,
|
|
62
69
|
y: PropTypes.number
|
|
63
70
|
}),
|
|
71
|
+
// @ts-expect-error TODO: synchronize the type with this PropTypes
|
|
64
72
|
padding: PropTypes.oneOfType([PropTypes.number, PropTypes.shape({
|
|
65
73
|
top: PropTypes.number,
|
|
66
74
|
bottom: PropTypes.number,
|
|
@@ -69,17 +77,19 @@ export var baseProps = {
|
|
|
69
77
|
})]),
|
|
70
78
|
polar: PropTypes.bool,
|
|
71
79
|
range: PropTypes.oneOfType([CustomPropTypes.domain, PropTypes.shape({
|
|
72
|
-
x: CustomPropTypes.domain,
|
|
73
|
-
y: CustomPropTypes.domain
|
|
80
|
+
x: CustomPropTypes.domain.isRequired,
|
|
81
|
+
y: CustomPropTypes.domain.isRequired
|
|
74
82
|
})]),
|
|
75
83
|
scale: PropTypes.oneOfType([CustomPropTypes.scale, PropTypes.shape({
|
|
76
|
-
x: CustomPropTypes.scale,
|
|
77
|
-
y: CustomPropTypes.scale
|
|
84
|
+
x: CustomPropTypes.scale.isRequired,
|
|
85
|
+
y: CustomPropTypes.scale.isRequired
|
|
78
86
|
})]),
|
|
87
|
+
// @ts-expect-error TODO: synchronize the type with this PropTypes
|
|
79
88
|
sharedEvents: PropTypes.shape({
|
|
80
89
|
events: PropTypes.array,
|
|
81
90
|
getEventState: PropTypes.func
|
|
82
91
|
}),
|
|
92
|
+
// @ts-expect-error TODO: synchronize the type with this PropTypes
|
|
83
93
|
singleQuadrantDomainPadding: PropTypes.oneOfType([PropTypes.bool, PropTypes.shape({
|
|
84
94
|
x: PropTypes.oneOfType([PropTypes.bool]),
|
|
85
95
|
y: PropTypes.oneOfType([PropTypes.bool])
|
|
@@ -88,7 +98,7 @@ export var baseProps = {
|
|
|
88
98
|
theme: PropTypes.object,
|
|
89
99
|
width: CustomPropTypes.nonNegative
|
|
90
100
|
};
|
|
91
|
-
|
|
101
|
+
var primitiveProps = {
|
|
92
102
|
active: PropTypes.bool,
|
|
93
103
|
ariaLabel: PropTypes.oneOfType([PropTypes.string, PropTypes.func]),
|
|
94
104
|
className: PropTypes.string,
|
|
@@ -99,6 +109,7 @@ export var primitiveProps = {
|
|
|
99
109
|
events: PropTypes.object,
|
|
100
110
|
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string, PropTypes.func]),
|
|
101
111
|
index: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
112
|
+
// @ts-expect-error TODO: synchronize the type with this PropTypes
|
|
102
113
|
origin: PropTypes.shape({
|
|
103
114
|
x: PropTypes.number,
|
|
104
115
|
y: PropTypes.number
|
|
@@ -113,4 +124,10 @@ export var primitiveProps = {
|
|
|
113
124
|
style: PropTypes.object,
|
|
114
125
|
tabIndex: PropTypes.oneOfType([PropTypes.number, PropTypes.func]),
|
|
115
126
|
transform: PropTypes.string
|
|
116
|
-
};
|
|
127
|
+
};
|
|
128
|
+
export var CommonProps = {
|
|
129
|
+
dataProps: dataProps,
|
|
130
|
+
baseProps: baseProps,
|
|
131
|
+
primitiveProps: primitiveProps
|
|
132
|
+
};
|
|
133
|
+
//# sourceMappingURL=common-props.js.map
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
export declare function formatDataFromDomain(dataset: any, domain: any, defaultBaseline: any): any;
|
|
2
|
+
/**
|
|
3
|
+
* Returns an object mapping string data to numeric data
|
|
4
|
+
* @param {Object} props: the props object
|
|
5
|
+
* @param {String} axis: the current axis
|
|
6
|
+
* @returns {Object} an object mapping string data to numeric data
|
|
7
|
+
*/
|
|
8
|
+
export declare function createStringMap(props: any, axis: any): any;
|
|
9
|
+
/**
|
|
10
|
+
* Reduces the size of a data array, such that it is <= maxPoints.
|
|
11
|
+
* @param {Array} data: an array of data; must be sorted
|
|
12
|
+
* @param {Number} maxPoints: maximum number of data points to return
|
|
13
|
+
* @param {Number} startingIndex: the index of the data[0] *in the entire dataset*; this function
|
|
14
|
+
assumes `data` param is a subset of larger dataset that has been zoommed
|
|
15
|
+
* @returns {Array} an array of data, a subset of data param
|
|
16
|
+
*/
|
|
17
|
+
export declare function downsample(data: any, maxPoints: any, startingIndex?: number): any;
|
|
18
|
+
/**
|
|
19
|
+
* Returns formatted data. Data accessors are applied, and string values are replaced.
|
|
20
|
+
* @param {Array} dataset: the original domain
|
|
21
|
+
* @param {Object} props: the props object
|
|
22
|
+
* @param {Array} expectedKeys: an array of expected data keys
|
|
23
|
+
* @returns {Array} the formatted data
|
|
24
|
+
*/
|
|
25
|
+
export declare function formatData(dataset: any[], props: any, expectedKeys?: string[]): any;
|
|
26
|
+
/**
|
|
27
|
+
* Returns generated x and y data based on domain and sample from props
|
|
28
|
+
* @param {Object} props: the props object
|
|
29
|
+
* @returns {Array} an array of data
|
|
30
|
+
*/
|
|
31
|
+
export declare function generateData(props: any): {
|
|
32
|
+
x: number;
|
|
33
|
+
y: number;
|
|
34
|
+
}[];
|
|
35
|
+
/**
|
|
36
|
+
* Returns an array of categories for a given axis
|
|
37
|
+
* @param {Object} props: the props object
|
|
38
|
+
* @param {String} axis: the current axis
|
|
39
|
+
* @returns {Array} an array of categories
|
|
40
|
+
*/
|
|
41
|
+
export declare function getCategories(props: any, axis: any): any;
|
|
42
|
+
/**
|
|
43
|
+
* Returns an array of formatted data
|
|
44
|
+
* @param {Object} props: the props object
|
|
45
|
+
* @returns {Array} an array of data
|
|
46
|
+
*/
|
|
47
|
+
export declare function getData(props: any): any;
|
|
48
|
+
/**
|
|
49
|
+
* Returns an array of strings from axis tickValues for a given axis
|
|
50
|
+
* @param {Object} props: the props object
|
|
51
|
+
* @param {String} axis: the current axis
|
|
52
|
+
* @returns {Array} an array of strings
|
|
53
|
+
*/
|
|
54
|
+
export declare function getStringsFromAxes(props: any, axis: any): any;
|
|
55
|
+
/**
|
|
56
|
+
* Returns an array of strings from categories for a given axis
|
|
57
|
+
* @param {Object} props: the props object
|
|
58
|
+
* @param {String} axis: the current axis
|
|
59
|
+
* @returns {Array} an array of strings
|
|
60
|
+
*/
|
|
61
|
+
export declare function getStringsFromCategories(props: any, axis: any): any;
|
|
62
|
+
/**
|
|
63
|
+
* Returns an array of strings from data
|
|
64
|
+
* @param {Object} props: the props object
|
|
65
|
+
* @param {String} axis: the current axis
|
|
66
|
+
* @returns {Array} an array of strings
|
|
67
|
+
*/
|
|
68
|
+
export declare function getStringsFromData(props: any, axis: any): any;
|
|
69
|
+
/**
|
|
70
|
+
* Checks whether a given component can be used to calculate data
|
|
71
|
+
* @param {Component} component: a React component instance
|
|
72
|
+
* @returns {Boolean} Returns true if the given component has a role included in the whitelist
|
|
73
|
+
*/
|
|
74
|
+
export declare function isDataComponent(component: any): boolean;
|
|
75
|
+
//# sourceMappingURL=data.d.ts.map
|
package/es/victory-util/data.js
CHANGED
|
@@ -24,8 +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
27
|
/* eslint-disable no-use-before-define */
|
|
30
28
|
import React from "react";
|
|
31
29
|
import * as Helpers from "./helpers";
|
|
@@ -456,4 +454,5 @@ export function isDataComponent(component) {
|
|
|
456
454
|
|
|
457
455
|
var whitelist = ["area", "bar", "boxplot", "candlestick", "errorbar", "group", "histogram", "line", "pie", "scatter", "stack", "voronoi"];
|
|
458
456
|
return _includes(whitelist, role);
|
|
459
|
-
}
|
|
457
|
+
}
|
|
458
|
+
//# sourceMappingURL=data.js.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { AnimatePropTypeInterface } from "../types/prop-types";
|
|
2
|
+
export declare function continuousTransitions(): AnimatePropTypeInterface;
|
|
3
|
+
export declare function continuousPolarTransitions(): AnimatePropTypeInterface;
|
|
4
|
+
export declare function discreteTransitions(): AnimatePropTypeInterface;
|
|
5
|
+
//# sourceMappingURL=default-transitions.d.ts.map
|