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
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Iterable, List, Map } from "immutable";
|
|
1
|
+
import type { Iterable, List, Map } from "./immutable-types";
|
|
2
2
|
export declare const IMMUTABLE_ITERABLE = "@@__IMMUTABLE_ITERABLE__@@";
|
|
3
3
|
export declare const IMMUTABLE_RECORD = "@@__IMMUTABLE_RECORD__@@";
|
|
4
4
|
export declare const IMMUTABLE_LIST = "@@__IMMUTABLE_LIST__@@";
|
|
@@ -25,5 +25,4 @@ export { default as TimerContext } from "./timer-context";
|
|
|
25
25
|
export * as Transitions from "./transitions";
|
|
26
26
|
export * as UserProps from "./user-props";
|
|
27
27
|
export * as Wrapper from "./wrapper";
|
|
28
|
-
export * from "./with-container";
|
|
29
28
|
//# sourceMappingURL=index.d.ts.map
|
package/es/victory-util/index.js
CHANGED
|
@@ -43,6 +43,4 @@ export { _Transitions as Transitions };
|
|
|
43
43
|
import * as _UserProps from "./user-props";
|
|
44
44
|
export { _UserProps as UserProps };
|
|
45
45
|
import * as _Wrapper from "./wrapper";
|
|
46
|
-
export { _Wrapper as Wrapper };
|
|
47
|
-
export * from "./with-container";
|
|
48
|
-
//# sourceMappingURL=index.js.map
|
|
46
|
+
export { _Wrapper as Wrapper };
|
|
@@ -59,5 +59,4 @@ export var getLineFunction = function (props) {
|
|
|
59
59
|
scale = props.scale,
|
|
60
60
|
horizontal = props.horizontal;
|
|
61
61
|
return polar ? d3Shape.lineRadial().defined(defined).curve(getInterpolationFunction(props)).angle(getAngleAccessor(scale)).radius(getYAccessor(scale)) : d3Shape.line().defined(defined).curve(getInterpolationFunction(props)).x(horizontal ? getYAccessor(scale) : getXAccessor(scale)).y(horizontal ? getXAccessor(scale) : getYAccessor(scale));
|
|
62
|
-
};
|
|
63
|
-
//# sourceMappingURL=line-helpers.js.map
|
|
62
|
+
};
|
package/es/victory-util/log.js
CHANGED
package/es/victory-util/scale.js
CHANGED
package/es/victory-util/style.js
CHANGED
package/es/victory-util/timer.js
CHANGED
package/lib/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/lib/index.js
CHANGED
|
@@ -221,19 +221,4 @@ Object.keys(_victoryUtil).forEach(function (key) {
|
|
|
221
221
|
return _victoryUtil[key];
|
|
222
222
|
}
|
|
223
223
|
});
|
|
224
|
-
});
|
|
225
|
-
|
|
226
|
-
var _victoryState = require("./victory-state");
|
|
227
|
-
|
|
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
|
|
224
|
+
});
|
package/lib/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/lib/types/callbacks.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
//# sourceMappingURL=callbacks.js.map
|
|
1
|
+
"use strict";
|
|
@@ -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/lib/types/prop-types.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
//# sourceMappingURL=prop-types.js.map
|
|
1
|
+
"use strict";
|
|
@@ -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/lib/v37/clone.js
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.Clone = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
10
|
+
var _excluded = ["children", "element"];
|
|
11
|
+
|
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
+
|
|
14
|
+
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; }
|
|
15
|
+
|
|
16
|
+
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; }
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Syntax sugar for `React.cloneElement`, so that we can use JSX instead
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* // Before:
|
|
23
|
+
* const children = React.cloneElement(props.groupComponent, { prop2 }, props.children);
|
|
24
|
+
* return React.cloneElement(props.containerComponent, { prop1 }, children);
|
|
25
|
+
*
|
|
26
|
+
* // After:
|
|
27
|
+
* return (
|
|
28
|
+
* <Clone element={props.containerComponent} prop1={prop1}>
|
|
29
|
+
* <Clone element={props.groupComponent} prop2={prop2}>
|
|
30
|
+
* {props.children}
|
|
31
|
+
* </Clone>
|
|
32
|
+
* </Clone>
|
|
33
|
+
* );
|
|
34
|
+
*/
|
|
35
|
+
var Clone = function (props) {
|
|
36
|
+
var children = props.children,
|
|
37
|
+
element = props.element,
|
|
38
|
+
rest = _objectWithoutProperties(props, _excluded);
|
|
39
|
+
|
|
40
|
+
return /*#__PURE__*/_react.default.cloneElement(element, rest, children);
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
exports.Clone = Clone;
|
package/lib/v37/index.js
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
|
|
7
|
+
var _victoryState = require("./victory-state");
|
|
8
|
+
|
|
9
|
+
Object.keys(_victoryState).forEach(function (key) {
|
|
10
|
+
if (key === "default" || key === "__esModule") return;
|
|
11
|
+
if (key in exports && exports[key] === _victoryState[key]) return;
|
|
12
|
+
Object.defineProperty(exports, key, {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return _victoryState[key];
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
var _clone = require("./clone");
|
|
21
|
+
|
|
22
|
+
Object.keys(_clone).forEach(function (key) {
|
|
23
|
+
if (key === "default" || key === "__esModule") return;
|
|
24
|
+
if (key in exports && exports[key] === _clone[key]) return;
|
|
25
|
+
Object.defineProperty(exports, key, {
|
|
26
|
+
enumerable: true,
|
|
27
|
+
get: function () {
|
|
28
|
+
return _clone[key];
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
var _withNormalizedProps = require("./with-normalized-props");
|
|
34
|
+
|
|
35
|
+
Object.keys(_withNormalizedProps).forEach(function (key) {
|
|
36
|
+
if (key === "default" || key === "__esModule") return;
|
|
37
|
+
if (key in exports && exports[key] === _withNormalizedProps[key]) return;
|
|
38
|
+
Object.defineProperty(exports, key, {
|
|
39
|
+
enumerable: true,
|
|
40
|
+
get: function () {
|
|
41
|
+
return _withNormalizedProps[key];
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
var _withContainer = require("./with-container");
|
|
47
|
+
|
|
48
|
+
Object.keys(_withContainer).forEach(function (key) {
|
|
49
|
+
if (key === "default" || key === "__esModule") return;
|
|
50
|
+
if (key in exports && exports[key] === _withContainer[key]) return;
|
|
51
|
+
Object.defineProperty(exports, key, {
|
|
52
|
+
enumerable: true,
|
|
53
|
+
get: function () {
|
|
54
|
+
return _withContainer[key];
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
});
|
|
File without changes
|
|
@@ -7,5 +7,4 @@ exports.DEFAULT_WIDTH = exports.DEFAULT_HEIGHT = void 0;
|
|
|
7
7
|
var DEFAULT_HEIGHT = 300;
|
|
8
8
|
exports.DEFAULT_HEIGHT = DEFAULT_HEIGHT;
|
|
9
9
|
var DEFAULT_WIDTH = 450;
|
|
10
|
-
exports.DEFAULT_WIDTH = DEFAULT_WIDTH;
|
|
11
|
-
//# sourceMappingURL=defaults.js.map
|
|
10
|
+
exports.DEFAULT_WIDTH = DEFAULT_WIDTH;
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.getAxisData = getAxisData;
|
|
7
7
|
|
|
8
|
-
var _typeHelpers = require("
|
|
8
|
+
var _typeHelpers = require("../../../victory-util/type-helpers");
|
|
9
9
|
|
|
10
10
|
function getAxisData(data, axis) {
|
|
11
11
|
return data.reduce(function (acc, datum) {
|
|
@@ -19,5 +19,4 @@ function getAxisData(data, axis) {
|
|
|
19
19
|
|
|
20
20
|
return acc;
|
|
21
21
|
}, []);
|
|
22
|
-
}
|
|
23
|
-
//# sourceMappingURL=get-axis-data.js.map
|
|
22
|
+
}
|
|
@@ -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 {
|
|
@@ -11,7 +11,7 @@ var _isNil2 = _interopRequireDefault(require("lodash/isNil"));
|
|
|
11
11
|
|
|
12
12
|
var _get2 = _interopRequireDefault(require("lodash/get"));
|
|
13
13
|
|
|
14
|
-
var _typeHelpers = require("
|
|
14
|
+
var _typeHelpers = require("../../../victory-util/type-helpers");
|
|
15
15
|
|
|
16
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
17
|
|
|
@@ -95,5 +95,4 @@ function getData() {
|
|
|
95
95
|
}
|
|
96
96
|
|
|
97
97
|
return formattedData;
|
|
98
|
-
}
|
|
99
|
-
//# sourceMappingURL=get-data.js.map
|
|
98
|
+
}
|
|
@@ -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 {};
|
|
@@ -9,7 +9,7 @@ var d3Array = _interopRequireWildcard(require("victory-vendor/d3-array"));
|
|
|
9
9
|
|
|
10
10
|
var _getAxisData = require("./get-axis-data");
|
|
11
11
|
|
|
12
|
-
var _typeHelpers = require("
|
|
12
|
+
var _typeHelpers = require("../../../victory-util/type-helpers");
|
|
13
13
|
|
|
14
14
|
var _excluded = ["data", "includeZero"];
|
|
15
15
|
|
|
@@ -78,5 +78,4 @@ function getDomain(_ref, axis) {
|
|
|
78
78
|
|
|
79
79
|
|
|
80
80
|
return getDomainFromMinMax(minDomain, maxDomain);
|
|
81
|
-
}
|
|
82
|
-
//# sourceMappingURL=get-domain.js.map
|
|
81
|
+
}
|
|
@@ -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[];
|
|
@@ -5,9 +5,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.getRange = getRange;
|
|
7
7
|
|
|
8
|
-
var _helpers = require("
|
|
8
|
+
var _helpers = require("../../../victory-util/helpers");
|
|
9
9
|
|
|
10
|
-
var _typeHelpers = require("
|
|
10
|
+
var _typeHelpers = require("../../../victory-util/type-helpers");
|
|
11
11
|
|
|
12
12
|
var _excluded = ["range", "height", "width"];
|
|
13
13
|
|
|
@@ -42,5 +42,4 @@ function getRange(_ref, axis) {
|
|
|
42
42
|
y: [height - padding.top, padding.bottom]
|
|
43
43
|
};
|
|
44
44
|
return rangeForAxis[axis];
|
|
45
|
-
}
|
|
46
|
-
//# sourceMappingURL=get-range.js.map
|
|
45
|
+
}
|
|
@@ -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;
|
|
@@ -7,9 +7,9 @@ exports.getScale = getScale;
|
|
|
7
7
|
|
|
8
8
|
var _d3Scale = require("victory-vendor/d3-scale");
|
|
9
9
|
|
|
10
|
-
var Collection = _interopRequireWildcard(require("
|
|
10
|
+
var Collection = _interopRequireWildcard(require("../../../victory-util/collection"));
|
|
11
11
|
|
|
12
|
-
var _typeHelpers = require("
|
|
12
|
+
var _typeHelpers = require("../../../victory-util/type-helpers");
|
|
13
13
|
|
|
14
14
|
var _getAxisData = require("./get-axis-data");
|
|
15
15
|
|
|
@@ -70,5 +70,4 @@ function getScale(_ref, axis) {
|
|
|
70
70
|
}
|
|
71
71
|
|
|
72
72
|
return DEFAULT_SCALE;
|
|
73
|
-
}
|
|
74
|
-
//# sourceMappingURL=get-scale.js.map
|
|
73
|
+
}
|
|
@@ -29,4 +29,16 @@ Object.keys(_types).forEach(function (key) {
|
|
|
29
29
|
}
|
|
30
30
|
});
|
|
31
31
|
});
|
|
32
|
-
|
|
32
|
+
|
|
33
|
+
var _withVictoryProvider = require("./with-victory-provider");
|
|
34
|
+
|
|
35
|
+
Object.keys(_withVictoryProvider).forEach(function (key) {
|
|
36
|
+
if (key === "default" || key === "__esModule") return;
|
|
37
|
+
if (key in exports && exports[key] === _withVictoryProvider[key]) return;
|
|
38
|
+
Object.defineProperty(exports, key, {
|
|
39
|
+
enumerable: true,
|
|
40
|
+
get: function () {
|
|
41
|
+
return _withVictoryProvider[key];
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
});
|
|
@@ -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
|
+
"use strict";
|
|
@@ -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
|