victory-pie 37.3.2 → 37.3.4
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 +10 -0
- package/dist/victory-pie.js +297 -251
- package/dist/victory-pie.min.js +1 -1
- package/es/helper-methods.js +7 -7
- package/es/slice.d.ts +3 -3
- package/es/slice.js +3 -3
- package/es/victory-pie.d.ts +6 -6
- package/lib/helper-methods.js +7 -7
- package/lib/slice.d.ts +3 -3
- package/lib/slice.js +3 -3
- package/lib/victory-pie.d.ts +6 -6
- package/package.json +3 -31
- package/src/helper-methods.ts +3 -2
- package/src/slice.tsx +1 -1
package/es/helper-methods.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import _isPlainObject from "lodash/isPlainObject";
|
|
2
|
-
import _defaults from "lodash/defaults";
|
|
3
1
|
/* eslint no-magic-numbers: ["error", { "ignore": [-1, 0, 1, 2, 45, 90, 135, 180, 225, 270, 315, 360] }]*/
|
|
2
|
+
import defaults from "lodash/defaults";
|
|
3
|
+
import isPlainObject from "lodash/isPlainObject";
|
|
4
4
|
import * as d3Shape from "victory-vendor/d3-shape";
|
|
5
5
|
import { Helpers, Data, Style } from "victory-core";
|
|
6
6
|
const checkForValidText = text => {
|
|
@@ -26,7 +26,7 @@ const getOrigin = (props, padding) => {
|
|
|
26
26
|
width,
|
|
27
27
|
height
|
|
28
28
|
} = props;
|
|
29
|
-
const origin =
|
|
29
|
+
const origin = isPlainObject(props.origin) ? props.origin : {};
|
|
30
30
|
return {
|
|
31
31
|
x: origin.x !== undefined ? origin.x : (padding.left - padding.right + width) / 2,
|
|
32
32
|
y: origin.y !== undefined ? origin.y : (padding.top - padding.bottom + height) / 2
|
|
@@ -71,7 +71,7 @@ const getCalculatedValues = props => {
|
|
|
71
71
|
const styleObject = Helpers.getDefaultStyles(props, "pie");
|
|
72
72
|
const style = Helpers.getStyles(props.style, styleObject);
|
|
73
73
|
const colors = Array.isArray(colorScale) ? colorScale : Style.getColorScale(colorScale, theme);
|
|
74
|
-
const padding = Helpers.getPadding(props);
|
|
74
|
+
const padding = Helpers.getPadding(props.padding);
|
|
75
75
|
const defaultRadius = getRadius(props, padding);
|
|
76
76
|
const origin = getOrigin(props, padding);
|
|
77
77
|
const data = getDataSortedByCategories(props, Data.getData(props));
|
|
@@ -231,7 +231,7 @@ const getLabelProps = (text, dataProps, calculatedValues) => {
|
|
|
231
231
|
return labelProps;
|
|
232
232
|
}
|
|
233
233
|
const tooltipTheme = theme && theme.tooltip || {};
|
|
234
|
-
return
|
|
234
|
+
return defaults({}, labelProps, Helpers.omit(tooltipTheme, ["style"]));
|
|
235
235
|
};
|
|
236
236
|
export const getXOffsetMultiplayerByAngle = angle => Math.cos(angle - Helpers.degreesToRadians(90));
|
|
237
237
|
export const getYOffsetMultiplayerByAngle = angle => Math.sin(angle - Helpers.degreesToRadians(90));
|
|
@@ -275,7 +275,7 @@ export const getLabelIndicatorPropsForLineSegment = (props, calculatedValues, la
|
|
|
275
275
|
y2,
|
|
276
276
|
index
|
|
277
277
|
};
|
|
278
|
-
return
|
|
278
|
+
return defaults({}, labelIndicatorProps);
|
|
279
279
|
};
|
|
280
280
|
export const getBaseProps = (initialProps, fallbackProps) => {
|
|
281
281
|
const props = Helpers.modifyProps(initialProps, fallbackProps, "pie");
|
|
@@ -311,7 +311,7 @@ export const getBaseProps = (initialProps, fallbackProps) => {
|
|
|
311
311
|
}
|
|
312
312
|
};
|
|
313
313
|
return slices.reduce((childProps, slice, index) => {
|
|
314
|
-
const datum =
|
|
314
|
+
const datum = defaults({}, data[index], {
|
|
315
315
|
startAngle: Helpers.radiansToDegrees(slice.startAngle),
|
|
316
316
|
endAngle: Helpers.radiansToDegrees(slice.endAngle),
|
|
317
317
|
padAngle: Helpers.radiansToDegrees(slice.padAngle)
|
package/es/slice.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { NumberOrCallback, SliceNumberOrCallback, StringOrCallback, VictoryCommonProps, VictoryStyleInterface } from "victory-core";
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export
|
|
3
|
+
export type VictorySliceLabelPositionType = "startAngle" | "centroid" | "endAngle";
|
|
4
|
+
export type VictorySliceLabelPlacementType = "vertical" | "parallel" | "perpendicular";
|
|
5
|
+
export type VictorySliceTTargetType = "data" | "labels" | "parent";
|
|
6
6
|
export interface SliceProps extends VictoryCommonProps {
|
|
7
7
|
ariaLabel?: StringOrCallback;
|
|
8
8
|
cornerRadius?: SliceNumberOrCallback<SliceProps, "cornerRadius">;
|
package/es/slice.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import _defaults from "lodash/defaults";
|
|
2
1
|
import React from "react";
|
|
3
2
|
import { Helpers, Path } from "victory-core";
|
|
3
|
+
import defaults from "lodash/defaults";
|
|
4
4
|
import * as d3Shape from "victory-vendor/d3-shape";
|
|
5
5
|
const getPath = props => {
|
|
6
6
|
const {
|
|
@@ -16,7 +16,7 @@ const getPath = props => {
|
|
|
16
16
|
const startAngle = Helpers.degreesToRadians(props.sliceStartAngle);
|
|
17
17
|
const endAngle = Helpers.degreesToRadians(props.sliceEndAngle);
|
|
18
18
|
const pathFunction = d3Shape.arc().cornerRadius(cornerRadius).outerRadius(radius).innerRadius(innerRadius || 0);
|
|
19
|
-
return pathFunction(
|
|
19
|
+
return pathFunction(defaults({
|
|
20
20
|
startAngle,
|
|
21
21
|
endAngle,
|
|
22
22
|
padAngle
|
|
@@ -72,7 +72,7 @@ const defaultProps = {
|
|
|
72
72
|
shapeRendering: "auto"
|
|
73
73
|
};
|
|
74
74
|
export const Slice = initialProps => {
|
|
75
|
-
const props = evaluateProps(
|
|
75
|
+
const props = evaluateProps(defaults({}, initialProps, defaultProps));
|
|
76
76
|
const defaultTransform = props.origin ? `translate(${props.origin.x}, ${props.origin.y})` : undefined;
|
|
77
77
|
return /*#__PURE__*/React.cloneElement(props.pathComponent, {
|
|
78
78
|
...props.events,
|
package/es/victory-pie.d.ts
CHANGED
|
@@ -79,9 +79,9 @@ export declare const VictoryPie: {
|
|
|
79
79
|
getAllEvents(props: any): any;
|
|
80
80
|
getComponentProps(component: React.ReactNode, type: string, index: string | number): any;
|
|
81
81
|
renderContainer(component: any, children: any): React.DetailedReactHTMLElement<any, HTMLElement>;
|
|
82
|
-
animateComponent(props: import("victory-core").EventMixinCommonProps, defaultAnimationWhitelist: string[]): React.ReactElement
|
|
82
|
+
animateComponent(props: import("victory-core").EventMixinCommonProps, defaultAnimationWhitelist: string[]): React.ReactElement;
|
|
83
83
|
renderContinuousData(props: import("victory-core").EventMixinCommonProps): React.DetailedReactHTMLElement<any, HTMLElement>;
|
|
84
|
-
renderData(props: any, shouldRenderDatum?: (
|
|
84
|
+
renderData(props: any, shouldRenderDatum?: (datum: any) => boolean): React.DetailedReactHTMLElement<any, HTMLElement>;
|
|
85
85
|
context: unknown;
|
|
86
86
|
setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<import("victory-core").EventMixinCommonProps>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
|
|
87
87
|
forceUpdate(callback?: (() => void) | undefined): void;
|
|
@@ -98,17 +98,17 @@ export declare const VictoryPie: {
|
|
|
98
98
|
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<import("victory-core").EventMixinCommonProps>, nextContext: any): void;
|
|
99
99
|
componentWillUpdate?(nextProps: Readonly<import("victory-core").EventMixinCommonProps>, nextState: Readonly<{}>, nextContext: any): void;
|
|
100
100
|
UNSAFE_componentWillUpdate?(nextProps: Readonly<import("victory-core").EventMixinCommonProps>, nextState: Readonly<{}>, nextContext: any): void;
|
|
101
|
-
componentEvents: import("@/victory-core/lib/victory-util/events").ComponentEvent
|
|
101
|
+
componentEvents: Array<import("@/victory-core/lib/victory-util/events").ComponentEvent>;
|
|
102
102
|
getSharedEventState: (key: string, value: string) => unknown;
|
|
103
103
|
baseProps: Record<string, object>;
|
|
104
104
|
dataKeys: string[];
|
|
105
105
|
hasEvents: unknown;
|
|
106
106
|
events: unknown;
|
|
107
107
|
};
|
|
108
|
-
getBaseProps?(props: import("victory-core").EventMixinCommonProps):
|
|
109
|
-
role?:
|
|
108
|
+
getBaseProps?(props: import("victory-core").EventMixinCommonProps): import("victory-core").EventMixinCalculatedValues["baseProps"];
|
|
109
|
+
role?: import("victory-core").VictoryComponentRole;
|
|
110
110
|
expectedComponents?: string[] | undefined;
|
|
111
|
-
getChildren?: ((props: import("victory-core").EventMixinCommonProps, childComponents?: React.ReactNode
|
|
111
|
+
getChildren?: ((props: import("victory-core").EventMixinCommonProps, childComponents?: Array<React.ReactNode>, calculatedProps?: import("victory-core").EventMixinCommonProps | undefined) => void) | undefined;
|
|
112
112
|
animationWhitelist?: string[] | undefined;
|
|
113
113
|
} & typeof VictoryPieBase;
|
|
114
114
|
export {};
|
package/lib/helper-methods.js
CHANGED
|
@@ -4,8 +4,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.getYOffsetMultiplayerByAngle = exports.getYOffset = exports.getXOffsetMultiplayerByAngle = exports.getXOffset = exports.getLabelIndicatorPropsForLineSegment = exports.getBaseProps = exports.getAverage = void 0;
|
|
7
|
-
var
|
|
8
|
-
var
|
|
7
|
+
var _defaults = _interopRequireDefault(require("lodash/defaults"));
|
|
8
|
+
var _isPlainObject = _interopRequireDefault(require("lodash/isPlainObject"));
|
|
9
9
|
var d3Shape = _interopRequireWildcard(require("victory-vendor/d3-shape"));
|
|
10
10
|
var _victoryCore = require("victory-core");
|
|
11
11
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
@@ -36,7 +36,7 @@ const getOrigin = (props, padding) => {
|
|
|
36
36
|
width,
|
|
37
37
|
height
|
|
38
38
|
} = props;
|
|
39
|
-
const origin = (0,
|
|
39
|
+
const origin = (0, _isPlainObject.default)(props.origin) ? props.origin : {};
|
|
40
40
|
return {
|
|
41
41
|
x: origin.x !== undefined ? origin.x : (padding.left - padding.right + width) / 2,
|
|
42
42
|
y: origin.y !== undefined ? origin.y : (padding.top - padding.bottom + height) / 2
|
|
@@ -81,7 +81,7 @@ const getCalculatedValues = props => {
|
|
|
81
81
|
const styleObject = _victoryCore.Helpers.getDefaultStyles(props, "pie");
|
|
82
82
|
const style = _victoryCore.Helpers.getStyles(props.style, styleObject);
|
|
83
83
|
const colors = Array.isArray(colorScale) ? colorScale : _victoryCore.Style.getColorScale(colorScale, theme);
|
|
84
|
-
const padding = _victoryCore.Helpers.getPadding(props);
|
|
84
|
+
const padding = _victoryCore.Helpers.getPadding(props.padding);
|
|
85
85
|
const defaultRadius = getRadius(props, padding);
|
|
86
86
|
const origin = getOrigin(props, padding);
|
|
87
87
|
const data = getDataSortedByCategories(props, _victoryCore.Data.getData(props));
|
|
@@ -241,7 +241,7 @@ const getLabelProps = (text, dataProps, calculatedValues) => {
|
|
|
241
241
|
return labelProps;
|
|
242
242
|
}
|
|
243
243
|
const tooltipTheme = theme && theme.tooltip || {};
|
|
244
|
-
return (0,
|
|
244
|
+
return (0, _defaults.default)({}, labelProps, _victoryCore.Helpers.omit(tooltipTheme, ["style"]));
|
|
245
245
|
};
|
|
246
246
|
const getXOffsetMultiplayerByAngle = angle => Math.cos(angle - _victoryCore.Helpers.degreesToRadians(90));
|
|
247
247
|
exports.getXOffsetMultiplayerByAngle = getXOffsetMultiplayerByAngle;
|
|
@@ -290,7 +290,7 @@ const getLabelIndicatorPropsForLineSegment = (props, calculatedValues, labelProp
|
|
|
290
290
|
y2,
|
|
291
291
|
index
|
|
292
292
|
};
|
|
293
|
-
return (0,
|
|
293
|
+
return (0, _defaults.default)({}, labelIndicatorProps);
|
|
294
294
|
};
|
|
295
295
|
exports.getLabelIndicatorPropsForLineSegment = getLabelIndicatorPropsForLineSegment;
|
|
296
296
|
const getBaseProps = (initialProps, fallbackProps) => {
|
|
@@ -327,7 +327,7 @@ const getBaseProps = (initialProps, fallbackProps) => {
|
|
|
327
327
|
}
|
|
328
328
|
};
|
|
329
329
|
return slices.reduce((childProps, slice, index) => {
|
|
330
|
-
const datum = (0,
|
|
330
|
+
const datum = (0, _defaults.default)({}, data[index], {
|
|
331
331
|
startAngle: _victoryCore.Helpers.radiansToDegrees(slice.startAngle),
|
|
332
332
|
endAngle: _victoryCore.Helpers.radiansToDegrees(slice.endAngle),
|
|
333
333
|
padAngle: _victoryCore.Helpers.radiansToDegrees(slice.padAngle)
|
package/lib/slice.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { NumberOrCallback, SliceNumberOrCallback, StringOrCallback, VictoryCommonProps, VictoryStyleInterface } from "victory-core";
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export
|
|
3
|
+
export type VictorySliceLabelPositionType = "startAngle" | "centroid" | "endAngle";
|
|
4
|
+
export type VictorySliceLabelPlacementType = "vertical" | "parallel" | "perpendicular";
|
|
5
|
+
export type VictorySliceTTargetType = "data" | "labels" | "parent";
|
|
6
6
|
export interface SliceProps extends VictoryCommonProps {
|
|
7
7
|
ariaLabel?: StringOrCallback;
|
|
8
8
|
cornerRadius?: SliceNumberOrCallback<SliceProps, "cornerRadius">;
|
package/lib/slice.js
CHANGED
|
@@ -4,9 +4,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.Slice = void 0;
|
|
7
|
-
var _defaults2 = _interopRequireDefault(require("lodash/defaults"));
|
|
8
7
|
var _react = _interopRequireDefault(require("react"));
|
|
9
8
|
var _victoryCore = require("victory-core");
|
|
9
|
+
var _defaults = _interopRequireDefault(require("lodash/defaults"));
|
|
10
10
|
var d3Shape = _interopRequireWildcard(require("victory-vendor/d3-shape"));
|
|
11
11
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
12
12
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
@@ -25,7 +25,7 @@ const getPath = props => {
|
|
|
25
25
|
const startAngle = _victoryCore.Helpers.degreesToRadians(props.sliceStartAngle);
|
|
26
26
|
const endAngle = _victoryCore.Helpers.degreesToRadians(props.sliceEndAngle);
|
|
27
27
|
const pathFunction = d3Shape.arc().cornerRadius(cornerRadius).outerRadius(radius).innerRadius(innerRadius || 0);
|
|
28
|
-
return pathFunction((0,
|
|
28
|
+
return pathFunction((0, _defaults.default)({
|
|
29
29
|
startAngle,
|
|
30
30
|
endAngle,
|
|
31
31
|
padAngle
|
|
@@ -81,7 +81,7 @@ const defaultProps = {
|
|
|
81
81
|
shapeRendering: "auto"
|
|
82
82
|
};
|
|
83
83
|
const Slice = initialProps => {
|
|
84
|
-
const props = evaluateProps((0,
|
|
84
|
+
const props = evaluateProps((0, _defaults.default)({}, initialProps, defaultProps));
|
|
85
85
|
const defaultTransform = props.origin ? `translate(${props.origin.x}, ${props.origin.y})` : undefined;
|
|
86
86
|
return /*#__PURE__*/_react.default.cloneElement(props.pathComponent, {
|
|
87
87
|
...props.events,
|
package/lib/victory-pie.d.ts
CHANGED
|
@@ -79,9 +79,9 @@ export declare const VictoryPie: {
|
|
|
79
79
|
getAllEvents(props: any): any;
|
|
80
80
|
getComponentProps(component: React.ReactNode, type: string, index: string | number): any;
|
|
81
81
|
renderContainer(component: any, children: any): React.DetailedReactHTMLElement<any, HTMLElement>;
|
|
82
|
-
animateComponent(props: import("victory-core").EventMixinCommonProps, defaultAnimationWhitelist: string[]): React.ReactElement
|
|
82
|
+
animateComponent(props: import("victory-core").EventMixinCommonProps, defaultAnimationWhitelist: string[]): React.ReactElement;
|
|
83
83
|
renderContinuousData(props: import("victory-core").EventMixinCommonProps): React.DetailedReactHTMLElement<any, HTMLElement>;
|
|
84
|
-
renderData(props: any, shouldRenderDatum?: (
|
|
84
|
+
renderData(props: any, shouldRenderDatum?: (datum: any) => boolean): React.DetailedReactHTMLElement<any, HTMLElement>;
|
|
85
85
|
context: unknown;
|
|
86
86
|
setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<import("victory-core").EventMixinCommonProps>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
|
|
87
87
|
forceUpdate(callback?: (() => void) | undefined): void;
|
|
@@ -98,17 +98,17 @@ export declare const VictoryPie: {
|
|
|
98
98
|
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<import("victory-core").EventMixinCommonProps>, nextContext: any): void;
|
|
99
99
|
componentWillUpdate?(nextProps: Readonly<import("victory-core").EventMixinCommonProps>, nextState: Readonly<{}>, nextContext: any): void;
|
|
100
100
|
UNSAFE_componentWillUpdate?(nextProps: Readonly<import("victory-core").EventMixinCommonProps>, nextState: Readonly<{}>, nextContext: any): void;
|
|
101
|
-
componentEvents: import("@/victory-core/lib/victory-util/events").ComponentEvent
|
|
101
|
+
componentEvents: Array<import("@/victory-core/lib/victory-util/events").ComponentEvent>;
|
|
102
102
|
getSharedEventState: (key: string, value: string) => unknown;
|
|
103
103
|
baseProps: Record<string, object>;
|
|
104
104
|
dataKeys: string[];
|
|
105
105
|
hasEvents: unknown;
|
|
106
106
|
events: unknown;
|
|
107
107
|
};
|
|
108
|
-
getBaseProps?(props: import("victory-core").EventMixinCommonProps):
|
|
109
|
-
role?:
|
|
108
|
+
getBaseProps?(props: import("victory-core").EventMixinCommonProps): import("victory-core").EventMixinCalculatedValues["baseProps"];
|
|
109
|
+
role?: import("victory-core").VictoryComponentRole;
|
|
110
110
|
expectedComponents?: string[] | undefined;
|
|
111
|
-
getChildren?: ((props: import("victory-core").EventMixinCommonProps, childComponents?: React.ReactNode
|
|
111
|
+
getChildren?: ((props: import("victory-core").EventMixinCommonProps, childComponents?: Array<React.ReactNode>, calculatedProps?: import("victory-core").EventMixinCommonProps | undefined) => void) | undefined;
|
|
112
112
|
animationWhitelist?: string[] | undefined;
|
|
113
113
|
} & typeof VictoryPieBase;
|
|
114
114
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "victory-pie",
|
|
3
|
-
"version": "37.3.
|
|
3
|
+
"version": "37.3.4",
|
|
4
4
|
"description": "Pie Component for Victory",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"data visualization",
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
"license": "MIT",
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"lodash": "^4.17.19",
|
|
24
|
-
"victory-core": "37.3.
|
|
25
|
-
"victory-vendor": "37.3.
|
|
24
|
+
"victory-core": "37.3.4",
|
|
25
|
+
"victory-vendor": "37.3.4"
|
|
26
26
|
},
|
|
27
27
|
"peerDependencies": {
|
|
28
28
|
"react": ">=16.6.0"
|
|
@@ -186,32 +186,6 @@
|
|
|
186
186
|
"pnpm-lock.yaml"
|
|
187
187
|
]
|
|
188
188
|
},
|
|
189
|
-
"format": {
|
|
190
|
-
"command": "nps format:pkg",
|
|
191
|
-
"files": [
|
|
192
|
-
"src/**",
|
|
193
|
-
"*.json",
|
|
194
|
-
"../../.prettierignore",
|
|
195
|
-
"../../.prettierrc.json"
|
|
196
|
-
],
|
|
197
|
-
"output": [],
|
|
198
|
-
"packageLocks": [
|
|
199
|
-
"pnpm-lock.yaml"
|
|
200
|
-
]
|
|
201
|
-
},
|
|
202
|
-
"format:fix": {
|
|
203
|
-
"command": "pnpm run format || nps format:pkg:fix",
|
|
204
|
-
"files": [
|
|
205
|
-
"src/**",
|
|
206
|
-
"*.json",
|
|
207
|
-
"../../.prettierignore",
|
|
208
|
-
"../../.prettierrc.json"
|
|
209
|
-
],
|
|
210
|
-
"output": [],
|
|
211
|
-
"packageLocks": [
|
|
212
|
-
"pnpm-lock.yaml"
|
|
213
|
-
]
|
|
214
|
-
},
|
|
215
189
|
"lint": {
|
|
216
190
|
"command": "eslint src",
|
|
217
191
|
"files": [
|
|
@@ -276,8 +250,6 @@
|
|
|
276
250
|
"check": "wireit",
|
|
277
251
|
"types:check": "wireit",
|
|
278
252
|
"types:create": "wireit",
|
|
279
|
-
"format": "wireit",
|
|
280
|
-
"format:fix": "wireit",
|
|
281
253
|
"lint": "wireit",
|
|
282
254
|
"lint:fix": "wireit",
|
|
283
255
|
"jest": "wireit"
|
package/src/helper-methods.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/* eslint no-magic-numbers: ["error", { "ignore": [-1, 0, 1, 2, 45, 90, 135, 180, 225, 270, 315, 360] }]*/
|
|
2
|
-
import
|
|
2
|
+
import defaults from "lodash/defaults";
|
|
3
|
+
import isPlainObject from "lodash/isPlainObject";
|
|
3
4
|
import * as d3Shape from "victory-vendor/d3-shape";
|
|
4
5
|
|
|
5
6
|
import { Helpers, Data, Style } from "victory-core";
|
|
@@ -90,7 +91,7 @@ const getCalculatedValues = (props) => {
|
|
|
90
91
|
const colors = Array.isArray(colorScale)
|
|
91
92
|
? colorScale
|
|
92
93
|
: Style.getColorScale(colorScale, theme);
|
|
93
|
-
const padding = Helpers.getPadding(props);
|
|
94
|
+
const padding = Helpers.getPadding(props.padding);
|
|
94
95
|
const defaultRadius = getRadius(props, padding);
|
|
95
96
|
const origin = getOrigin(props, padding);
|
|
96
97
|
const data = getDataSortedByCategories(props, Data.getData(props));
|
package/src/slice.tsx
CHANGED
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
VictoryCommonProps,
|
|
9
9
|
VictoryStyleInterface,
|
|
10
10
|
} from "victory-core";
|
|
11
|
-
import
|
|
11
|
+
import defaults from "lodash/defaults";
|
|
12
12
|
import * as d3Shape from "victory-vendor/d3-shape";
|
|
13
13
|
|
|
14
14
|
export type VictorySliceLabelPositionType =
|