victory-core 36.5.0 → 36.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/victory-core.js +13817 -10827
- package/dist/victory-core.min.js +1 -1
- package/es/index.d.ts +7 -27
- package/es/index.js +7 -53
- package/es/{types.d.ts → types/callbacks.d.ts} +12 -8
- package/es/types/callbacks.js +2 -0
- package/es/types/prop-types.d.ts +130 -0
- package/es/types/prop-types.js +2 -0
- package/es/victory-accessible-group/victory-accessible-group.d.ts +1 -0
- package/es/victory-accessible-group/victory-accessible-group.js +2 -1
- package/es/victory-animation/util.d.ts +2 -1
- package/es/victory-animation/util.js +6 -4
- package/es/victory-animation/victory-animation.d.ts +1 -0
- package/es/victory-animation/victory-animation.js +2 -1
- package/es/victory-clip-container/victory-clip-container.d.ts +6 -5
- package/es/victory-clip-container/victory-clip-container.js +2 -1
- package/es/victory-container/victory-container.d.ts +8 -7
- package/es/victory-container/victory-container.js +2 -1
- package/es/victory-label/victory-label.d.ts +3 -2
- package/es/victory-label/victory-label.js +4 -4
- package/es/victory-portal/portal-context.d.ts +1 -0
- package/es/victory-portal/portal-context.js +2 -1
- package/es/victory-portal/portal.d.ts +3 -2
- package/es/victory-portal/portal.js +2 -1
- package/es/victory-portal/victory-portal.d.ts +1 -0
- package/es/victory-portal/victory-portal.js +2 -1
- package/es/victory-primitives/arc.d.ts +31 -2
- package/es/victory-primitives/arc.js +3 -2
- package/es/victory-primitives/background.d.ts +31 -2
- package/es/victory-primitives/background.js +3 -2
- package/es/victory-primitives/border.d.ts +28 -2
- package/es/victory-primitives/border.js +3 -2
- package/es/victory-primitives/circle.d.ts +1 -0
- package/es/victory-primitives/circle.js +2 -1
- package/es/victory-primitives/clip-path.d.ts +2 -1
- package/es/victory-primitives/clip-path.js +2 -1
- package/es/victory-primitives/index.d.ts +1 -0
- package/es/victory-primitives/index.js +2 -1
- package/es/victory-primitives/line-segment.d.ts +29 -2
- package/es/victory-primitives/line-segment.js +3 -2
- package/es/victory-primitives/line.d.ts +1 -0
- package/es/victory-primitives/line.js +2 -1
- package/es/victory-primitives/path.d.ts +1 -0
- package/es/victory-primitives/path.js +2 -1
- package/es/victory-primitives/point.d.ts +30 -2
- package/es/victory-primitives/point.js +3 -2
- package/es/victory-primitives/rect.d.ts +1 -0
- package/es/victory-primitives/rect.js +2 -1
- package/es/victory-primitives/text.d.ts +2 -1
- package/es/victory-primitives/text.js +2 -1
- package/es/victory-primitives/tspan.d.ts +2 -1
- package/es/victory-primitives/tspan.js +2 -1
- package/es/victory-primitives/types.d.ts +2 -1
- package/es/victory-primitives/types.js +2 -1
- package/es/victory-primitives/whisker.d.ts +37 -2
- package/es/victory-primitives/whisker.js +3 -2
- package/es/victory-state/defaults.d.ts +3 -0
- package/es/victory-state/defaults.js +3 -0
- package/es/victory-state/helpers/get-axis-data.d.ts +3 -0
- package/es/victory-state/helpers/get-axis-data.js +15 -0
- package/es/victory-state/helpers/get-data.d.ts +15 -0
- package/es/victory-state/helpers/get-data.js +88 -0
- package/es/victory-state/helpers/get-domain.d.ts +6 -0
- package/es/victory-state/helpers/get-domain.js +68 -0
- package/es/victory-state/helpers/get-range.d.ts +6 -0
- package/es/victory-state/helpers/get-range.js +37 -0
- package/es/victory-state/helpers/get-scale.d.ts +6 -0
- package/es/victory-state/helpers/get-scale.js +59 -0
- package/es/victory-state/index.d.ts +3 -0
- package/es/victory-state/index.js +3 -0
- package/es/victory-state/types.d.ts +24 -0
- package/es/victory-state/types.js +2 -0
- package/es/victory-state/victory-provider.d.ts +19 -0
- package/es/victory-state/victory-provider.js +118 -0
- package/es/victory-theme/grayscale.d.ts +2 -1
- package/es/victory-theme/grayscale.js +2 -1
- package/es/victory-theme/material.d.ts +2 -1
- package/es/victory-theme/material.js +2 -1
- package/{lib/victory-theme/victory-theme-definition.d.ts → es/victory-theme/types.d.ts} +3 -8
- package/es/victory-theme/types.js +2 -0
- package/es/victory-theme/victory-theme.d.ts +4 -3
- package/es/victory-theme/victory-theme.js +3 -2
- package/es/victory-transition/victory-transition.d.ts +1 -0
- package/es/victory-transition/victory-transition.js +2 -1
- package/es/victory-util/add-events.d.ts +106 -0
- package/es/victory-util/add-events.js +40 -33
- package/es/victory-util/axis.d.ts +51 -0
- package/es/victory-util/axis.js +9 -7
- package/es/victory-util/collection.d.ts +9 -0
- package/es/victory-util/collection.js +6 -4
- package/es/victory-util/common-props.d.ts +84 -0
- package/es/victory-util/common-props.js +29 -12
- package/es/victory-util/data.d.ts +75 -0
- package/es/victory-util/data.js +2 -1
- package/es/victory-util/default-transitions.d.ts +5 -0
- package/es/victory-util/default-transitions.js +2 -1
- package/es/victory-util/domain.d.ts +91 -0
- package/es/victory-util/domain.js +6 -2
- package/es/victory-util/events.d.ts +65 -0
- package/es/victory-util/events.js +13 -8
- package/es/victory-util/helpers.d.ts +61 -0
- package/es/victory-util/helpers.js +8 -4
- package/es/victory-util/hooks/index.d.ts +3 -0
- package/es/victory-util/hooks/index.js +2 -1
- package/es/victory-util/hooks/use-animation-state.js +4 -3
- package/es/victory-util/hooks/use-previous-props.d.ts +2 -0
- package/es/victory-util/hooks/use-previous-props.js +4 -3
- package/es/victory-util/immutable.d.ts +12 -0
- package/es/victory-util/immutable.js +5 -4
- package/es/victory-util/index.d.ts +29 -0
- package/es/victory-util/index.js +48 -0
- package/es/victory-util/label-helpers.d.ts +27 -0
- package/es/victory-util/label-helpers.js +2 -1
- package/es/victory-util/line-helpers.d.ts +5 -0
- package/es/victory-util/line-helpers.js +24 -6
- package/es/victory-util/log.d.ts +2 -0
- package/es/victory-util/log.js +2 -1
- package/es/victory-util/point-path-helpers.d.ts +1 -0
- package/es/victory-util/point-path-helpers.js +2 -1
- package/es/victory-util/prop-types.d.ts +51 -0
- package/es/victory-util/prop-types.js +35 -44
- package/es/victory-util/scale.d.ts +10 -0
- package/es/victory-util/scale.js +14 -6
- package/es/victory-util/selection.d.ts +25 -23
- package/es/victory-util/selection.js +25 -14
- package/es/victory-util/style.d.ts +19 -0
- package/es/victory-util/style.js +2 -1
- package/es/victory-util/textsize.d.ts +37 -8
- package/es/victory-util/textsize.js +9 -6
- package/es/victory-util/timer-context.d.ts +1 -0
- package/es/victory-util/timer-context.js +2 -1
- package/es/victory-util/timer.d.ts +3 -2
- package/es/victory-util/timer.js +2 -1
- package/es/victory-util/transitions.d.ts +49 -0
- package/es/victory-util/transitions.js +5 -4
- package/es/victory-util/type-helpers.d.ts +10 -0
- package/es/victory-util/type-helpers.js +28 -0
- package/es/victory-util/user-props.d.ts +21 -0
- package/es/victory-util/user-props.js +6 -5
- package/es/victory-util/with-container.d.ts +5 -0
- package/es/victory-util/with-container.js +32 -0
- package/es/victory-util/wrapper.d.ts +38 -0
- package/es/victory-util/wrapper.js +4 -3
- package/lib/index.d.ts +7 -27
- package/lib/index.js +58 -147
- package/lib/{types.d.ts → types/callbacks.d.ts} +12 -8
- package/lib/types/callbacks.js +2 -0
- package/lib/types/prop-types.d.ts +130 -0
- package/lib/types/prop-types.js +2 -0
- package/lib/victory-accessible-group/victory-accessible-group.d.ts +1 -0
- package/lib/victory-accessible-group/victory-accessible-group.js +2 -1
- package/lib/victory-animation/util.d.ts +2 -1
- package/lib/victory-animation/util.js +6 -4
- package/lib/victory-animation/victory-animation.d.ts +1 -0
- package/lib/victory-animation/victory-animation.js +2 -1
- package/lib/victory-clip-container/victory-clip-container.d.ts +6 -5
- package/lib/victory-clip-container/victory-clip-container.js +2 -1
- package/lib/victory-container/victory-container.d.ts +8 -7
- package/lib/victory-container/victory-container.js +2 -1
- package/lib/victory-label/victory-label.d.ts +3 -2
- package/lib/victory-label/victory-label.js +4 -4
- package/lib/victory-portal/portal-context.d.ts +1 -0
- package/lib/victory-portal/portal-context.js +2 -1
- package/lib/victory-portal/portal.d.ts +3 -2
- package/lib/victory-portal/portal.js +2 -1
- package/lib/victory-portal/victory-portal.d.ts +1 -0
- package/lib/victory-portal/victory-portal.js +2 -1
- package/lib/victory-primitives/arc.d.ts +31 -2
- package/lib/victory-primitives/arc.js +4 -3
- package/lib/victory-primitives/background.d.ts +31 -2
- package/lib/victory-primitives/background.js +4 -3
- package/lib/victory-primitives/border.d.ts +28 -2
- package/lib/victory-primitives/border.js +4 -3
- package/lib/victory-primitives/circle.d.ts +1 -0
- package/lib/victory-primitives/circle.js +2 -1
- package/lib/victory-primitives/clip-path.d.ts +2 -1
- package/lib/victory-primitives/clip-path.js +2 -1
- package/lib/victory-primitives/index.d.ts +1 -0
- package/lib/victory-primitives/index.js +2 -1
- package/lib/victory-primitives/line-segment.d.ts +29 -2
- package/lib/victory-primitives/line-segment.js +4 -3
- package/lib/victory-primitives/line.d.ts +1 -0
- package/lib/victory-primitives/line.js +2 -1
- package/lib/victory-primitives/path.d.ts +1 -0
- package/lib/victory-primitives/path.js +2 -1
- package/lib/victory-primitives/point.d.ts +30 -2
- package/lib/victory-primitives/point.js +4 -3
- package/lib/victory-primitives/rect.d.ts +1 -0
- package/lib/victory-primitives/rect.js +2 -1
- package/lib/victory-primitives/text.d.ts +2 -1
- package/lib/victory-primitives/text.js +2 -1
- package/lib/victory-primitives/tspan.d.ts +2 -1
- package/lib/victory-primitives/tspan.js +2 -1
- package/lib/victory-primitives/types.d.ts +2 -1
- package/lib/victory-primitives/types.js +2 -1
- package/lib/victory-primitives/whisker.d.ts +37 -2
- package/lib/victory-primitives/whisker.js +4 -3
- package/lib/victory-state/defaults.d.ts +3 -0
- package/lib/victory-state/defaults.js +11 -0
- package/lib/victory-state/helpers/get-axis-data.d.ts +3 -0
- package/lib/victory-state/helpers/get-axis-data.js +23 -0
- package/lib/victory-state/helpers/get-data.d.ts +15 -0
- package/lib/victory-state/helpers/get-data.js +99 -0
- package/lib/victory-state/helpers/get-domain.d.ts +6 -0
- package/lib/victory-state/helpers/get-domain.js +82 -0
- package/lib/victory-state/helpers/get-range.d.ts +6 -0
- package/lib/victory-state/helpers/get-range.js +46 -0
- package/lib/victory-state/helpers/get-scale.d.ts +6 -0
- package/lib/victory-state/helpers/get-scale.js +74 -0
- package/lib/victory-state/index.d.ts +3 -0
- package/lib/victory-state/index.js +32 -0
- package/lib/victory-state/types.d.ts +24 -0
- package/lib/victory-state/types.js +2 -0
- package/lib/victory-state/victory-provider.d.ts +19 -0
- package/lib/victory-state/victory-provider.js +144 -0
- package/lib/victory-theme/grayscale.d.ts +2 -1
- package/lib/victory-theme/grayscale.js +2 -1
- package/lib/victory-theme/material.d.ts +2 -1
- package/lib/victory-theme/material.js +2 -1
- package/{es/victory-theme/victory-theme-definition.d.ts → lib/victory-theme/types.d.ts} +3 -8
- package/lib/victory-theme/types.js +2 -0
- package/lib/victory-theme/victory-theme.d.ts +4 -3
- package/lib/victory-theme/victory-theme.js +6 -5
- package/lib/victory-transition/victory-transition.d.ts +1 -0
- package/lib/victory-transition/victory-transition.js +2 -1
- package/lib/victory-util/add-events.d.ts +106 -0
- package/lib/victory-util/add-events.js +40 -36
- package/lib/victory-util/axis.d.ts +51 -0
- package/lib/victory-util/axis.js +8 -6
- package/lib/victory-util/collection.d.ts +9 -0
- package/lib/victory-util/collection.js +6 -4
- package/lib/victory-util/common-props.d.ts +84 -0
- package/lib/victory-util/common-props.js +27 -12
- package/lib/victory-util/data.d.ts +75 -0
- package/lib/victory-util/data.js +2 -1
- package/lib/victory-util/default-transitions.d.ts +5 -0
- package/lib/victory-util/default-transitions.js +2 -1
- package/lib/victory-util/domain.d.ts +91 -0
- package/lib/victory-util/domain.js +6 -2
- package/lib/victory-util/events.d.ts +65 -0
- package/lib/victory-util/events.js +13 -9
- package/lib/victory-util/helpers.d.ts +61 -0
- package/lib/victory-util/helpers.js +8 -4
- package/lib/victory-util/hooks/index.d.ts +3 -0
- package/lib/victory-util/hooks/index.js +2 -1
- package/lib/victory-util/hooks/use-animation-state.js +4 -3
- package/lib/victory-util/hooks/use-previous-props.d.ts +2 -0
- package/lib/victory-util/hooks/use-previous-props.js +5 -6
- package/lib/victory-util/immutable.d.ts +12 -0
- package/lib/victory-util/immutable.js +5 -4
- package/lib/victory-util/index.d.ts +29 -0
- package/lib/victory-util/index.js +181 -0
- package/lib/victory-util/label-helpers.d.ts +27 -0
- package/lib/victory-util/label-helpers.js +2 -1
- package/lib/victory-util/line-helpers.d.ts +5 -0
- package/lib/victory-util/line-helpers.js +28 -7
- package/lib/victory-util/log.d.ts +2 -0
- package/lib/victory-util/log.js +2 -1
- package/lib/victory-util/point-path-helpers.d.ts +1 -0
- package/lib/victory-util/point-path-helpers.js +2 -1
- package/lib/victory-util/prop-types.d.ts +51 -0
- package/lib/victory-util/prop-types.js +36 -44
- package/lib/victory-util/scale.d.ts +10 -0
- package/lib/victory-util/scale.js +14 -5
- package/lib/victory-util/selection.d.ts +25 -23
- package/lib/victory-util/selection.js +25 -19
- package/lib/victory-util/style.d.ts +19 -0
- package/lib/victory-util/style.js +2 -1
- package/lib/victory-util/textsize.d.ts +37 -8
- package/lib/victory-util/textsize.js +9 -6
- package/lib/victory-util/timer-context.d.ts +1 -0
- package/lib/victory-util/timer-context.js +2 -1
- package/lib/victory-util/timer.d.ts +3 -2
- package/lib/victory-util/timer.js +2 -1
- package/lib/victory-util/transitions.d.ts +49 -0
- package/lib/victory-util/transitions.js +5 -4
- package/lib/victory-util/type-helpers.d.ts +10 -0
- package/lib/victory-util/type-helpers.js +45 -0
- package/lib/victory-util/user-props.d.ts +21 -0
- package/lib/victory-util/user-props.js +6 -5
- package/lib/victory-util/with-container.d.ts +5 -0
- package/lib/victory-util/with-container.js +44 -0
- package/lib/victory-util/wrapper.d.ts +38 -0
- package/lib/victory-util/wrapper.js +4 -3
- package/package.json +3 -3
- package/src/index.ts +9 -31
- package/src/{types.ts → types/callbacks.ts} +21 -13
- package/src/types/prop-types.ts +195 -0
- package/src/victory-accessible-group/victory-accessible-group.tsx +3 -3
- package/src/victory-animation/util.ts +3 -2
- package/src/victory-animation/victory-animation.tsx +13 -13
- package/src/victory-clip-container/victory-clip-container.tsx +23 -23
- package/src/victory-container/victory-container.tsx +19 -19
- package/src/victory-label/victory-label.tsx +41 -39
- package/src/victory-portal/portal.tsx +1 -1
- package/src/victory-portal/victory-portal.tsx +3 -3
- package/src/victory-primitives/arc.tsx +8 -6
- package/src/victory-primitives/background.tsx +8 -6
- package/src/victory-primitives/border.tsx +8 -6
- package/src/victory-primitives/clip-path.tsx +3 -3
- package/src/victory-primitives/line-segment.tsx +8 -6
- package/src/victory-primitives/point.tsx +10 -8
- package/src/victory-primitives/text.tsx +2 -2
- package/src/victory-primitives/tspan.tsx +1 -1
- package/src/victory-primitives/types.ts +1 -1
- package/src/victory-primitives/whisker.tsx +15 -13
- package/src/victory-state/defaults.ts +2 -0
- package/src/victory-state/helpers/get-axis-data.ts +14 -0
- package/src/victory-state/helpers/get-data.ts +79 -0
- package/src/victory-state/helpers/get-domain.ts +62 -0
- package/src/victory-state/helpers/get-range.ts +39 -0
- package/src/victory-state/helpers/get-scale.ts +64 -0
- package/src/victory-state/index.ts +2 -0
- package/src/victory-state/types.ts +32 -0
- package/src/victory-state/victory-provider.tsx +116 -0
- package/src/victory-theme/grayscale.tsx +62 -62
- package/src/victory-theme/material.tsx +67 -67
- package/src/victory-theme/{victory-theme-definition.ts → types.ts} +10 -14
- package/src/victory-theme/victory-theme.tsx +1 -1
- package/src/victory-transition/victory-transition.tsx +19 -19
- package/src/victory-util/{add-events.js → add-events.tsx} +136 -59
- package/src/victory-util/{axis.js → axis.tsx} +17 -18
- package/src/victory-util/{collection.js → collection.tsx} +14 -10
- package/src/victory-util/common-props.tsx +307 -0
- package/src/victory-util/{data.js → data.ts} +14 -10
- package/src/victory-util/{default-transitions.js → default-transitions.ts} +20 -18
- package/src/victory-util/{domain.js → domain.ts} +26 -23
- package/src/victory-util/{events.js → events.ts} +82 -31
- package/src/victory-util/{helpers.js → helpers.ts} +41 -22
- package/src/victory-util/hooks/{index.js → index.ts} +0 -0
- package/src/victory-util/hooks/use-animation-state.js +12 -12
- package/src/victory-util/hooks/use-previous-props.ts +9 -0
- package/src/victory-util/{immutable.js → immutable.ts} +14 -10
- package/src/victory-util/index.ts +28 -0
- package/src/victory-util/{label-helpers.js → label-helpers.ts} +7 -7
- package/src/victory-util/line-helpers.ts +104 -0
- package/src/victory-util/{log.js → log.ts} +1 -1
- package/src/victory-util/{prop-types.js → prop-types.ts} +103 -101
- package/src/victory-util/{scale.js → scale.ts} +29 -16
- package/src/victory-util/selection.ts +158 -0
- package/src/victory-util/{style.js → style.ts} +3 -3
- package/src/victory-util/{textsize.js → textsize.ts} +32 -17
- package/src/victory-util/timer-context.ts +1 -1
- package/src/victory-util/timer.ts +5 -10
- package/src/victory-util/{transitions.js → transitions.ts} +50 -22
- package/src/victory-util/type-helpers.ts +50 -0
- package/src/victory-util/{user-props.js → user-props.ts} +16 -11
- package/src/victory-util/with-container.tsx +41 -0
- package/src/victory-util/{wrapper.js → wrapper.tsx} +38 -33
- package/es/types.js +0 -1
- package/es/victory-theme/victory-theme-definition.js +0 -1
- package/es/victory-util/types.d.ts +0 -188
- package/es/victory-util/types.js +0 -1
- package/lib/types.js +0 -1
- package/lib/victory-theme/victory-theme-definition.js +0 -1
- package/lib/victory-util/types.d.ts +0 -188
- package/lib/victory-util/types.js +0 -1
- package/src/victory-util/common-props.js +0 -197
- package/src/victory-util/hooks/use-previous-props.js +0 -9
- package/src/victory-util/line-helpers.js +0 -54
- package/src/victory-util/selection.d.ts +0 -23
- package/src/victory-util/selection.js +0 -98
- package/src/victory-util/textsize.d.ts +0 -8
- package/src/victory-util/types.ts +0 -247
|
@@ -3,26 +3,26 @@
|
|
|
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"));
|
|
@@ -87,44 +87,45 @@ var defaultComponents = [{
|
|
|
87
87
|
name: "labels"
|
|
88
88
|
}];
|
|
89
89
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
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);
|
|
93
96
|
|
|
94
|
-
var _super = _createSuper(
|
|
97
|
+
var _super = _createSuper(AddEventsMixin);
|
|
95
98
|
|
|
96
|
-
function
|
|
99
|
+
function AddEventsMixin(props) {
|
|
97
100
|
var _this;
|
|
98
101
|
|
|
99
|
-
_classCallCheck(this,
|
|
102
|
+
_classCallCheck(this, AddEventsMixin);
|
|
100
103
|
|
|
101
104
|
_this = _super.call(this, props);
|
|
102
|
-
var getScopedEvents = Events.getScopedEvents.bind(_assertThisInitialized(_this));
|
|
103
|
-
var boundGetEvents = Events.getEvents.bind(_assertThisInitialized(_this));
|
|
104
105
|
_this.state = {};
|
|
106
|
+
_this.getEventState = Events.getEventState.bind(_assertThisInitialized(_this));
|
|
107
|
+
_this.getScopedEvents = Events.getScopedEvents.bind(_assertThisInitialized(_this));
|
|
105
108
|
|
|
106
109
|
_this.getEvents = function (p, target, eventKey) {
|
|
107
|
-
return
|
|
110
|
+
return Events.getEvents.call(_assertThisInitialized(_this), p, target, eventKey, _this.getScopedEvents);
|
|
108
111
|
};
|
|
109
112
|
|
|
110
|
-
_this.
|
|
111
|
-
|
|
112
|
-
var calculatedValues = _this.getCalculatedValues(props);
|
|
113
|
-
|
|
114
|
-
_this.cacheValues(calculatedValues);
|
|
115
|
-
|
|
116
|
-
_this.externalMutations = _this.getExternalMutations(props);
|
|
117
|
-
_this.calculatedState = _this.getStateChanges(props);
|
|
113
|
+
_this.externalMutations = _this.getExternalMutations(_this.props);
|
|
114
|
+
_this.calculatedState = _this.getStateChanges(_this.props);
|
|
118
115
|
_this.globalEvents = {};
|
|
119
116
|
_this.prevGlobalEventKeys = [];
|
|
120
117
|
_this.boundGlobalEvents = {};
|
|
118
|
+
|
|
119
|
+
_this.cacheValues(_this.getCalculatedValues(props));
|
|
120
|
+
|
|
121
121
|
return _this;
|
|
122
122
|
}
|
|
123
123
|
|
|
124
|
-
_createClass(
|
|
124
|
+
_createClass(AddEventsMixin, [{
|
|
125
125
|
key: "shouldComponentUpdate",
|
|
126
126
|
value: function shouldComponentUpdate(nextProps) {
|
|
127
|
-
var externalMutations = this.getExternalMutations(nextProps);
|
|
127
|
+
var externalMutations = this.getExternalMutations(nextProps); // @ts-expect-error "Property 'animating' does not exist on type EventMixinCommonProps"
|
|
128
|
+
|
|
128
129
|
var animating = this.props.animating || this.props.animate;
|
|
129
130
|
var newMutation = !(0, _reactFastCompare.default)(externalMutations, this.externalMutations);
|
|
130
131
|
|
|
@@ -221,7 +222,6 @@ var _default = function _default(WrappedComponent, options) {
|
|
|
221
222
|
return (0, _isEmpty2.default)(result) ? undefined : result;
|
|
222
223
|
};
|
|
223
224
|
|
|
224
|
-
options = options || {};
|
|
225
225
|
var components = options.components || defaultComponents;
|
|
226
226
|
var stateChanges = components.map(function (component) {
|
|
227
227
|
if (!props.standalone && component.name === "parent") {
|
|
@@ -294,14 +294,14 @@ var _default = function _default(WrappedComponent, options) {
|
|
|
294
294
|
}, {
|
|
295
295
|
key: "getBaseProps",
|
|
296
296
|
value: function getBaseProps(props, getSharedEventState) {
|
|
297
|
-
getSharedEventState = getSharedEventState || this.getSharedEventState;
|
|
297
|
+
getSharedEventState = getSharedEventState || this.getSharedEventState.bind(this);
|
|
298
298
|
var sharedParentState = getSharedEventState("parent", "parent");
|
|
299
299
|
var parentState = this.getEventState("parent", "parent");
|
|
300
300
|
var baseParentProps = (0, _defaults2.default)({}, parentState, sharedParentState);
|
|
301
301
|
var parentPropsList = baseParentProps.parentControlledProps;
|
|
302
302
|
var parentProps = parentPropsList ? (0, _pick2.default)(baseParentProps, parentPropsList) : {};
|
|
303
303
|
var modifiedProps = (0, _defaults2.default)({}, parentProps, props);
|
|
304
|
-
return
|
|
304
|
+
return typeof WrappedComponent.getBaseProps === "function" ? WrappedComponent.getBaseProps(modifiedProps) : {};
|
|
305
305
|
}
|
|
306
306
|
}, {
|
|
307
307
|
key: "getAllEvents",
|
|
@@ -363,11 +363,14 @@ var _default = function _default(WrappedComponent, options) {
|
|
|
363
363
|
}, {
|
|
364
364
|
key: "animateComponent",
|
|
365
365
|
value: function animateComponent(props, defaultAnimationWhitelist) {
|
|
366
|
-
var
|
|
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;
|
|
367
370
|
return /*#__PURE__*/_react.default.createElement(_victoryTransition.VictoryTransition, {
|
|
368
371
|
animate: props.animate,
|
|
369
372
|
animationWhitelist: animationWhitelist
|
|
370
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
373
|
+
}, /*#__PURE__*/_react.default.createElement(Comp, props));
|
|
371
374
|
} // Used by `VictoryLine` and `VictoryArea`
|
|
372
375
|
|
|
373
376
|
}, {
|
|
@@ -424,8 +427,9 @@ var _default = function _default(WrappedComponent, options) {
|
|
|
424
427
|
}
|
|
425
428
|
}]);
|
|
426
429
|
|
|
427
|
-
return
|
|
430
|
+
return AddEventsMixin;
|
|
428
431
|
}(WrappedComponent);
|
|
429
|
-
};
|
|
430
432
|
|
|
431
|
-
|
|
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,7 +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 no-use-before-define */
|
|
28
27
|
function isNonEmptyArray(collection) {
|
|
29
28
|
return Array.isArray(collection) && collection.length > 0;
|
|
30
29
|
}
|
|
@@ -69,7 +68,8 @@ function getMaxValue(arr) {
|
|
|
69
68
|
}
|
|
70
69
|
|
|
71
70
|
var array = arr.concat(values);
|
|
72
|
-
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));
|
|
73
73
|
}
|
|
74
74
|
|
|
75
75
|
function getMinValue(arr) {
|
|
@@ -78,5 +78,7 @@ function getMinValue(arr) {
|
|
|
78
78
|
}
|
|
79
79
|
|
|
80
80
|
var array = arr.concat(values);
|
|
81
|
-
return containsDates(array) ? new Date(Math.min.apply(Math, _toConsumableArray(array)))
|
|
82
|
-
|
|
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
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.CommonProps = void 0;
|
|
7
7
|
|
|
8
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
9
|
|
|
@@ -16,28 +16,29 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
16
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
17
|
|
|
18
18
|
var dataProps = {
|
|
19
|
+
// @ts-expect-error TODO: synchronize the type with this PropTypes
|
|
19
20
|
categories: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.string), _propTypes.default.shape({
|
|
20
21
|
x: _propTypes.default.arrayOf(_propTypes.default.string),
|
|
21
22
|
y: _propTypes.default.arrayOf(_propTypes.default.string)
|
|
22
23
|
})]),
|
|
24
|
+
// @ts-expect-error TODO: synchronize the type with this PropTypes
|
|
23
25
|
data: _propTypes.default.oneOfType([_propTypes.default.array, _propTypes.default.object]),
|
|
24
26
|
dataComponent: _propTypes.default.element,
|
|
25
27
|
disableInlineStyles: _propTypes.default.bool,
|
|
26
28
|
labelComponent: _propTypes.default.element,
|
|
27
29
|
labels: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.array]),
|
|
28
30
|
samples: CustomPropTypes.nonNegative,
|
|
29
|
-
sortKey: _propTypes.default.oneOfType([_propTypes.default.func, CustomPropTypes.allOfType([CustomPropTypes.integer, CustomPropTypes.nonNegative]), _propTypes.default.string, _propTypes.default.arrayOf(_propTypes.default.string)]),
|
|
31
|
+
sortKey: _propTypes.default.oneOfType([_propTypes.default.func, CustomPropTypes.allOfType([CustomPropTypes.integer, CustomPropTypes.nonNegative]), _propTypes.default.string, _propTypes.default.arrayOf(_propTypes.default.string.isRequired)]),
|
|
30
32
|
sortOrder: _propTypes.default.oneOf(["ascending", "descending"]),
|
|
31
33
|
style: _propTypes.default.shape({
|
|
32
34
|
parent: _propTypes.default.object,
|
|
33
35
|
data: _propTypes.default.object,
|
|
34
36
|
labels: _propTypes.default.object
|
|
35
37
|
}),
|
|
36
|
-
x: _propTypes.default.oneOfType([_propTypes.default.func, CustomPropTypes.allOfType([CustomPropTypes.integer, CustomPropTypes.nonNegative]), _propTypes.default.string, _propTypes.default.arrayOf(_propTypes.default.string)]),
|
|
37
|
-
y: _propTypes.default.oneOfType([_propTypes.default.func, CustomPropTypes.allOfType([CustomPropTypes.integer, CustomPropTypes.nonNegative]), _propTypes.default.string, _propTypes.default.arrayOf(_propTypes.default.string)]),
|
|
38
|
-
y0: _propTypes.default.oneOfType([_propTypes.default.func, CustomPropTypes.allOfType([CustomPropTypes.integer, CustomPropTypes.nonNegative]), _propTypes.default.string, _propTypes.default.arrayOf(_propTypes.default.string)])
|
|
38
|
+
x: _propTypes.default.oneOfType([_propTypes.default.func, CustomPropTypes.allOfType([CustomPropTypes.integer, CustomPropTypes.nonNegative]), _propTypes.default.string, _propTypes.default.arrayOf(_propTypes.default.string.isRequired)]),
|
|
39
|
+
y: _propTypes.default.oneOfType([_propTypes.default.func, CustomPropTypes.allOfType([CustomPropTypes.integer, CustomPropTypes.nonNegative]), _propTypes.default.string, _propTypes.default.arrayOf(_propTypes.default.string.isRequired)]),
|
|
40
|
+
y0: _propTypes.default.oneOfType([_propTypes.default.func, CustomPropTypes.allOfType([CustomPropTypes.integer, CustomPropTypes.nonNegative]), _propTypes.default.string, _propTypes.default.arrayOf(_propTypes.default.string.isRequired)])
|
|
39
41
|
};
|
|
40
|
-
exports.dataProps = dataProps;
|
|
41
42
|
var baseProps = {
|
|
42
43
|
animate: _propTypes.default.oneOfType([_propTypes.default.bool, _propTypes.default.object]),
|
|
43
44
|
containerComponent: _propTypes.default.element,
|
|
@@ -45,14 +46,17 @@ var baseProps = {
|
|
|
45
46
|
x: CustomPropTypes.domain,
|
|
46
47
|
y: CustomPropTypes.domain
|
|
47
48
|
})]),
|
|
49
|
+
// @ts-expect-error TODO: synchronize the type with this PropTypes
|
|
48
50
|
maxDomain: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.instanceOf(Date), _propTypes.default.shape({
|
|
49
51
|
x: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.instanceOf(Date)]),
|
|
50
52
|
y: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.instanceOf(Date)])
|
|
51
53
|
})]),
|
|
54
|
+
// @ts-expect-error TODO: synchronize the type with this PropTypes
|
|
52
55
|
minDomain: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.instanceOf(Date), _propTypes.default.shape({
|
|
53
56
|
x: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.instanceOf(Date)]),
|
|
54
57
|
y: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.instanceOf(Date)])
|
|
55
58
|
})]),
|
|
59
|
+
// @ts-expect-error TODO: synchronize the type with this PropTypes
|
|
56
60
|
domainPadding: _propTypes.default.oneOfType([_propTypes.default.shape({
|
|
57
61
|
x: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.arrayOf(_propTypes.default.number)]),
|
|
58
62
|
y: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.arrayOf(_propTypes.default.number)])
|
|
@@ -63,6 +67,7 @@ var baseProps = {
|
|
|
63
67
|
eventKey: _propTypes.default.oneOfType([_propTypes.default.array, CustomPropTypes.allOfType([CustomPropTypes.integer, CustomPropTypes.nonNegative]), _propTypes.default.string]),
|
|
64
68
|
eventHandlers: _propTypes.default.object
|
|
65
69
|
})),
|
|
70
|
+
// @ts-expect-error TODO: synchronize the type with this PropTypes
|
|
66
71
|
externalEventMutations: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
67
72
|
callback: _propTypes.default.func,
|
|
68
73
|
childName: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.array]),
|
|
@@ -73,10 +78,12 @@ var baseProps = {
|
|
|
73
78
|
groupComponent: _propTypes.default.element,
|
|
74
79
|
height: CustomPropTypes.nonNegative,
|
|
75
80
|
name: _propTypes.default.string,
|
|
81
|
+
// @ts-expect-error TODO: synchronize the type with this PropTypes
|
|
76
82
|
origin: _propTypes.default.shape({
|
|
77
83
|
x: _propTypes.default.number,
|
|
78
84
|
y: _propTypes.default.number
|
|
79
85
|
}),
|
|
86
|
+
// @ts-expect-error TODO: synchronize the type with this PropTypes
|
|
80
87
|
padding: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.shape({
|
|
81
88
|
top: _propTypes.default.number,
|
|
82
89
|
bottom: _propTypes.default.number,
|
|
@@ -85,17 +92,19 @@ var baseProps = {
|
|
|
85
92
|
})]),
|
|
86
93
|
polar: _propTypes.default.bool,
|
|
87
94
|
range: _propTypes.default.oneOfType([CustomPropTypes.domain, _propTypes.default.shape({
|
|
88
|
-
x: CustomPropTypes.domain,
|
|
89
|
-
y: CustomPropTypes.domain
|
|
95
|
+
x: CustomPropTypes.domain.isRequired,
|
|
96
|
+
y: CustomPropTypes.domain.isRequired
|
|
90
97
|
})]),
|
|
91
98
|
scale: _propTypes.default.oneOfType([CustomPropTypes.scale, _propTypes.default.shape({
|
|
92
|
-
x: CustomPropTypes.scale,
|
|
93
|
-
y: CustomPropTypes.scale
|
|
99
|
+
x: CustomPropTypes.scale.isRequired,
|
|
100
|
+
y: CustomPropTypes.scale.isRequired
|
|
94
101
|
})]),
|
|
102
|
+
// @ts-expect-error TODO: synchronize the type with this PropTypes
|
|
95
103
|
sharedEvents: _propTypes.default.shape({
|
|
96
104
|
events: _propTypes.default.array,
|
|
97
105
|
getEventState: _propTypes.default.func
|
|
98
106
|
}),
|
|
107
|
+
// @ts-expect-error TODO: synchronize the type with this PropTypes
|
|
99
108
|
singleQuadrantDomainPadding: _propTypes.default.oneOfType([_propTypes.default.bool, _propTypes.default.shape({
|
|
100
109
|
x: _propTypes.default.oneOfType([_propTypes.default.bool]),
|
|
101
110
|
y: _propTypes.default.oneOfType([_propTypes.default.bool])
|
|
@@ -104,7 +113,6 @@ var baseProps = {
|
|
|
104
113
|
theme: _propTypes.default.object,
|
|
105
114
|
width: CustomPropTypes.nonNegative
|
|
106
115
|
};
|
|
107
|
-
exports.baseProps = baseProps;
|
|
108
116
|
var primitiveProps = {
|
|
109
117
|
active: _propTypes.default.bool,
|
|
110
118
|
ariaLabel: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.func]),
|
|
@@ -116,6 +124,7 @@ var primitiveProps = {
|
|
|
116
124
|
events: _propTypes.default.object,
|
|
117
125
|
id: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string, _propTypes.default.func]),
|
|
118
126
|
index: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
|
|
127
|
+
// @ts-expect-error TODO: synchronize the type with this PropTypes
|
|
119
128
|
origin: _propTypes.default.shape({
|
|
120
129
|
x: _propTypes.default.number,
|
|
121
130
|
y: _propTypes.default.number
|
|
@@ -131,4 +140,10 @@ var primitiveProps = {
|
|
|
131
140
|
tabIndex: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.func]),
|
|
132
141
|
transform: _propTypes.default.string
|
|
133
142
|
};
|
|
134
|
-
|
|
143
|
+
var CommonProps = {
|
|
144
|
+
dataProps: dataProps,
|
|
145
|
+
baseProps: baseProps,
|
|
146
|
+
primitiveProps: primitiveProps
|
|
147
|
+
};
|
|
148
|
+
exports.CommonProps = CommonProps;
|
|
149
|
+
//# 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/lib/victory-util/data.js
CHANGED
|
@@ -499,4 +499,5 @@ function isDataComponent(component) {
|
|
|
499
499
|
|
|
500
500
|
var whitelist = ["area", "bar", "boxplot", "candlestick", "errorbar", "group", "histogram", "line", "pie", "scatter", "stack", "voronoi"];
|
|
501
501
|
return (0, _includes2.default)(whitelist, role);
|
|
502
|
-
}
|
|
502
|
+
}
|
|
503
|
+
//# 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
|