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
|
@@ -63,7 +63,7 @@ function getChildData(child) {
|
|
|
63
63
|
}
|
|
64
64
|
/**
|
|
65
65
|
* If a parent component has animation enabled, calculate the transitions
|
|
66
|
-
* for any data of any child component that supports data transitions
|
|
66
|
+
* for any data of any child component that supports data transitions.
|
|
67
67
|
* Data transitions are defined as any two datasets where data nodes exist
|
|
68
68
|
* in the first set and not the second, in the second and not the first,
|
|
69
69
|
* or both.
|
|
@@ -192,7 +192,7 @@ function getChildPropsOnExit(animate, child, data, exitingNodes, cb) {
|
|
|
192
192
|
|
|
193
193
|
if (exitingNodes) {
|
|
194
194
|
// After the exit transition occurs, trigger the animations for
|
|
195
|
-
// nodes that are neither exiting
|
|
195
|
+
// nodes that are neither exiting nor entering.
|
|
196
196
|
animate.onEnd = cb;
|
|
197
197
|
var before = animate.onExit && animate.onExit.before ? animate.onExit.before : _identity; // If nodes need to exit, transform them with the provided onExit.before function.
|
|
198
198
|
|
|
@@ -262,7 +262,7 @@ function getChildPropsOnEnter(animate, data, enteringNodes, cb) {
|
|
|
262
262
|
* and its index in the parent's children array.
|
|
263
263
|
*
|
|
264
264
|
* In particular, this will include an `animate` object that is set appropriately
|
|
265
|
-
* so that each child will be
|
|
265
|
+
* so that each child will be synchronized for each stage of a transition
|
|
266
266
|
* animation. It will also include a transformed `data` object, where each datum
|
|
267
267
|
* is transformed by `animate.onExit` and `animate.onEnter` `before` and `after`
|
|
268
268
|
* functions.
|
|
@@ -406,4 +406,5 @@ export function getTransitionPropsFactory(props, state, setState) {
|
|
|
406
406
|
data: data
|
|
407
407
|
};
|
|
408
408
|
};
|
|
409
|
-
}
|
|
409
|
+
}
|
|
410
|
+
//# sourceMappingURL=transitions.js.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ForAxes, AxisType, Tuple, Datum, DatumValue } from "../types/prop-types";
|
|
2
|
+
export declare function hasValueForAxis<T = unknown>(value: unknown | ForAxes<T>, axis: AxisType): value is ForAxes<T>;
|
|
3
|
+
export declare function isTuple<T = unknown>(value: unknown): value is Tuple<T>;
|
|
4
|
+
export declare function getValueForAxis<T = unknown>(value: T | ForAxes<T> | undefined, axis: AxisType): T | undefined;
|
|
5
|
+
export declare function isFunction<T = Function>(func?: unknown): func is T;
|
|
6
|
+
export declare function isDate(value: unknown): value is Date;
|
|
7
|
+
export declare function isKeyValueObject(datum: Datum): datum is {
|
|
8
|
+
[key: string]: DatumValue;
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=type-helpers.d.ts.map
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export function hasValueForAxis(value, axis) {
|
|
2
|
+
if (typeof value === "object" && value !== null) {
|
|
3
|
+
return axis in value;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
return false;
|
|
7
|
+
}
|
|
8
|
+
export function isTuple(value) {
|
|
9
|
+
return Array.isArray(value) && value.length === 2;
|
|
10
|
+
}
|
|
11
|
+
export function getValueForAxis(value, axis) {
|
|
12
|
+
if (hasValueForAxis(value, axis)) {
|
|
13
|
+
return value[axis];
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
return value;
|
|
17
|
+
} // eslint-disable-next-line @typescript-eslint/ban-types
|
|
18
|
+
|
|
19
|
+
export function isFunction(func) {
|
|
20
|
+
return typeof func === "function";
|
|
21
|
+
}
|
|
22
|
+
export function isDate(value) {
|
|
23
|
+
return value instanceof Date;
|
|
24
|
+
}
|
|
25
|
+
export function isKeyValueObject(datum) {
|
|
26
|
+
return typeof datum === "object" && !Array.isArray(datum) && !(datum instanceof Date);
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=type-helpers.js.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
declare type SafeAttribute = `data-${string}` | `aria-${string}`;
|
|
3
|
+
/**
|
|
4
|
+
* getSafeUserProps - function that takes in a props object and removes any
|
|
5
|
+
* key-value entries that do not match filter strings in the USER_PROPS_SAFELIST
|
|
6
|
+
* object.
|
|
7
|
+
*
|
|
8
|
+
* @param {Object} props: props to be filtered against USER_PROPS_SAFELIST
|
|
9
|
+
* @returns {Object}: object containing remaining acceptable props
|
|
10
|
+
*/
|
|
11
|
+
export declare const getSafeUserProps: <T>(props: T) => Record<SafeAttribute, string>;
|
|
12
|
+
/**
|
|
13
|
+
* Wraps a component and adds safe user props
|
|
14
|
+
*
|
|
15
|
+
* @param {ReactElement} component: parent component
|
|
16
|
+
* @param {Object} props: props to be filtered
|
|
17
|
+
* @returns {ReactElement} modified component
|
|
18
|
+
*/
|
|
19
|
+
export declare const withSafeUserProps: (component: React.ReactElement, props: any) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
20
|
+
export {};
|
|
21
|
+
//# sourceMappingURL=user-props.d.ts.map
|
|
@@ -19,7 +19,7 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
|
|
|
19
19
|
import * as React from "react";
|
|
20
20
|
/*
|
|
21
21
|
USER_PROPS_SAFELIST is to contain any string deemed safe for user props.
|
|
22
|
-
The startsWidth array will contain the start of any accepted user-prop that
|
|
22
|
+
The startsWidth array will contain the start of any accepted user-prop that
|
|
23
23
|
starts with these characters.
|
|
24
24
|
The exactMatch will contain a list of exact prop names that are accepted.
|
|
25
25
|
*/
|
|
@@ -28,6 +28,7 @@ var USER_PROPS_SAFELIST = {
|
|
|
28
28
|
startsWith: ["data-", "aria-"],
|
|
29
29
|
exactMatch: []
|
|
30
30
|
};
|
|
31
|
+
|
|
31
32
|
/**
|
|
32
33
|
* doesPropStartWith: Function that takes a prop's key and runs it against all
|
|
33
34
|
* options in the USER_PROPS_SAFELIST and checks to see if it starts with any
|
|
@@ -36,7 +37,6 @@ var USER_PROPS_SAFELIST = {
|
|
|
36
37
|
* @returns {Boolean}: returns true if the key starts with an option or false if
|
|
37
38
|
* otherwise
|
|
38
39
|
*/
|
|
39
|
-
|
|
40
40
|
var doesPropStartWith = function (key) {
|
|
41
41
|
var startsWith = false;
|
|
42
42
|
USER_PROPS_SAFELIST.startsWith.forEach(function (starterString) {
|
|
@@ -113,11 +113,12 @@ export var getSafeUserProps = function (props) {
|
|
|
113
113
|
/**
|
|
114
114
|
* Wraps a component and adds safe user props
|
|
115
115
|
*
|
|
116
|
-
* @param {
|
|
116
|
+
* @param {ReactElement} component: parent component
|
|
117
117
|
* @param {Object} props: props to be filtered
|
|
118
|
-
* @returns {
|
|
118
|
+
* @returns {ReactElement} modified component
|
|
119
119
|
*/
|
|
120
120
|
|
|
121
121
|
export var withSafeUserProps = function (component, props) {
|
|
122
122
|
return /*#__PURE__*/React.cloneElement(component, getSafeUserProps(props));
|
|
123
|
-
};
|
|
123
|
+
};
|
|
124
|
+
//# sourceMappingURL=user-props.js.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { VictoryProviderProps } from "victory-core";
|
|
3
|
+
import { VictoryCommonProps } from "./common-props";
|
|
4
|
+
export declare function withContainer<Props extends VictoryCommonProps>(WrappedComponent: (props: Props) => React.ReactElement, initialProviderProps?: Partial<VictoryProviderProps>): (props: Props) => JSX.Element;
|
|
5
|
+
//# sourceMappingURL=with-container.d.ts.map
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
2
|
+
|
|
3
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
4
|
+
|
|
5
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
|
+
|
|
7
|
+
import React from "react";
|
|
8
|
+
import { VictoryProvider, VictoryContainer } from "victory-core";
|
|
9
|
+
var defaultProviderProps = {
|
|
10
|
+
width: 450,
|
|
11
|
+
height: 300,
|
|
12
|
+
padding: 50,
|
|
13
|
+
data: []
|
|
14
|
+
};
|
|
15
|
+
export function withContainer(WrappedComponent) {
|
|
16
|
+
var initialProviderProps = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
17
|
+
return function (props) {
|
|
18
|
+
var providerProps = _objectSpread(_objectSpread(_objectSpread({}, defaultProviderProps), initialProviderProps), props);
|
|
19
|
+
|
|
20
|
+
var _props$standalone = props.standalone,
|
|
21
|
+
standalone = _props$standalone === void 0 ? true : _props$standalone,
|
|
22
|
+
_props$containerCompo = props.containerComponent,
|
|
23
|
+
containerComponent = _props$containerCompo === void 0 ? /*#__PURE__*/React.createElement(VictoryContainer, null) : _props$containerCompo;
|
|
24
|
+
|
|
25
|
+
if (standalone) {
|
|
26
|
+
return /*#__PURE__*/React.createElement(VictoryProvider, providerProps, /*#__PURE__*/React.cloneElement(containerComponent, providerProps, /*#__PURE__*/React.createElement(WrappedComponent, props)));
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
return /*#__PURE__*/React.createElement(WrappedComponent, props);
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=with-container.js.map
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export declare function addBinsToParentPropsIfHistogram({ children, props, childComponents, parentProps, }: {
|
|
2
|
+
children: any;
|
|
3
|
+
props: any;
|
|
4
|
+
childComponents: any;
|
|
5
|
+
parentProps: any;
|
|
6
|
+
}): any;
|
|
7
|
+
export declare function getDataFromChildren(props: any, childComponents: any): any[][];
|
|
8
|
+
export declare function getData(props: any, childComponents: any): any;
|
|
9
|
+
export declare function getWidth(props: any, groupLength?: any, seriesLength?: any): number;
|
|
10
|
+
export declare function getDefaultDomainPadding(props: any, axis: any, childComponents: any): {
|
|
11
|
+
x: number;
|
|
12
|
+
} | undefined;
|
|
13
|
+
export declare function getDomainFromChildren(props: any, axis: any, childComponents: any): (number | Date)[];
|
|
14
|
+
export declare function getDomain(props: any, axis: any, childComponents: any): any;
|
|
15
|
+
export declare function getScale(props: any, axis: any, childComponents?: any): import("..").D3Scale<any>;
|
|
16
|
+
export declare function getAllEvents(props: any): any;
|
|
17
|
+
export declare function getColor(calculatedProps: any, child: any, index: any): any;
|
|
18
|
+
export declare function getStyle(theme: any, style: any, role: any): any;
|
|
19
|
+
export declare function getChildStyle(child: any, index: any, calculatedProps: any): any[] | {
|
|
20
|
+
parent: any;
|
|
21
|
+
data: any;
|
|
22
|
+
labels: any;
|
|
23
|
+
};
|
|
24
|
+
export declare function getStringsFromCategories(childComponents: any, axis: any): any[];
|
|
25
|
+
export declare function getStringsFromData(childComponents: any): {
|
|
26
|
+
x: number[];
|
|
27
|
+
y: number[];
|
|
28
|
+
};
|
|
29
|
+
export declare function getCategoryAndAxisStringsFromChildren(props: any, axis: any, childComponents: any): any[];
|
|
30
|
+
export declare function getStringsFromChildren(props: any, childComponents: any): {
|
|
31
|
+
x: any[];
|
|
32
|
+
y: any[];
|
|
33
|
+
};
|
|
34
|
+
export declare function getCategories(props: any, childComponents: any, allStrings: any): {
|
|
35
|
+
x: any;
|
|
36
|
+
y: any;
|
|
37
|
+
};
|
|
38
|
+
//# sourceMappingURL=wrapper.d.ts.map
|
|
@@ -151,7 +151,7 @@ export function getData(props, childComponents) {
|
|
|
151
151
|
}
|
|
152
152
|
|
|
153
153
|
childComponents = childComponents || React.Children.toArray(props.children);
|
|
154
|
-
return getDataFromChildren(childComponents);
|
|
154
|
+
return getDataFromChildren(props, childComponents);
|
|
155
155
|
}
|
|
156
156
|
export function getWidth(props, groupLength, seriesLength) {
|
|
157
157
|
var datasets = props.datasets,
|
|
@@ -213,7 +213,7 @@ export function getDefaultDomainPadding(props, axis, childComponents) {
|
|
|
213
213
|
export function getDomainFromChildren(props, axis, childComponents) {
|
|
214
214
|
// eslint-disable-line max-statements, complexity, max-len
|
|
215
215
|
var children = childComponents ? childComponents.slice(0) : React.Children.toArray(props.children);
|
|
216
|
-
var parentData = props.data ? Data.getData(props
|
|
216
|
+
var parentData = props.data ? Data.getData(props) : undefined;
|
|
217
217
|
var polar = props.polar,
|
|
218
218
|
startAngle = props.startAngle,
|
|
219
219
|
endAngle = props.endAngle,
|
|
@@ -446,4 +446,5 @@ export function getCategories(props, childComponents, allStrings) {
|
|
|
446
446
|
x: xCategories.length > 0 ? xCategories : undefined,
|
|
447
447
|
y: yCategories.length > 0 ? yCategories : undefined
|
|
448
448
|
};
|
|
449
|
-
}
|
|
449
|
+
}
|
|
450
|
+
//# sourceMappingURL=wrapper.js.map
|
package/lib/index.d.ts
CHANGED
|
@@ -1,38 +1,18 @@
|
|
|
1
|
+
export * from "./types/callbacks";
|
|
2
|
+
export * from "./types/prop-types";
|
|
1
3
|
export * from "./victory-accessible-group/victory-accessible-group";
|
|
2
4
|
export * from "./victory-animation/victory-animation";
|
|
3
5
|
export * from "./victory-container/victory-container";
|
|
4
6
|
export * from "./victory-label/victory-label";
|
|
5
7
|
export * from "./victory-transition/victory-transition";
|
|
6
8
|
export * from "./victory-clip-container/victory-clip-container";
|
|
9
|
+
export * from "./victory-theme/types";
|
|
7
10
|
export * from "./victory-theme/victory-theme";
|
|
8
11
|
export * from "./victory-portal/portal";
|
|
9
12
|
export * from "./victory-portal/portal-context";
|
|
10
13
|
export * from "./victory-portal/victory-portal";
|
|
11
14
|
export * from "./victory-primitives";
|
|
12
|
-
export { Border as Box } from "./victory-primitives";
|
|
13
|
-
export
|
|
14
|
-
export *
|
|
15
|
-
|
|
16
|
-
export * as DefaultTransitions from "./victory-util/default-transitions";
|
|
17
|
-
export * as Domain from "./victory-util/domain";
|
|
18
|
-
export * as Events from "./victory-util/events";
|
|
19
|
-
export * as Helpers from "./victory-util/helpers";
|
|
20
|
-
export * as Immutable from "./victory-util/immutable";
|
|
21
|
-
export * as LabelHelpers from "./victory-util/label-helpers";
|
|
22
|
-
export * as Log from "./victory-util/log";
|
|
23
|
-
export * as PropTypes from "./victory-util/prop-types";
|
|
24
|
-
export * as Scale from "./victory-util/scale";
|
|
25
|
-
export * as Selection from "./victory-util/selection";
|
|
26
|
-
export * as Style from "./victory-util/style";
|
|
27
|
-
export * as TextSize from "./victory-util/textsize";
|
|
28
|
-
export * as Transitions from "./victory-util/transitions";
|
|
29
|
-
export * as UserProps from "./victory-util/user-props";
|
|
30
|
-
export * as CommonProps from "./victory-util/common-props";
|
|
31
|
-
export * as Wrapper from "./victory-util/wrapper";
|
|
32
|
-
export * as Axis from "./victory-util/axis";
|
|
33
|
-
export * as Hooks from "./victory-util/hooks";
|
|
34
|
-
export * as LineHelpers from "./victory-util/line-helpers";
|
|
35
|
-
export { default as Timer } from "./victory-util/timer";
|
|
36
|
-
export * as PointPathHelpers from "./victory-util/point-path-helpers";
|
|
37
|
-
export { default as TimerContext } from "./victory-util/timer-context";
|
|
38
|
-
export * from "./victory-util/types";
|
|
15
|
+
export { Border as Box, type BorderProps as BoxProps, } from "./victory-primitives";
|
|
16
|
+
export * from "./victory-util";
|
|
17
|
+
export * from "./victory-state";
|
|
18
|
+
//# sourceMappingURL=index.d.ts.map
|
package/lib/index.js
CHANGED
|
@@ -4,59 +4,41 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
var _exportNames = {
|
|
7
|
-
Box: true
|
|
8
|
-
addEvents: true,
|
|
9
|
-
Collection: true,
|
|
10
|
-
Data: true,
|
|
11
|
-
DefaultTransitions: true,
|
|
12
|
-
Domain: true,
|
|
13
|
-
Events: true,
|
|
14
|
-
Helpers: true,
|
|
15
|
-
Immutable: true,
|
|
16
|
-
LabelHelpers: true,
|
|
17
|
-
Log: true,
|
|
18
|
-
PropTypes: true,
|
|
19
|
-
Scale: true,
|
|
20
|
-
Selection: true,
|
|
21
|
-
Style: true,
|
|
22
|
-
TextSize: true,
|
|
23
|
-
Transitions: true,
|
|
24
|
-
UserProps: true,
|
|
25
|
-
CommonProps: true,
|
|
26
|
-
Wrapper: true,
|
|
27
|
-
Axis: true,
|
|
28
|
-
Hooks: true,
|
|
29
|
-
LineHelpers: true,
|
|
30
|
-
Timer: true,
|
|
31
|
-
PointPathHelpers: true,
|
|
32
|
-
TimerContext: true
|
|
7
|
+
Box: true
|
|
33
8
|
};
|
|
34
|
-
exports.Axis = void 0;
|
|
35
9
|
Object.defineProperty(exports, "Box", {
|
|
36
10
|
enumerable: true,
|
|
37
11
|
get: function () {
|
|
38
12
|
return _victoryPrimitives.Border;
|
|
39
13
|
}
|
|
40
14
|
});
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
Object.defineProperty(exports,
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
15
|
+
|
|
16
|
+
var _callbacks = require("./types/callbacks");
|
|
17
|
+
|
|
18
|
+
Object.keys(_callbacks).forEach(function (key) {
|
|
19
|
+
if (key === "default" || key === "__esModule") return;
|
|
20
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
21
|
+
if (key in exports && exports[key] === _callbacks[key]) return;
|
|
22
|
+
Object.defineProperty(exports, key, {
|
|
23
|
+
enumerable: true,
|
|
24
|
+
get: function () {
|
|
25
|
+
return _callbacks[key];
|
|
26
|
+
}
|
|
27
|
+
});
|
|
53
28
|
});
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
29
|
+
|
|
30
|
+
var _propTypes = require("./types/prop-types");
|
|
31
|
+
|
|
32
|
+
Object.keys(_propTypes).forEach(function (key) {
|
|
33
|
+
if (key === "default" || key === "__esModule") return;
|
|
34
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
35
|
+
if (key in exports && exports[key] === _propTypes[key]) return;
|
|
36
|
+
Object.defineProperty(exports, key, {
|
|
37
|
+
enumerable: true,
|
|
38
|
+
get: function () {
|
|
39
|
+
return _propTypes[key];
|
|
40
|
+
}
|
|
41
|
+
});
|
|
60
42
|
});
|
|
61
43
|
|
|
62
44
|
var _victoryAccessibleGroup = require("./victory-accessible-group/victory-accessible-group");
|
|
@@ -143,6 +125,20 @@ Object.keys(_victoryClipContainer).forEach(function (key) {
|
|
|
143
125
|
});
|
|
144
126
|
});
|
|
145
127
|
|
|
128
|
+
var _types = require("./victory-theme/types");
|
|
129
|
+
|
|
130
|
+
Object.keys(_types).forEach(function (key) {
|
|
131
|
+
if (key === "default" || key === "__esModule") return;
|
|
132
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
133
|
+
if (key in exports && exports[key] === _types[key]) return;
|
|
134
|
+
Object.defineProperty(exports, key, {
|
|
135
|
+
enumerable: true,
|
|
136
|
+
get: function () {
|
|
137
|
+
return _types[key];
|
|
138
|
+
}
|
|
139
|
+
});
|
|
140
|
+
});
|
|
141
|
+
|
|
146
142
|
var _victoryTheme = require("./victory-theme/victory-theme");
|
|
147
143
|
|
|
148
144
|
Object.keys(_victoryTheme).forEach(function (key) {
|
|
@@ -213,116 +209,31 @@ Object.keys(_victoryPrimitives).forEach(function (key) {
|
|
|
213
209
|
});
|
|
214
210
|
});
|
|
215
211
|
|
|
216
|
-
var
|
|
217
|
-
|
|
218
|
-
var _Collection = _interopRequireWildcard(require("./victory-util/collection"));
|
|
219
|
-
|
|
220
|
-
exports.Collection = _Collection;
|
|
221
|
-
|
|
222
|
-
var _Data = _interopRequireWildcard(require("./victory-util/data"));
|
|
223
|
-
|
|
224
|
-
exports.Data = _Data;
|
|
225
|
-
|
|
226
|
-
var _DefaultTransitions = _interopRequireWildcard(require("./victory-util/default-transitions"));
|
|
227
|
-
|
|
228
|
-
exports.DefaultTransitions = _DefaultTransitions;
|
|
229
|
-
|
|
230
|
-
var _Domain = _interopRequireWildcard(require("./victory-util/domain"));
|
|
231
|
-
|
|
232
|
-
exports.Domain = _Domain;
|
|
233
|
-
|
|
234
|
-
var _Events = _interopRequireWildcard(require("./victory-util/events"));
|
|
212
|
+
var _victoryUtil = require("./victory-util");
|
|
235
213
|
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
var _Helpers = _interopRequireWildcard(require("./victory-util/helpers"));
|
|
239
|
-
|
|
240
|
-
exports.Helpers = _Helpers;
|
|
241
|
-
|
|
242
|
-
var _Immutable = _interopRequireWildcard(require("./victory-util/immutable"));
|
|
243
|
-
|
|
244
|
-
exports.Immutable = _Immutable;
|
|
245
|
-
|
|
246
|
-
var _LabelHelpers = _interopRequireWildcard(require("./victory-util/label-helpers"));
|
|
247
|
-
|
|
248
|
-
exports.LabelHelpers = _LabelHelpers;
|
|
249
|
-
|
|
250
|
-
var _Log = _interopRequireWildcard(require("./victory-util/log"));
|
|
251
|
-
|
|
252
|
-
exports.Log = _Log;
|
|
253
|
-
|
|
254
|
-
var _PropTypes = _interopRequireWildcard(require("./victory-util/prop-types"));
|
|
255
|
-
|
|
256
|
-
exports.PropTypes = _PropTypes;
|
|
257
|
-
|
|
258
|
-
var _Scale = _interopRequireWildcard(require("./victory-util/scale"));
|
|
259
|
-
|
|
260
|
-
exports.Scale = _Scale;
|
|
261
|
-
|
|
262
|
-
var _Selection = _interopRequireWildcard(require("./victory-util/selection"));
|
|
263
|
-
|
|
264
|
-
exports.Selection = _Selection;
|
|
265
|
-
|
|
266
|
-
var _Style = _interopRequireWildcard(require("./victory-util/style"));
|
|
267
|
-
|
|
268
|
-
exports.Style = _Style;
|
|
269
|
-
|
|
270
|
-
var _TextSize = _interopRequireWildcard(require("./victory-util/textsize"));
|
|
271
|
-
|
|
272
|
-
exports.TextSize = _TextSize;
|
|
273
|
-
|
|
274
|
-
var _Transitions = _interopRequireWildcard(require("./victory-util/transitions"));
|
|
275
|
-
|
|
276
|
-
exports.Transitions = _Transitions;
|
|
277
|
-
|
|
278
|
-
var _UserProps = _interopRequireWildcard(require("./victory-util/user-props"));
|
|
279
|
-
|
|
280
|
-
exports.UserProps = _UserProps;
|
|
281
|
-
|
|
282
|
-
var _CommonProps = _interopRequireWildcard(require("./victory-util/common-props"));
|
|
283
|
-
|
|
284
|
-
exports.CommonProps = _CommonProps;
|
|
285
|
-
|
|
286
|
-
var _Wrapper = _interopRequireWildcard(require("./victory-util/wrapper"));
|
|
287
|
-
|
|
288
|
-
exports.Wrapper = _Wrapper;
|
|
289
|
-
|
|
290
|
-
var _Axis = _interopRequireWildcard(require("./victory-util/axis"));
|
|
291
|
-
|
|
292
|
-
exports.Axis = _Axis;
|
|
293
|
-
|
|
294
|
-
var _Hooks = _interopRequireWildcard(require("./victory-util/hooks"));
|
|
295
|
-
|
|
296
|
-
exports.Hooks = _Hooks;
|
|
297
|
-
|
|
298
|
-
var _LineHelpers = _interopRequireWildcard(require("./victory-util/line-helpers"));
|
|
299
|
-
|
|
300
|
-
exports.LineHelpers = _LineHelpers;
|
|
301
|
-
|
|
302
|
-
var _timer = _interopRequireDefault(require("./victory-util/timer"));
|
|
303
|
-
|
|
304
|
-
var _PointPathHelpers = _interopRequireWildcard(require("./victory-util/point-path-helpers"));
|
|
305
|
-
|
|
306
|
-
exports.PointPathHelpers = _PointPathHelpers;
|
|
307
|
-
|
|
308
|
-
var _timerContext = _interopRequireDefault(require("./victory-util/timer-context"));
|
|
309
|
-
|
|
310
|
-
var _types = require("./victory-util/types");
|
|
311
|
-
|
|
312
|
-
Object.keys(_types).forEach(function (key) {
|
|
214
|
+
Object.keys(_victoryUtil).forEach(function (key) {
|
|
313
215
|
if (key === "default" || key === "__esModule") return;
|
|
314
216
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
315
|
-
if (key in exports && exports[key] ===
|
|
217
|
+
if (key in exports && exports[key] === _victoryUtil[key]) return;
|
|
316
218
|
Object.defineProperty(exports, key, {
|
|
317
219
|
enumerable: true,
|
|
318
220
|
get: function () {
|
|
319
|
-
return
|
|
221
|
+
return _victoryUtil[key];
|
|
320
222
|
}
|
|
321
223
|
});
|
|
322
224
|
});
|
|
323
225
|
|
|
324
|
-
|
|
226
|
+
var _victoryState = require("./victory-state");
|
|
325
227
|
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
228
|
+
Object.keys(_victoryState).forEach(function (key) {
|
|
229
|
+
if (key === "default" || key === "__esModule") return;
|
|
230
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
231
|
+
if (key in exports && exports[key] === _victoryState[key]) return;
|
|
232
|
+
Object.defineProperty(exports, key, {
|
|
233
|
+
enumerable: true,
|
|
234
|
+
get: function () {
|
|
235
|
+
return _victoryState[key];
|
|
236
|
+
}
|
|
237
|
+
});
|
|
238
|
+
});
|
|
239
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { D3Scale, Datum, ID } from "./prop-types";
|
|
2
|
+
import { BlockProps, OrientationTypes } from "../victory-theme/types";
|
|
1
3
|
/**
|
|
2
4
|
* This is the first parameter of a callback when a callback is used to
|
|
3
5
|
* resolve the value of a property instead of a concrete value.
|
|
@@ -5,13 +7,12 @@
|
|
|
5
7
|
* Note that additional properties here like `scale`, `x`, `y`, etc are resolved
|
|
6
8
|
* values of properties from the VictoryXXXProps for each component.
|
|
7
9
|
*/
|
|
8
|
-
import type { D3Scale } from "./victory-util/types";
|
|
9
10
|
export interface CallbackArgs {
|
|
10
11
|
active?: boolean;
|
|
11
|
-
data?:
|
|
12
|
-
datum?:
|
|
12
|
+
data?: Datum[];
|
|
13
|
+
datum?: Datum;
|
|
13
14
|
horizontal?: boolean;
|
|
14
|
-
index:
|
|
15
|
+
index: ID;
|
|
15
16
|
x?: number;
|
|
16
17
|
y?: number;
|
|
17
18
|
scale?: {
|
|
@@ -27,7 +28,10 @@ export declare type VictoryStringCallback = (args: CallbackArgs) => string;
|
|
|
27
28
|
export declare type StringOrNumberOrCallback = string | number | VictoryStringOrNumberCallback;
|
|
28
29
|
export declare type StringOrCallback = string | VictoryStringCallback;
|
|
29
30
|
export declare type SliceNumberOrCallback<T, P extends string | number | symbol = never> = number | ((props: Omit<T, P>) => number);
|
|
30
|
-
export declare type
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
export declare type VictoryNumberCallback = (args: CallbackArgs) => number;
|
|
32
|
+
export declare type VictoryPaddingCallback = (args: CallbackArgs) => number | BlockProps;
|
|
33
|
+
export declare type VictoryOrientationCallback = (args: CallbackArgs) => OrientationTypes;
|
|
34
|
+
export declare type NumberOrCallback = number | VictoryNumberCallback;
|
|
35
|
+
export declare type PaddingOrCallback = number | BlockProps | VictoryPaddingCallback;
|
|
36
|
+
export declare type OrientationOrCallback = OrientationTypes | VictoryOrientationCallback;
|
|
37
|
+
//# sourceMappingURL=callbacks.d.ts.map
|