victory-core 36.6.2 → 36.6.5
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/CHANGELOG.md +27 -0
- package/dist/victory-core.js +2053 -4568
- package/dist/victory-core.min.js +1 -1
- package/es/index.d.ts +0 -1
- package/es/index.js +1 -3
- package/es/types/callbacks.d.ts +0 -1
- package/es/types/callbacks.js +1 -2
- package/es/types/prop-types.d.ts +3 -3
- package/es/types/prop-types.js +1 -2
- package/es/v37/clone.d.ts +23 -0
- package/es/v37/clone.js +32 -0
- package/es/v37/index.d.ts +5 -0
- package/es/v37/index.js +4 -0
- package/es/{victory-state → v37/victory-state}/defaults.d.ts +0 -0
- package/es/v37/victory-state/defaults.js +2 -0
- package/es/v37/victory-state/helpers/get-axis-data.d.ts +3 -0
- package/es/{victory-state → v37/victory-state}/helpers/get-axis-data.js +2 -3
- package/es/{victory-state → v37/victory-state}/helpers/get-data.d.ts +1 -1
- package/es/{victory-state → v37/victory-state}/helpers/get-data.js +2 -3
- package/{lib → es/v37}/victory-state/helpers/get-domain.d.ts +1 -1
- package/es/{victory-state → v37/victory-state}/helpers/get-domain.js +2 -3
- package/{lib → es/v37}/victory-state/helpers/get-range.d.ts +1 -1
- package/es/{victory-state → v37/victory-state}/helpers/get-range.js +3 -4
- package/{lib → es/v37}/victory-state/helpers/get-scale.d.ts +1 -1
- package/es/{victory-state → v37/victory-state}/helpers/get-scale.js +3 -4
- package/es/v37/victory-state/index.d.ts +4 -0
- package/es/{victory-state → v37/victory-state}/index.js +1 -1
- package/{lib → es/v37}/victory-state/types.d.ts +2 -2
- package/es/v37/victory-state/types.js +1 -0
- package/{lib → es/v37}/victory-state/victory-provider.d.ts +5 -4
- package/es/{victory-state → v37/victory-state}/victory-provider.js +59 -29
- package/es/v37/victory-state/with-victory-provider.d.ts +7 -0
- package/es/v37/victory-state/with-victory-provider.js +43 -0
- package/es/{victory-util → v37}/with-container.d.ts +2 -2
- package/es/{victory-util → v37}/with-container.js +2 -3
- package/es/v37/with-normalized-props.d.ts +17 -0
- package/es/v37/with-normalized-props.js +18 -0
- package/es/victory-accessible-group/victory-accessible-group.js +1 -2
- package/es/victory-animation/util.js +1 -2
- package/es/victory-animation/victory-animation.js +1 -2
- package/es/victory-clip-container/victory-clip-container.js +1 -2
- package/es/victory-container/victory-container.js +1 -2
- package/es/victory-label/victory-label.d.ts +5 -4
- package/es/victory-label/victory-label.js +1 -2
- package/es/victory-portal/portal-context.js +1 -2
- package/es/victory-portal/portal.js +1 -2
- package/es/victory-portal/victory-portal.js +1 -2
- package/es/victory-primitives/arc.js +1 -2
- package/es/victory-primitives/background.js +1 -2
- package/es/victory-primitives/border.js +1 -2
- package/es/victory-primitives/circle.js +1 -2
- package/es/victory-primitives/clip-path.js +1 -2
- package/es/victory-primitives/index.js +1 -2
- package/es/victory-primitives/line-segment.js +1 -2
- package/es/victory-primitives/line.js +1 -2
- package/es/victory-primitives/path.js +1 -2
- package/es/victory-primitives/point.js +1 -2
- package/es/victory-primitives/rect.js +1 -2
- package/es/victory-primitives/text.js +1 -2
- package/es/victory-primitives/tspan.js +1 -2
- package/es/victory-primitives/types.js +1 -2
- package/es/victory-primitives/whisker.js +1 -2
- package/es/victory-theme/grayscale.js +1 -2
- package/es/victory-theme/material.js +1 -2
- package/es/victory-theme/types.js +1 -2
- package/es/victory-theme/victory-theme.js +1 -2
- package/es/victory-transition/victory-transition.js +1 -2
- package/es/victory-util/add-events.js +1 -2
- package/es/victory-util/axis.js +1 -2
- package/es/victory-util/collection.js +1 -2
- package/es/victory-util/common-props.js +1 -2
- package/es/victory-util/data.js +1 -2
- package/es/victory-util/default-transitions.js +1 -2
- package/es/victory-util/domain.js +1 -2
- package/es/victory-util/events.js +1 -2
- package/es/victory-util/helpers.d.ts +3 -2
- package/es/victory-util/helpers.js +1 -2
- package/es/victory-util/hooks/index.js +1 -2
- package/es/victory-util/hooks/use-animation-state.js +1 -2
- package/es/victory-util/hooks/use-previous-props.js +1 -2
- package/es/victory-util/immutable-types.d.ts +2523 -0
- package/es/victory-util/immutable.d.ts +1 -1
- package/es/victory-util/immutable.js +1 -2
- package/es/victory-util/index.d.ts +0 -1
- package/es/victory-util/index.js +1 -3
- package/es/victory-util/label-helpers.js +1 -2
- package/es/victory-util/line-helpers.js +1 -2
- package/es/victory-util/log.js +1 -2
- package/es/victory-util/point-path-helpers.js +1 -2
- package/es/victory-util/prop-types.js +1 -2
- package/es/victory-util/scale.js +1 -2
- package/es/victory-util/selection.js +1 -2
- package/es/victory-util/style.js +1 -2
- package/es/victory-util/textsize.js +1 -2
- package/es/victory-util/timer-context.js +1 -2
- package/es/victory-util/timer.js +1 -2
- package/es/victory-util/transitions.js +1 -2
- package/es/victory-util/type-helpers.js +1 -2
- package/es/victory-util/user-props.js +1 -2
- package/es/victory-util/wrapper.js +1 -2
- package/lib/index.d.ts +0 -1
- package/lib/index.js +1 -16
- package/lib/types/callbacks.d.ts +0 -1
- package/lib/types/callbacks.js +1 -2
- package/lib/types/prop-types.d.ts +3 -3
- package/lib/types/prop-types.js +1 -2
- package/lib/v37/clone.d.ts +23 -0
- package/lib/v37/clone.js +43 -0
- package/lib/v37/index.d.ts +5 -0
- package/lib/v37/index.js +57 -0
- package/lib/{victory-state → v37/victory-state}/defaults.d.ts +0 -0
- package/lib/{victory-state → v37/victory-state}/defaults.js +1 -2
- package/lib/v37/victory-state/helpers/get-axis-data.d.ts +3 -0
- package/lib/{victory-state → v37/victory-state}/helpers/get-axis-data.js +2 -3
- package/lib/{victory-state → v37/victory-state}/helpers/get-data.d.ts +1 -1
- package/lib/{victory-state → v37/victory-state}/helpers/get-data.js +2 -3
- package/{es → lib/v37}/victory-state/helpers/get-domain.d.ts +1 -1
- package/lib/{victory-state → v37/victory-state}/helpers/get-domain.js +2 -3
- package/{es → lib/v37}/victory-state/helpers/get-range.d.ts +1 -1
- package/lib/{victory-state → v37/victory-state}/helpers/get-range.js +3 -4
- package/{es → lib/v37}/victory-state/helpers/get-scale.d.ts +1 -1
- package/lib/{victory-state → v37/victory-state}/helpers/get-scale.js +3 -4
- package/lib/v37/victory-state/index.d.ts +4 -0
- package/lib/{victory-state → v37/victory-state}/index.js +13 -1
- package/{es → lib/v37}/victory-state/types.d.ts +2 -2
- package/lib/v37/victory-state/types.js +1 -0
- package/{es → lib/v37}/victory-state/victory-provider.d.ts +5 -4
- package/lib/{victory-state → v37/victory-state}/victory-provider.js +61 -30
- package/lib/v37/victory-state/with-victory-provider.d.ts +7 -0
- package/lib/v37/victory-state/with-victory-provider.js +56 -0
- package/lib/{victory-util → v37}/with-container.d.ts +2 -2
- package/lib/{victory-util → v37}/with-container.js +2 -3
- package/lib/v37/with-normalized-props.d.ts +17 -0
- package/lib/v37/with-normalized-props.js +29 -0
- package/lib/victory-accessible-group/victory-accessible-group.js +1 -2
- package/lib/victory-animation/util.js +1 -2
- package/lib/victory-animation/victory-animation.js +1 -2
- package/lib/victory-clip-container/victory-clip-container.js +1 -2
- package/lib/victory-container/victory-container.js +1 -2
- package/lib/victory-label/victory-label.d.ts +5 -4
- package/lib/victory-label/victory-label.js +1 -2
- package/lib/victory-portal/portal-context.js +1 -2
- package/lib/victory-portal/portal.js +1 -2
- package/lib/victory-portal/victory-portal.js +1 -2
- package/lib/victory-primitives/arc.js +1 -2
- package/lib/victory-primitives/background.js +1 -2
- package/lib/victory-primitives/border.js +1 -2
- package/lib/victory-primitives/circle.js +1 -2
- package/lib/victory-primitives/clip-path.js +1 -2
- package/lib/victory-primitives/index.js +1 -2
- package/lib/victory-primitives/line-segment.js +1 -2
- package/lib/victory-primitives/line.js +1 -2
- package/lib/victory-primitives/path.js +1 -2
- package/lib/victory-primitives/point.js +1 -2
- package/lib/victory-primitives/rect.js +1 -2
- package/lib/victory-primitives/text.js +1 -2
- package/lib/victory-primitives/tspan.js +1 -2
- package/lib/victory-primitives/types.js +1 -2
- package/lib/victory-primitives/whisker.js +1 -2
- package/lib/victory-theme/grayscale.js +1 -2
- package/lib/victory-theme/material.js +1 -2
- package/lib/victory-theme/types.js +1 -2
- package/lib/victory-theme/victory-theme.js +1 -2
- package/lib/victory-transition/victory-transition.js +1 -2
- package/lib/victory-util/add-events.js +1 -2
- package/lib/victory-util/axis.js +1 -2
- package/lib/victory-util/collection.js +1 -2
- package/lib/victory-util/common-props.js +1 -2
- package/lib/victory-util/data.js +1 -2
- package/lib/victory-util/default-transitions.js +1 -2
- package/lib/victory-util/domain.js +1 -2
- package/lib/victory-util/events.js +1 -2
- package/lib/victory-util/helpers.d.ts +3 -2
- package/lib/victory-util/helpers.js +1 -2
- package/lib/victory-util/hooks/index.js +1 -2
- package/lib/victory-util/hooks/use-animation-state.js +1 -2
- package/lib/victory-util/hooks/use-previous-props.js +1 -2
- package/lib/victory-util/immutable-types.d.ts +2523 -0
- package/lib/victory-util/immutable.d.ts +1 -1
- package/lib/victory-util/immutable.js +1 -2
- package/lib/victory-util/index.d.ts +0 -1
- package/lib/victory-util/index.js +1 -16
- package/lib/victory-util/label-helpers.js +1 -2
- package/lib/victory-util/line-helpers.js +1 -2
- package/lib/victory-util/log.js +1 -2
- package/lib/victory-util/point-path-helpers.js +1 -2
- package/lib/victory-util/prop-types.js +1 -2
- package/lib/victory-util/scale.js +1 -2
- package/lib/victory-util/selection.js +1 -2
- package/lib/victory-util/style.js +1 -2
- package/lib/victory-util/textsize.js +1 -2
- package/lib/victory-util/timer-context.js +1 -2
- package/lib/victory-util/timer.js +1 -2
- package/lib/victory-util/transitions.js +1 -2
- package/lib/victory-util/type-helpers.js +1 -2
- package/lib/victory-util/user-props.js +1 -2
- package/lib/victory-util/wrapper.js +1 -2
- package/package.json +12 -4
- package/src/index.ts +0 -1
- package/src/types/callbacks.ts +0 -2
- package/src/types/prop-types.ts +4 -3
- package/src/v37/clone.tsx +30 -0
- package/src/v37/index.tsx +4 -0
- package/src/{victory-state → v37/victory-state}/defaults.ts +0 -0
- package/src/{victory-state → v37/victory-state}/helpers/get-axis-data.ts +2 -2
- package/src/{victory-state → v37/victory-state}/helpers/get-data.ts +3 -3
- package/src/{victory-state → v37/victory-state}/helpers/get-domain.ts +2 -2
- package/src/{victory-state → v37/victory-state}/helpers/get-range.ts +3 -3
- package/src/{victory-state → v37/victory-state}/helpers/get-scale.ts +6 -3
- package/src/{victory-state → v37/victory-state}/index.ts +1 -0
- package/src/{victory-state → v37/victory-state}/types.ts +2 -2
- package/src/{victory-state → v37/victory-state}/victory-provider.tsx +61 -27
- package/src/v37/victory-state/with-victory-provider.tsx +53 -0
- package/src/{victory-util → v37}/with-container.tsx +2 -2
- package/src/v37/with-normalized-props.tsx +43 -0
- package/src/victory-label/victory-label.tsx +4 -4
- package/src/victory-util/data.ts +1 -1
- package/src/victory-util/helpers.ts +3 -2
- package/src/victory-util/immutable-types.d.ts +2523 -0
- package/src/victory-util/immutable.ts +1 -1
- package/src/victory-util/index.ts +0 -1
- package/es/victory-state/defaults.js +0 -3
- package/es/victory-state/helpers/get-axis-data.d.ts +0 -3
- package/es/victory-state/index.d.ts +0 -3
- package/es/victory-state/types.js +0 -2
- package/lib/victory-state/helpers/get-axis-data.d.ts +0 -3
- package/lib/victory-state/index.d.ts +0 -3
- package/lib/victory-state/types.js +0 -2
package/es/index.d.ts
CHANGED
|
@@ -15,5 +15,4 @@ export * from "./victory-primitives";
|
|
|
15
15
|
export { Border as Box } from "./victory-primitives";
|
|
16
16
|
export type { BorderProps as BoxProps } from "./victory-primitives";
|
|
17
17
|
export * from "./victory-util";
|
|
18
|
-
export * from "./victory-state";
|
|
19
18
|
//# sourceMappingURL=index.d.ts.map
|
package/es/index.js
CHANGED
|
@@ -13,6 +13,4 @@ export * from "./victory-portal/portal-context";
|
|
|
13
13
|
export * from "./victory-portal/victory-portal";
|
|
14
14
|
export * from "./victory-primitives";
|
|
15
15
|
export { Border as Box } from "./victory-primitives";
|
|
16
|
-
export * from "./victory-util";
|
|
17
|
-
export * from "./victory-state";
|
|
18
|
-
//# sourceMappingURL=index.js.map
|
|
16
|
+
export * from "./victory-util";
|
package/es/types/callbacks.d.ts
CHANGED
|
@@ -34,5 +34,4 @@ export declare type VictoryOrientationCallback = (args: CallbackArgs) => Orienta
|
|
|
34
34
|
export declare type NumberOrCallback = number | VictoryNumberCallback;
|
|
35
35
|
export declare type PaddingOrCallback = number | BlockProps | VictoryPaddingCallback;
|
|
36
36
|
export declare type OrientationOrCallback = OrientationTypes | VictoryOrientationCallback;
|
|
37
|
-
export declare type ValueOrCallback<TValue> = TValue | ((args: CallbackArgs) => TValue);
|
|
38
37
|
//# sourceMappingURL=callbacks.d.ts.map
|
package/es/types/callbacks.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
export {};
|
|
2
|
-
//# sourceMappingURL=callbacks.js.map
|
|
1
|
+
export {};
|
package/es/types/prop-types.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { ScaleLinear, ScaleLogarithmic, ScalePower, ScaleTime } from "victory-vendor/d3-scale";
|
|
3
3
|
import { AnimationEasing, AnimationStyle } from "../victory-animation/victory-animation";
|
|
4
|
-
import { StringOrNumberOrCallback } from "./callbacks";
|
|
4
|
+
import { CallbackArgs, StringOrNumberOrCallback } from "./callbacks";
|
|
5
5
|
export declare type AxisType = "x" | "y";
|
|
6
6
|
export declare type DatumValue = number | string | Date | null | undefined;
|
|
7
7
|
export declare type Datum = any;
|
|
@@ -10,7 +10,7 @@ export declare type ForAxes<T> = T | {
|
|
|
10
10
|
y?: T;
|
|
11
11
|
};
|
|
12
12
|
export declare type ID = number | string;
|
|
13
|
-
export declare type ValueOrAccessor<ValueType
|
|
13
|
+
export declare type ValueOrAccessor<ValueType, PropsType = CallbackArgs> = ValueType | ((props: PropsType) => ValueType);
|
|
14
14
|
export declare type Tuple<T> = [T, T];
|
|
15
15
|
export declare type ValueOrAxes<T> = T | ForAxes<T>;
|
|
16
16
|
export declare type DomainPaddingPropType = ValueOrAxes<PaddingType>;
|
|
@@ -105,7 +105,7 @@ export declare type CategoryPropType = string[] | {
|
|
|
105
105
|
x: string[];
|
|
106
106
|
y: string[];
|
|
107
107
|
};
|
|
108
|
-
export declare type DataGetterPropType = ValueOrAccessor<string | string[] | number | number[]>;
|
|
108
|
+
export declare type DataGetterPropType = ValueOrAccessor<string | string[] | number | number[], any>;
|
|
109
109
|
export declare type InterpolationPropType = "basis" | "basisClosed" | "basisOpen" | "bundle" | "cardinal" | "cardinalClosed" | "cardinalOpen" | "catmullRom" | "catmullRomClosed" | "catmullRomOpen" | "linear" | "linearClosed" | "monotoneX" | "monotoneY" | "natural" | "radial" | "step" | "stepAfter" | "stepBefore";
|
|
110
110
|
export declare type ColorScalePropType = "grayscale" | "qualitative" | "heatmap" | "warm" | "cool" | "red" | "green" | "blue" | string[];
|
|
111
111
|
export declare type SortOrderPropType = "ascending" | "descending";
|
package/es/types/prop-types.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
export {};
|
|
2
|
-
//# sourceMappingURL=prop-types.js.map
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
/**
|
|
3
|
+
* Syntax sugar for `React.cloneElement`, so that we can use JSX instead
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* // Before:
|
|
7
|
+
* const children = React.cloneElement(props.groupComponent, { prop2 }, props.children);
|
|
8
|
+
* return React.cloneElement(props.containerComponent, { prop1 }, children);
|
|
9
|
+
*
|
|
10
|
+
* // After:
|
|
11
|
+
* return (
|
|
12
|
+
* <Clone element={props.containerComponent} prop1={prop1}>
|
|
13
|
+
* <Clone element={props.groupComponent} prop2={prop2}>
|
|
14
|
+
* {props.children}
|
|
15
|
+
* </Clone>
|
|
16
|
+
* </Clone>
|
|
17
|
+
* );
|
|
18
|
+
*/
|
|
19
|
+
export declare const Clone: <TProps>(props: React.PropsWithChildren<{
|
|
20
|
+
element: React.ReactElement<TProps, string | React.JSXElementConstructor<any>>;
|
|
21
|
+
children?: React.ReactNode | React.ReactNode[];
|
|
22
|
+
} & TProps>) => React.ReactElement<TProps, string | React.JSXElementConstructor<any>>;
|
|
23
|
+
//# sourceMappingURL=clone.d.ts.map
|
package/es/v37/clone.js
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
var _excluded = ["children", "element"];
|
|
2
|
+
|
|
3
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
4
|
+
|
|
5
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
6
|
+
|
|
7
|
+
import React from "react";
|
|
8
|
+
/**
|
|
9
|
+
* Syntax sugar for `React.cloneElement`, so that we can use JSX instead
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* // Before:
|
|
13
|
+
* const children = React.cloneElement(props.groupComponent, { prop2 }, props.children);
|
|
14
|
+
* return React.cloneElement(props.containerComponent, { prop1 }, children);
|
|
15
|
+
*
|
|
16
|
+
* // After:
|
|
17
|
+
* return (
|
|
18
|
+
* <Clone element={props.containerComponent} prop1={prop1}>
|
|
19
|
+
* <Clone element={props.groupComponent} prop2={prop2}>
|
|
20
|
+
* {props.children}
|
|
21
|
+
* </Clone>
|
|
22
|
+
* </Clone>
|
|
23
|
+
* );
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
export var Clone = function (props) {
|
|
27
|
+
var children = props.children,
|
|
28
|
+
element = props.element,
|
|
29
|
+
rest = _objectWithoutProperties(props, _excluded);
|
|
30
|
+
|
|
31
|
+
return /*#__PURE__*/React.cloneElement(element, rest, children);
|
|
32
|
+
};
|
package/es/v37/index.js
ADDED
|
File without changes
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isKeyValueObject } from "
|
|
1
|
+
import { isKeyValueObject } from "../../../victory-util/type-helpers";
|
|
2
2
|
export function getAxisData(data, axis) {
|
|
3
3
|
return data.reduce(function (acc, datum) {
|
|
4
4
|
if (isKeyValueObject(datum)) {
|
|
@@ -11,5 +11,4 @@ export function getAxisData(data, axis) {
|
|
|
11
11
|
|
|
12
12
|
return acc;
|
|
13
13
|
}, []);
|
|
14
|
-
}
|
|
15
|
-
//# sourceMappingURL=get-axis-data.js.map
|
|
14
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DatumValue } from "
|
|
1
|
+
import { DatumValue } from "../../../types/prop-types";
|
|
2
2
|
import { VictoryProviderProps } from "../types";
|
|
3
3
|
declare type DataProps = Pick<VictoryProviderProps, "data" | "x" | "y" | "sortKey" | "sortOrder" | "samples">;
|
|
4
4
|
export interface FormattedDatum {
|
|
@@ -20,7 +20,7 @@ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToAr
|
|
|
20
20
|
|
|
21
21
|
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; }
|
|
22
22
|
|
|
23
|
-
import { isKeyValueObject } from "
|
|
23
|
+
import { isKeyValueObject } from "../../../victory-util/type-helpers";
|
|
24
24
|
|
|
25
25
|
function getValue(datum, key) {
|
|
26
26
|
if (typeof datum === "object") {
|
|
@@ -84,5 +84,4 @@ export function getData() {
|
|
|
84
84
|
}
|
|
85
85
|
|
|
86
86
|
return formattedData;
|
|
87
|
-
}
|
|
88
|
-
//# sourceMappingURL=get-data.js.map
|
|
87
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { VictoryProviderProps } from "../types";
|
|
2
|
-
import { AxisType, DomainTuple } from "
|
|
2
|
+
import { AxisType, DomainTuple } from "../../../types/prop-types";
|
|
3
3
|
declare type DomainProps = Pick<VictoryProviderProps, "data" | "domain" | "maxDomain" | "minDomain" | "includeZero">;
|
|
4
4
|
export declare function getDomain({ data, includeZero, ...props }: DomainProps, axis: AxisType): DomainTuple;
|
|
5
5
|
export {};
|
|
@@ -18,7 +18,7 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
18
18
|
|
|
19
19
|
import * as d3Array from "victory-vendor/d3-array";
|
|
20
20
|
import { getAxisData } from "./get-axis-data";
|
|
21
|
-
import { getValueForAxis, isDate, isTuple } from "
|
|
21
|
+
import { getValueForAxis, isDate, isTuple } from "../../../victory-util/type-helpers";
|
|
22
22
|
// TODO: What should this default value be?
|
|
23
23
|
var DEFAULT_MIN = 0;
|
|
24
24
|
var DEFAULT_MAX = 1;
|
|
@@ -64,5 +64,4 @@ export function getDomain(_ref, axis) {
|
|
|
64
64
|
|
|
65
65
|
|
|
66
66
|
return getDomainFromMinMax(minDomain, maxDomain);
|
|
67
|
-
}
|
|
68
|
-
//# sourceMappingURL=get-domain.js.map
|
|
67
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AxisType } from "
|
|
1
|
+
import { AxisType } from "../../../types/prop-types";
|
|
2
2
|
import { VictoryProviderProps } from "../types";
|
|
3
3
|
declare type RangeProps = Pick<VictoryProviderProps, "range" | "padding" | "height" | "width">;
|
|
4
4
|
export declare function getRange({ range, height, width, ...props }: RangeProps, axis: AxisType): number[];
|
|
@@ -4,8 +4,8 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
|
|
|
4
4
|
|
|
5
5
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
6
6
|
|
|
7
|
-
import { getPadding } from "
|
|
8
|
-
import { getValueForAxis, isTuple } from "
|
|
7
|
+
import { getPadding } from "../../../victory-util/helpers";
|
|
8
|
+
import { getValueForAxis, isTuple } from "../../../victory-util/type-helpers";
|
|
9
9
|
// TODO: Should we store these defaults somewhere?
|
|
10
10
|
var DEFAULT_HEIGHT = 300;
|
|
11
11
|
var DEFAULT_WIDTH = 450; // TODO: This does not include polar range
|
|
@@ -33,5 +33,4 @@ export function getRange(_ref, axis) {
|
|
|
33
33
|
y: [height - padding.top, padding.bottom]
|
|
34
34
|
};
|
|
35
35
|
return rangeForAxis[axis];
|
|
36
|
-
}
|
|
37
|
-
//# sourceMappingURL=get-range.js.map
|
|
36
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AxisType, D3ScaleFn } from "
|
|
1
|
+
import { AxisType, D3ScaleFn } from "../../../types/prop-types";
|
|
2
2
|
import { VictoryProviderProps } from "../types";
|
|
3
3
|
declare type ScaleProps = Pick<VictoryProviderProps, "data" | "scale">;
|
|
4
4
|
export declare function getScale({ data, ...props }: ScaleProps, axis: AxisType): D3ScaleFn;
|
|
@@ -5,8 +5,8 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
|
|
|
5
5
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
6
6
|
|
|
7
7
|
import { scaleLinear, scaleTime, scaleLog, scaleSqrt } from "victory-vendor/d3-scale";
|
|
8
|
-
import * as Collection from "
|
|
9
|
-
import { getValueForAxis, isFunction } from "
|
|
8
|
+
import * as Collection from "../../../victory-util/collection";
|
|
9
|
+
import { getValueForAxis, isFunction } from "../../../victory-util/type-helpers";
|
|
10
10
|
import { getAxisData } from "./get-axis-data";
|
|
11
11
|
var DEFAULT_SCALE = scaleLinear;
|
|
12
12
|
|
|
@@ -55,5 +55,4 @@ export function getScale(_ref, axis) {
|
|
|
55
55
|
}
|
|
56
56
|
|
|
57
57
|
return DEFAULT_SCALE;
|
|
58
|
-
}
|
|
59
|
-
//# sourceMappingURL=get-scale.js.map
|
|
58
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { D3ScaleFn, Datum, DomainTuple, RangeTuple, ScalePropType, ValueOrAxes } from "
|
|
3
|
-
import { PaddingProps } from "
|
|
2
|
+
import { D3ScaleFn, Datum, DomainTuple, RangeTuple, ScalePropType, ValueOrAxes } from "../../types/prop-types";
|
|
3
|
+
import { PaddingProps } from "../../victory-theme/types";
|
|
4
4
|
export interface VictoryCalculatedStateProps {
|
|
5
5
|
data?: Datum[];
|
|
6
6
|
domain?: ValueOrAxes<DomainTuple>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { D3ScaleFn, DomainTuple, ForAxes } from "
|
|
2
|
+
import { D3ScaleFn, DomainTuple, ForAxes } from "../../types/prop-types";
|
|
3
3
|
import { FormattedDatum } from "./helpers/get-data";
|
|
4
4
|
import { VictoryCalculatedStateProps, VictoryProviderProps } from "./types";
|
|
5
5
|
declare type ScaleType = Required<ForAxes<D3ScaleFn>>;
|
|
@@ -8,13 +8,14 @@ export interface ContextType {
|
|
|
8
8
|
data: FormattedDatum[];
|
|
9
9
|
scale: ScaleType;
|
|
10
10
|
domain: DomainType;
|
|
11
|
-
|
|
11
|
+
updateChildProps: (id: symbol, props: VictoryProviderProps | null) => void;
|
|
12
12
|
}
|
|
13
|
-
export declare function VictoryProvider({ children, ...
|
|
13
|
+
export declare function VictoryProvider({ children, ...providerProps }: VictoryProviderProps): JSX.Element;
|
|
14
|
+
export declare function useVictoryContextMaybe<T>(selector: (value: ContextType | null) => T): T;
|
|
14
15
|
export declare function useVictoryContext<T>(selector: (value: ContextType) => T): T;
|
|
15
16
|
export declare function useScale(): ScaleType;
|
|
16
17
|
export declare function useData(): FormattedDatum[];
|
|
17
18
|
export declare function useDomain(): DomainType;
|
|
18
|
-
export declare function useVictoryProviderSync(
|
|
19
|
+
export declare function useVictoryProviderSync(props: VictoryCalculatedStateProps): void;
|
|
19
20
|
export {};
|
|
20
21
|
//# sourceMappingURL=victory-provider.d.ts.map
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
var _excluded = ["children"];
|
|
2
2
|
|
|
3
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
4
|
+
|
|
5
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
6
|
+
|
|
3
7
|
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; }
|
|
4
8
|
|
|
5
9
|
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; }
|
|
@@ -18,10 +22,6 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
|
|
|
18
22
|
|
|
19
23
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
20
24
|
|
|
21
|
-
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
22
|
-
|
|
23
|
-
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
24
|
-
|
|
25
25
|
import * as React from "react";
|
|
26
26
|
import { createContext, useContext } from "react";
|
|
27
27
|
import { getData } from "./helpers/get-data";
|
|
@@ -29,21 +29,31 @@ import { getDomain } from "./helpers/get-domain";
|
|
|
29
29
|
import { getRange } from "./helpers/get-range";
|
|
30
30
|
import { getScale } from "./helpers/get-scale";
|
|
31
31
|
var VictoryContext = /*#__PURE__*/createContext(null);
|
|
32
|
-
export function VictoryProvider(_ref) {
|
|
33
|
-
var children = _ref.children,
|
|
34
|
-
initialProps = _objectWithoutProperties(_ref, _excluded);
|
|
35
32
|
|
|
36
|
-
|
|
37
|
-
var _React$useState = React.useState(
|
|
33
|
+
function useNormalizedProps() {
|
|
34
|
+
var _React$useState = React.useState({}),
|
|
38
35
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
39
|
-
|
|
40
|
-
|
|
36
|
+
collectedProps = _React$useState2[0],
|
|
37
|
+
setCollectedProps = _React$useState2[1];
|
|
38
|
+
|
|
39
|
+
var updateChildProps = React.useCallback(function (id, newProps) {
|
|
40
|
+
setCollectedProps(function (prev) {
|
|
41
|
+
var result = _objectSpread({}, prev);
|
|
41
42
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
43
|
+
if (newProps === null) {
|
|
44
|
+
delete result[id];
|
|
45
|
+
} else {
|
|
46
|
+
result[id] = newProps;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
return result;
|
|
45
50
|
});
|
|
46
|
-
}, []);
|
|
51
|
+
}, []); // TEMP: combine all props into a single result:
|
|
52
|
+
// TODO: instead, we should intelligently aggregate all these props
|
|
53
|
+
|
|
54
|
+
var props = Object.values(collectedProps).reduce(function (result, childProps) {
|
|
55
|
+
return Object.assign(result, childProps);
|
|
56
|
+
}, {});
|
|
47
57
|
var data = React.useMemo(function () {
|
|
48
58
|
return getData(props);
|
|
49
59
|
}, [props]);
|
|
@@ -71,16 +81,31 @@ export function VictoryProvider(_ref) {
|
|
|
71
81
|
y: yScaleFn
|
|
72
82
|
};
|
|
73
83
|
}, [props, domain, range]);
|
|
74
|
-
var
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
84
|
+
var normalizedProps = React.useMemo(function () {
|
|
85
|
+
return {
|
|
86
|
+
scale: scale,
|
|
87
|
+
data: data,
|
|
88
|
+
domain: domain,
|
|
89
|
+
updateChildProps: updateChildProps
|
|
90
|
+
};
|
|
91
|
+
}, [scale, data, domain, updateChildProps]);
|
|
92
|
+
return normalizedProps;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export function VictoryProvider(_ref) {
|
|
96
|
+
var children = _ref.children,
|
|
97
|
+
providerProps = _objectWithoutProperties(_ref, _excluded);
|
|
98
|
+
|
|
99
|
+
var value = useNormalizedProps(); // TODO: sync the providerProps
|
|
100
|
+
|
|
80
101
|
return /*#__PURE__*/React.createElement(VictoryContext.Provider, {
|
|
81
102
|
value: value
|
|
82
103
|
}, children);
|
|
83
104
|
}
|
|
105
|
+
export function useVictoryContextMaybe(selector) {
|
|
106
|
+
var context = useContext(VictoryContext);
|
|
107
|
+
return selector(context);
|
|
108
|
+
}
|
|
84
109
|
export function useVictoryContext(selector) {
|
|
85
110
|
var context = useContext(VictoryContext);
|
|
86
111
|
|
|
@@ -106,13 +131,18 @@ export function useDomain() {
|
|
|
106
131
|
});
|
|
107
132
|
} // This function keeps props in sync betwen the VictoryProvider and child components
|
|
108
133
|
|
|
109
|
-
export function useVictoryProviderSync(
|
|
110
|
-
var
|
|
111
|
-
return value.
|
|
134
|
+
export function useVictoryProviderSync(props) {
|
|
135
|
+
var updateChildProps = useVictoryContext(function (value) {
|
|
136
|
+
return value.updateChildProps;
|
|
112
137
|
});
|
|
138
|
+
|
|
139
|
+
var _React$useState3 = React.useState(function () {
|
|
140
|
+
return Symbol("UniqueIdFor(VictoryProviderChild)");
|
|
141
|
+
}),
|
|
142
|
+
_React$useState4 = _slicedToArray(_React$useState3, 1),
|
|
143
|
+
myId = _React$useState4[0];
|
|
144
|
+
|
|
113
145
|
React.useEffect(function () {
|
|
114
|
-
|
|
115
|
-
}, []);
|
|
116
|
-
|
|
117
|
-
}
|
|
118
|
-
//# sourceMappingURL=victory-provider.js.map
|
|
146
|
+
updateChildProps(myId, props);
|
|
147
|
+
}, [updateChildProps, props]);
|
|
148
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { VictoryCommonProps } from "../../victory-util/common-props";
|
|
3
|
+
/**
|
|
4
|
+
* Ensures the component is wrapped by a VictoryProvider, if not already.
|
|
5
|
+
*/
|
|
6
|
+
export declare function withVictoryProvider<TComp extends React.FC<TProps>, TProps extends React.PropsWithChildren<VictoryCommonProps>>(Comp: TComp): TComp;
|
|
7
|
+
//# sourceMappingURL=with-victory-provider.d.ts.map
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
+
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { useVictoryContextMaybe, VictoryProvider } from "./victory-provider";
|
|
5
|
+
import { Clone } from "../clone";
|
|
6
|
+
|
|
7
|
+
/* eslint-disable react/prop-types */
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Ensures the component is wrapped by a VictoryProvider, if not already.
|
|
11
|
+
*/
|
|
12
|
+
export function withVictoryProvider(Comp) {
|
|
13
|
+
var WithVictoryProvider = /*#__PURE__*/React.memo(function (props) {
|
|
14
|
+
var updateChildProps = useVictoryContextMaybe(function (value) {
|
|
15
|
+
return value === null || value === void 0 ? void 0 : value.updateChildProps;
|
|
16
|
+
});
|
|
17
|
+
var hasParentProvider = !!updateChildProps;
|
|
18
|
+
React.useEffect(function () {
|
|
19
|
+
if (!hasParentProvider) return;
|
|
20
|
+
var id = Symbol("WithVictoryProvider");
|
|
21
|
+
updateChildProps(id, props); // eslint-disable-next-line consistent-return
|
|
22
|
+
|
|
23
|
+
return function () {
|
|
24
|
+
return updateChildProps(id, null);
|
|
25
|
+
};
|
|
26
|
+
}); // @ts-expect-error "TProps not assignable to LibraryManagedAttributes"
|
|
27
|
+
|
|
28
|
+
var result = /*#__PURE__*/React.createElement(Comp, props, props.children);
|
|
29
|
+
|
|
30
|
+
if (!hasParentProvider) {
|
|
31
|
+
// Wrap with a parent Provider:
|
|
32
|
+
result = /*#__PURE__*/React.createElement(VictoryProvider, null, /*#__PURE__*/React.createElement(Clone, _extends({
|
|
33
|
+
element: props.containerComponent
|
|
34
|
+
}, props), result));
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
return result;
|
|
38
|
+
});
|
|
39
|
+
var name = Comp.displayName || Comp.name;
|
|
40
|
+
WithVictoryProvider.displayName = name ? "WithVictoryProvider(".concat(name, ")") : "WithVictoryProvider"; // @ts-expect-error "WithVictoryProvider does not overlap with TComp"
|
|
41
|
+
|
|
42
|
+
return WithVictoryProvider;
|
|
43
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { VictoryProviderProps } from "
|
|
3
|
-
import { VictoryCommonProps } from "
|
|
2
|
+
import { VictoryProviderProps } from "./victory-state";
|
|
3
|
+
import { VictoryCommonProps } from "../victory-util/common-props";
|
|
4
4
|
export declare function withContainer<Props extends VictoryCommonProps>(WrappedComponent: React.FC<Props>, initialProviderProps?: Partial<VictoryProviderProps>): React.FC<Props>;
|
|
5
5
|
//# sourceMappingURL=with-container.d.ts.map
|
|
@@ -5,7 +5,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
5
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
6
|
|
|
7
7
|
import React from "react";
|
|
8
|
-
import { VictoryProvider } from "
|
|
8
|
+
import { VictoryProvider } from "./victory-state";
|
|
9
9
|
import { VictoryContainer } from "../victory-container/victory-container";
|
|
10
10
|
var defaultProviderProps = {
|
|
11
11
|
width: 450,
|
|
@@ -29,5 +29,4 @@ export function withContainer(WrappedComponent) {
|
|
|
29
29
|
|
|
30
30
|
return /*#__PURE__*/React.createElement(WrappedComponent, props);
|
|
31
31
|
};
|
|
32
|
-
}
|
|
33
|
-
//# sourceMappingURL=with-container.js.map
|
|
32
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { VictoryCommonProps } from "../victory-util/common-props";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { VictoryProviderProps } from "./victory-state";
|
|
4
|
+
declare type FC<TProps> = (props: TProps) => JSX.Element;
|
|
5
|
+
export declare function withNormalizedProps<TProps extends React.PropsWithChildren<VictoryCommonProps>, TDefaultPropKeys extends keyof TProps>(config: {
|
|
6
|
+
displayName: string;
|
|
7
|
+
propTypes?: React.WeakValidationMap<Omit<TProps, keyof VictoryCommonProps>>;
|
|
8
|
+
defaultProps: Pick<TProps, TDefaultPropKeys>;
|
|
9
|
+
/** @deprecated */
|
|
10
|
+
initialProviderProps?: Partial<VictoryProviderProps>;
|
|
11
|
+
}, WrappedComponent: React.FC<TProps>): FC<TProps> & {
|
|
12
|
+
displayName: string;
|
|
13
|
+
defaultProps: Pick<TProps, TDefaultPropKeys>;
|
|
14
|
+
propTypes: React.WeakValidationMap<Omit<TProps, keyof VictoryCommonProps>> | undefined;
|
|
15
|
+
};
|
|
16
|
+
export {};
|
|
17
|
+
//# sourceMappingURL=with-normalized-props.d.ts.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
+
|
|
3
|
+
import React from "react";
|
|
4
|
+
import { useVictoryContext, withVictoryProvider } from "./victory-state";
|
|
5
|
+
export function withNormalizedProps(config, WrappedComponent) {
|
|
6
|
+
WrappedComponent.displayName = config.displayName;
|
|
7
|
+
var WithNormalizedProps = withVictoryProvider(function (props) {
|
|
8
|
+
var normalizedProps = useVictoryContext(function (v) {
|
|
9
|
+
return v;
|
|
10
|
+
});
|
|
11
|
+
return /*#__PURE__*/React.createElement(WrappedComponent, _extends({}, props, normalizedProps), props.children);
|
|
12
|
+
});
|
|
13
|
+
return Object.assign(WithNormalizedProps, {
|
|
14
|
+
displayName: "WithNormalizedProps(".concat(config.displayName),
|
|
15
|
+
defaultProps: config.defaultProps,
|
|
16
|
+
propTypes: config.propTypes
|
|
17
|
+
});
|
|
18
|
+
}
|
|
@@ -275,5 +275,4 @@ VictoryClipContainer.defaultProps = {
|
|
|
275
275
|
rectComponent: /*#__PURE__*/React.createElement(Rect, null),
|
|
276
276
|
clipPathComponent: /*#__PURE__*/React.createElement(ClipPath, null),
|
|
277
277
|
groupComponent: /*#__PURE__*/React.createElement("g", null)
|
|
278
|
-
};
|
|
279
|
-
//# sourceMappingURL=victory-clip-container.js.map
|
|
278
|
+
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { NumberOrCallback, StringOrCallback, StringOrNumberOrCallback
|
|
2
|
+
import { NumberOrCallback, StringOrCallback, StringOrNumberOrCallback } from "../types/callbacks";
|
|
3
|
+
import { ValueOrAccessor } from "../types/prop-types";
|
|
3
4
|
import { PaddingProps, VerticalAnchorType, VictoryLabelStyleObject } from "../victory-theme/victory-theme";
|
|
4
5
|
export declare type TextAnchorType = "start" | "middle" | "end" | "inherit";
|
|
5
6
|
export declare type OriginType = {
|
|
@@ -34,11 +35,11 @@ export interface VictoryLabelProps {
|
|
|
34
35
|
tabIndex?: NumberOrCallback;
|
|
35
36
|
text?: string[] | StringOrNumberOrCallback;
|
|
36
37
|
textComponent?: React.ReactElement;
|
|
37
|
-
textAnchor?:
|
|
38
|
+
textAnchor?: ValueOrAccessor<TextAnchorType>;
|
|
38
39
|
title?: string;
|
|
39
|
-
transform?:
|
|
40
|
+
transform?: ValueOrAccessor<string | object>;
|
|
40
41
|
tspanComponent?: React.ReactElement;
|
|
41
|
-
verticalAnchor?:
|
|
42
|
+
verticalAnchor?: ValueOrAccessor<VerticalAnchorType>;
|
|
42
43
|
x?: number;
|
|
43
44
|
y?: number;
|
|
44
45
|
dx?: StringOrNumberOrCallback;
|