victory-pie
Advanced tools
Comparing version 37.3.2 to 37.3.3
# victory-pie | ||
## 37.3.3 | ||
### Patch Changes | ||
- Remove deprecated babel-plugin-lodash plugin ([#2965](https://github.com/FormidableLabs/victory/pull/2965)) | ||
* Improve types in victory-core helpers ([#2999](https://github.com/FormidableLabs/victory/pull/2999)) | ||
## 37.3.2 | ||
@@ -4,0 +12,0 @@ |
@@ -1,4 +0,4 @@ | ||
import _isPlainObject from "lodash/isPlainObject"; | ||
import _defaults from "lodash/defaults"; | ||
/* eslint no-magic-numbers: ["error", { "ignore": [-1, 0, 1, 2, 45, 90, 135, 180, 225, 270, 315, 360] }]*/ | ||
import defaults from "lodash/defaults"; | ||
import isPlainObject from "lodash/isPlainObject"; | ||
import * as d3Shape from "victory-vendor/d3-shape"; | ||
@@ -29,3 +29,3 @@ import { Helpers, Data, Style } from "victory-core"; | ||
} = props; | ||
const origin = _isPlainObject(props.origin) ? props.origin : {}; | ||
const origin = isPlainObject(props.origin) ? props.origin : {}; | ||
return { | ||
@@ -75,3 +75,3 @@ x: origin.x !== undefined ? origin.x : (padding.left - padding.right + width) / 2, | ||
const colors = Array.isArray(colorScale) ? colorScale : Style.getColorScale(colorScale, theme); | ||
const padding = Helpers.getPadding(props); | ||
const padding = Helpers.getPadding(props.padding); | ||
const defaultRadius = getRadius(props, padding); | ||
@@ -236,3 +236,3 @@ const origin = getOrigin(props, padding); | ||
const tooltipTheme = theme && theme.tooltip || {}; | ||
return _defaults({}, labelProps, Helpers.omit(tooltipTheme, ["style"])); | ||
return defaults({}, labelProps, Helpers.omit(tooltipTheme, ["style"])); | ||
}; | ||
@@ -281,3 +281,3 @@ export const getXOffsetMultiplayerByAngle = angle => Math.cos(angle - Helpers.degreesToRadians(90)); | ||
}; | ||
return _defaults({}, labelIndicatorProps); | ||
return defaults({}, labelIndicatorProps); | ||
}; | ||
@@ -318,3 +318,3 @@ export const getBaseProps = (initialProps, fallbackProps) => { | ||
return slices.reduce((childProps, slice, index) => { | ||
const datum = _defaults({}, data[index], { | ||
const datum = defaults({}, data[index], { | ||
startAngle: Helpers.radiansToDegrees(slice.startAngle), | ||
@@ -321,0 +321,0 @@ endAngle: Helpers.radiansToDegrees(slice.endAngle), |
import React from "react"; | ||
import { NumberOrCallback, SliceNumberOrCallback, StringOrCallback, VictoryCommonProps, VictoryStyleInterface } from "victory-core"; | ||
export declare type VictorySliceLabelPositionType = "startAngle" | "centroid" | "endAngle"; | ||
export declare type VictorySliceLabelPlacementType = "vertical" | "parallel" | "perpendicular"; | ||
export declare type VictorySliceTTargetType = "data" | "labels" | "parent"; | ||
export type VictorySliceLabelPositionType = "startAngle" | "centroid" | "endAngle"; | ||
export type VictorySliceLabelPlacementType = "vertical" | "parallel" | "perpendicular"; | ||
export type VictorySliceTTargetType = "data" | "labels" | "parent"; | ||
export interface SliceProps extends VictoryCommonProps { | ||
@@ -7,0 +7,0 @@ ariaLabel?: StringOrCallback; |
@@ -1,4 +0,4 @@ | ||
import _defaults from "lodash/defaults"; | ||
import React from "react"; | ||
import { Helpers, Path } from "victory-core"; | ||
import defaults from "lodash/defaults"; | ||
import * as d3Shape from "victory-vendor/d3-shape"; | ||
@@ -19,3 +19,3 @@ const getPath = props => { | ||
const pathFunction = d3Shape.arc().cornerRadius(cornerRadius).outerRadius(radius).innerRadius(innerRadius || 0); | ||
return pathFunction(_defaults({ | ||
return pathFunction(defaults({ | ||
startAngle, | ||
@@ -76,3 +76,3 @@ endAngle, | ||
export const Slice = initialProps => { | ||
const props = evaluateProps(_defaults({}, initialProps, defaultProps)); | ||
const props = evaluateProps(defaults({}, initialProps, defaultProps)); | ||
const defaultTransform = props.origin ? `translate(${props.origin.x}, ${props.origin.y})` : undefined; | ||
@@ -79,0 +79,0 @@ return /*#__PURE__*/React.cloneElement(props.pathComponent, { |
@@ -82,5 +82,5 @@ import React from "react"; | ||
renderContainer(component: any, children: any): React.DetailedReactHTMLElement<any, HTMLElement>; | ||
animateComponent(props: import("victory-core").EventMixinCommonProps, defaultAnimationWhitelist: string[]): React.ReactElement<any, string | React.JSXElementConstructor<any>>; | ||
animateComponent(props: import("victory-core").EventMixinCommonProps, defaultAnimationWhitelist: string[]): React.ReactElement; | ||
renderContinuousData(props: import("victory-core").EventMixinCommonProps): React.DetailedReactHTMLElement<any, HTMLElement>; | ||
renderData(props: any, shouldRenderDatum?: ((datum: any) => boolean) | undefined): React.DetailedReactHTMLElement<any, HTMLElement>; | ||
renderData(props: any, shouldRenderDatum?: (datum: any) => boolean): React.DetailedReactHTMLElement<any, HTMLElement>; | ||
context: unknown; | ||
@@ -102,3 +102,3 @@ setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<import("victory-core").EventMixinCommonProps>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void; | ||
UNSAFE_componentWillUpdate?(nextProps: Readonly<import("victory-core").EventMixinCommonProps>, nextState: Readonly<{}>, nextContext: any): void; | ||
componentEvents: import("@/victory-core/lib/victory-util/events").ComponentEvent[]; | ||
componentEvents: Array<import("@/victory-core/lib/victory-util/events").ComponentEvent>; | ||
getSharedEventState: (key: string, value: string) => unknown; | ||
@@ -110,6 +110,6 @@ baseProps: Record<string, object>; | ||
}; | ||
getBaseProps?(props: import("victory-core").EventMixinCommonProps): Record<string, object>; | ||
role?: string | undefined; | ||
getBaseProps?(props: import("victory-core").EventMixinCommonProps): import("victory-core").EventMixinCalculatedValues["baseProps"]; | ||
role?: import("victory-core").VictoryComponentRole; | ||
expectedComponents?: string[] | undefined; | ||
getChildren?: ((props: import("victory-core").EventMixinCommonProps, childComponents?: React.ReactNode[] | undefined, calculatedProps?: import("victory-core").EventMixinCommonProps | undefined) => void) | undefined; | ||
getChildren?: ((props: import("victory-core").EventMixinCommonProps, childComponents?: Array<React.ReactNode>, calculatedProps?: import("victory-core").EventMixinCommonProps | undefined) => void) | undefined; | ||
animationWhitelist?: string[] | undefined; | ||
@@ -116,0 +116,0 @@ } & typeof VictoryPieBase; |
@@ -7,4 +7,4 @@ "use strict"; | ||
exports.getYOffsetMultiplayerByAngle = exports.getYOffset = exports.getXOffsetMultiplayerByAngle = exports.getXOffset = exports.getLabelIndicatorPropsForLineSegment = exports.getBaseProps = exports.getAverage = void 0; | ||
var _isPlainObject2 = _interopRequireDefault(require("lodash/isPlainObject")); | ||
var _defaults2 = _interopRequireDefault(require("lodash/defaults")); | ||
var _defaults = _interopRequireDefault(require("lodash/defaults")); | ||
var _isPlainObject = _interopRequireDefault(require("lodash/isPlainObject")); | ||
var d3Shape = _interopRequireWildcard(require("victory-vendor/d3-shape")); | ||
@@ -40,3 +40,3 @@ var _victoryCore = require("victory-core"); | ||
} = props; | ||
const origin = (0, _isPlainObject2.default)(props.origin) ? props.origin : {}; | ||
const origin = (0, _isPlainObject.default)(props.origin) ? props.origin : {}; | ||
return { | ||
@@ -86,3 +86,3 @@ x: origin.x !== undefined ? origin.x : (padding.left - padding.right + width) / 2, | ||
const colors = Array.isArray(colorScale) ? colorScale : _victoryCore.Style.getColorScale(colorScale, theme); | ||
const padding = _victoryCore.Helpers.getPadding(props); | ||
const padding = _victoryCore.Helpers.getPadding(props.padding); | ||
const defaultRadius = getRadius(props, padding); | ||
@@ -247,3 +247,3 @@ const origin = getOrigin(props, padding); | ||
const tooltipTheme = theme && theme.tooltip || {}; | ||
return (0, _defaults2.default)({}, labelProps, _victoryCore.Helpers.omit(tooltipTheme, ["style"])); | ||
return (0, _defaults.default)({}, labelProps, _victoryCore.Helpers.omit(tooltipTheme, ["style"])); | ||
}; | ||
@@ -297,3 +297,3 @@ const getXOffsetMultiplayerByAngle = angle => Math.cos(angle - _victoryCore.Helpers.degreesToRadians(90)); | ||
}; | ||
return (0, _defaults2.default)({}, labelIndicatorProps); | ||
return (0, _defaults.default)({}, labelIndicatorProps); | ||
}; | ||
@@ -335,3 +335,3 @@ exports.getLabelIndicatorPropsForLineSegment = getLabelIndicatorPropsForLineSegment; | ||
return slices.reduce((childProps, slice, index) => { | ||
const datum = (0, _defaults2.default)({}, data[index], { | ||
const datum = (0, _defaults.default)({}, data[index], { | ||
startAngle: _victoryCore.Helpers.radiansToDegrees(slice.startAngle), | ||
@@ -338,0 +338,0 @@ endAngle: _victoryCore.Helpers.radiansToDegrees(slice.endAngle), |
import React from "react"; | ||
import { NumberOrCallback, SliceNumberOrCallback, StringOrCallback, VictoryCommonProps, VictoryStyleInterface } from "victory-core"; | ||
export declare type VictorySliceLabelPositionType = "startAngle" | "centroid" | "endAngle"; | ||
export declare type VictorySliceLabelPlacementType = "vertical" | "parallel" | "perpendicular"; | ||
export declare type VictorySliceTTargetType = "data" | "labels" | "parent"; | ||
export type VictorySliceLabelPositionType = "startAngle" | "centroid" | "endAngle"; | ||
export type VictorySliceLabelPlacementType = "vertical" | "parallel" | "perpendicular"; | ||
export type VictorySliceTTargetType = "data" | "labels" | "parent"; | ||
export interface SliceProps extends VictoryCommonProps { | ||
@@ -7,0 +7,0 @@ ariaLabel?: StringOrCallback; |
@@ -7,5 +7,5 @@ "use strict"; | ||
exports.Slice = void 0; | ||
var _defaults2 = _interopRequireDefault(require("lodash/defaults")); | ||
var _react = _interopRequireDefault(require("react")); | ||
var _victoryCore = require("victory-core"); | ||
var _defaults = _interopRequireDefault(require("lodash/defaults")); | ||
var d3Shape = _interopRequireWildcard(require("victory-vendor/d3-shape")); | ||
@@ -29,3 +29,3 @@ 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); } | ||
const pathFunction = d3Shape.arc().cornerRadius(cornerRadius).outerRadius(radius).innerRadius(innerRadius || 0); | ||
return pathFunction((0, _defaults2.default)({ | ||
return pathFunction((0, _defaults.default)({ | ||
startAngle, | ||
@@ -86,3 +86,3 @@ endAngle, | ||
const Slice = initialProps => { | ||
const props = evaluateProps((0, _defaults2.default)({}, initialProps, defaultProps)); | ||
const props = evaluateProps((0, _defaults.default)({}, initialProps, defaultProps)); | ||
const defaultTransform = props.origin ? `translate(${props.origin.x}, ${props.origin.y})` : undefined; | ||
@@ -89,0 +89,0 @@ return /*#__PURE__*/_react.default.cloneElement(props.pathComponent, { |
@@ -82,5 +82,5 @@ import React from "react"; | ||
renderContainer(component: any, children: any): React.DetailedReactHTMLElement<any, HTMLElement>; | ||
animateComponent(props: import("victory-core").EventMixinCommonProps, defaultAnimationWhitelist: string[]): React.ReactElement<any, string | React.JSXElementConstructor<any>>; | ||
animateComponent(props: import("victory-core").EventMixinCommonProps, defaultAnimationWhitelist: string[]): React.ReactElement; | ||
renderContinuousData(props: import("victory-core").EventMixinCommonProps): React.DetailedReactHTMLElement<any, HTMLElement>; | ||
renderData(props: any, shouldRenderDatum?: ((datum: any) => boolean) | undefined): React.DetailedReactHTMLElement<any, HTMLElement>; | ||
renderData(props: any, shouldRenderDatum?: (datum: any) => boolean): React.DetailedReactHTMLElement<any, HTMLElement>; | ||
context: unknown; | ||
@@ -102,3 +102,3 @@ setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<import("victory-core").EventMixinCommonProps>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void; | ||
UNSAFE_componentWillUpdate?(nextProps: Readonly<import("victory-core").EventMixinCommonProps>, nextState: Readonly<{}>, nextContext: any): void; | ||
componentEvents: import("@/victory-core/lib/victory-util/events").ComponentEvent[]; | ||
componentEvents: Array<import("@/victory-core/lib/victory-util/events").ComponentEvent>; | ||
getSharedEventState: (key: string, value: string) => unknown; | ||
@@ -110,6 +110,6 @@ baseProps: Record<string, object>; | ||
}; | ||
getBaseProps?(props: import("victory-core").EventMixinCommonProps): Record<string, object>; | ||
role?: string | undefined; | ||
getBaseProps?(props: import("victory-core").EventMixinCommonProps): import("victory-core").EventMixinCalculatedValues["baseProps"]; | ||
role?: import("victory-core").VictoryComponentRole; | ||
expectedComponents?: string[] | undefined; | ||
getChildren?: ((props: import("victory-core").EventMixinCommonProps, childComponents?: React.ReactNode[] | undefined, calculatedProps?: import("victory-core").EventMixinCommonProps | undefined) => void) | undefined; | ||
getChildren?: ((props: import("victory-core").EventMixinCommonProps, childComponents?: Array<React.ReactNode>, calculatedProps?: import("victory-core").EventMixinCommonProps | undefined) => void) | undefined; | ||
animationWhitelist?: string[] | undefined; | ||
@@ -116,0 +116,0 @@ } & typeof VictoryPieBase; |
{ | ||
"name": "victory-pie", | ||
"version": "37.3.2", | ||
"version": "37.3.3", | ||
"description": "Pie Component for Victory", | ||
@@ -24,4 +24,4 @@ "keywords": [ | ||
"lodash": "^4.17.19", | ||
"victory-core": "37.3.2", | ||
"victory-vendor": "37.3.2" | ||
"victory-core": "37.3.3", | ||
"victory-vendor": "37.3.3" | ||
}, | ||
@@ -190,28 +190,2 @@ "peerDependencies": { | ||
}, | ||
"format": { | ||
"command": "nps format:pkg", | ||
"files": [ | ||
"src/**", | ||
"*.json", | ||
"../../.prettierignore", | ||
"../../.prettierrc.json" | ||
], | ||
"output": [], | ||
"packageLocks": [ | ||
"pnpm-lock.yaml" | ||
] | ||
}, | ||
"format:fix": { | ||
"command": "pnpm run format || nps format:pkg:fix", | ||
"files": [ | ||
"src/**", | ||
"*.json", | ||
"../../.prettierignore", | ||
"../../.prettierrc.json" | ||
], | ||
"output": [], | ||
"packageLocks": [ | ||
"pnpm-lock.yaml" | ||
] | ||
}, | ||
"lint": { | ||
@@ -281,4 +255,2 @@ "command": "eslint src", | ||
"types:create": "wireit", | ||
"format": "wireit", | ||
"format:fix": "wireit", | ||
"lint": "wireit", | ||
@@ -285,0 +257,0 @@ "lint:fix": "wireit", |
/* eslint no-magic-numbers: ["error", { "ignore": [-1, 0, 1, 2, 45, 90, 135, 180, 225, 270, 315, 360] }]*/ | ||
import { defaults, isPlainObject } from "lodash"; | ||
import defaults from "lodash/defaults"; | ||
import isPlainObject from "lodash/isPlainObject"; | ||
import * as d3Shape from "victory-vendor/d3-shape"; | ||
@@ -93,3 +94,3 @@ | ||
: Style.getColorScale(colorScale, theme); | ||
const padding = Helpers.getPadding(props); | ||
const padding = Helpers.getPadding(props.padding); | ||
const defaultRadius = getRadius(props, padding); | ||
@@ -96,0 +97,0 @@ const origin = getOrigin(props, padding); |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1180766
21408
+ Addedvictory-core@37.3.3(transitive)
+ Addedvictory-vendor@37.3.3(transitive)
- Removedvictory-core@37.3.2(transitive)
- Removedvictory-vendor@37.3.2(transitive)
Updatedvictory-core@37.3.3
Updatedvictory-vendor@37.3.3