victory-core
Advanced tools
Comparing version 36.8.5-next.0 to 36.8.5
# victory-core | ||
## 36.8.5-next.0 | ||
## 36.8.5 | ||
### Patch Changes | ||
- c8c2eb2f5: Replace instances of lodash.assign with Object.assign | ||
- 0f3abe234: Migrate victory-native to TypeScript | ||
- Updated dependencies [c8c2eb2f5] | ||
- victory-vendor@36.8.5-next.0 | ||
- Replace instances of lodash.assign with Object.assign ([#2757](https://github.com/FormidableLabs/victory/pull/2757)) | ||
* Replace instances of lodash.range with equivalent native code ([#2760](https://github.com/FormidableLabs/victory/pull/2760)) | ||
## 36.8.4 | ||
@@ -13,0 +12,0 @@ |
@@ -0,0 +0,0 @@ export * from "./types/callbacks"; |
@@ -0,0 +0,0 @@ import { D3Scale, Datum, ID, ScalePropType } from "./prop-types"; |
@@ -0,0 +0,0 @@ import * as React from "react"; |
@@ -0,0 +0,0 @@ import React from "react"; |
@@ -0,0 +0,0 @@ export declare const isInterpolatable: (obj: any) => boolean; |
@@ -0,0 +0,0 @@ import React from "react"; |
@@ -62,3 +62,3 @@ import React from "react"; | ||
}; | ||
clipId: VictoryClipContainerProps["clipId"]; | ||
private clipId; | ||
constructor(props: VictoryClipContainerProps); | ||
@@ -65,0 +65,0 @@ calculateAttributes(props: any): { |
@@ -37,3 +37,3 @@ import React from "react"; | ||
} | ||
export declare class VictoryContainer<TProps extends VictoryContainerProps> extends React.Component<TProps> { | ||
export declare class VictoryContainer extends React.Component<VictoryContainerProps> { | ||
static displayName: string; | ||
@@ -86,3 +86,3 @@ static role: string; | ||
private shouldHandleWheel; | ||
constructor(props: TProps); | ||
constructor(props: VictoryContainerProps); | ||
savePortalRef: (portal: any) => any; | ||
@@ -89,0 +89,0 @@ portalUpdate: (key: any, el: any) => void; |
@@ -0,0 +0,0 @@ import React from "react"; |
@@ -0,0 +0,0 @@ import React from "react"; |
@@ -26,5 +26,5 @@ import React from "react"; | ||
portalDeregister: (key: number) => void; | ||
getChildren(): React.ReactElement<any, string | React.JSXElementConstructor<any>>[]; | ||
private getChildren; | ||
render(): JSX.Element; | ||
} | ||
//# sourceMappingURL=portal.d.ts.map |
@@ -23,5 +23,5 @@ import React from "react"; | ||
private checkedContext; | ||
private renderInPlace; | ||
private element; | ||
private portalKey; | ||
renderInPlace: boolean; | ||
element: React.ReactElement; | ||
componentDidMount(): void; | ||
@@ -28,0 +28,0 @@ componentDidUpdate(): void; |
@@ -44,5 +44,5 @@ import _defaults from "lodash/defaults"; | ||
_this.checkedContext = void 0; | ||
_this.portalKey = void 0; | ||
_this.renderInPlace = void 0; | ||
_this.element = void 0; | ||
_this.portalKey = void 0; | ||
return _this; | ||
@@ -49,0 +49,0 @@ } |
@@ -13,3 +13,2 @@ import React from "react"; | ||
startAngle?: number; | ||
type?: string; | ||
} | ||
@@ -16,0 +15,0 @@ export declare const Arc: { |
@@ -0,0 +0,0 @@ import React from "react"; |
@@ -0,0 +0,0 @@ import React from "react"; |
@@ -0,0 +0,0 @@ import React from "react"; |
@@ -0,0 +0,0 @@ import React from "react"; |
@@ -0,0 +0,0 @@ export * from "./arc"; |
@@ -0,0 +0,0 @@ import React from "react"; |
@@ -0,0 +0,0 @@ import React from "react"; |
@@ -0,0 +0,0 @@ import React from "react"; |
@@ -0,0 +0,0 @@ import PropTypes from "prop-types"; |
@@ -0,0 +0,0 @@ import React from "react"; |
@@ -0,0 +0,0 @@ import React from "react"; |
@@ -0,0 +0,0 @@ /// <reference types="react" /> |
@@ -0,0 +0,0 @@ import { VictoryCommonPrimitiveProps } from "../victory-util/common-props"; |
@@ -0,0 +0,0 @@ import React from "react"; |
import { VictoryThemeDefinition } from "./types"; | ||
export declare const grayscale: VictoryThemeDefinition; | ||
//# sourceMappingURL=grayscale.d.ts.map |
import { VictoryThemeDefinition } from "./types"; | ||
export declare const material: VictoryThemeDefinition; | ||
//# sourceMappingURL=material.d.ts.map |
@@ -0,0 +0,0 @@ import * as React from "react"; |
@@ -0,0 +0,0 @@ export * from "./types"; |
@@ -0,0 +0,0 @@ import React from "react"; |
@@ -0,0 +0,0 @@ import React from "react"; |
@@ -0,0 +0,0 @@ import { D3Scale } from "../types/prop-types"; |
@@ -5,3 +5,2 @@ import _without from "lodash/without"; | ||
import _orderBy from "lodash/orderBy"; | ||
import _range from "lodash/range"; | ||
import _uniq from "lodash/uniq"; | ||
@@ -224,3 +223,3 @@ import _invert from "lodash/invert"; | ||
return stringMap[tick]; | ||
}) : _range(1, tickValues.length + 1); | ||
}) : Helpers.range(1, tickValues.length + 1); | ||
} | ||
@@ -227,0 +226,0 @@ |
@@ -0,0 +0,0 @@ export declare function containsStrings<T>(collection: Array<T>): boolean; |
@@ -0,0 +0,0 @@ import * as React from "react"; |
@@ -0,0 +0,0 @@ export declare function formatDataFromDomain(dataset: any, domain: any, defaultBaseline?: any): any; |
@@ -11,3 +11,2 @@ import _omitBy from "lodash/omitBy"; | ||
import _last from "lodash/last"; | ||
import _range from "lodash/range"; | ||
import _uniq from "lodash/uniq"; | ||
@@ -54,5 +53,3 @@ | ||
var step = (domainMax - domainMin) / samples; | ||
var values = _range(domainMin, domainMax, step); | ||
var values = Helpers.range(domainMin, domainMax, step); | ||
return _last(values) === domainMax ? values : values.concat(domainMax); | ||
@@ -59,0 +56,0 @@ } // Returns sorted data. If no sort keys are provided, data is returned unaltered. |
@@ -0,0 +0,0 @@ import { AnimatePropTypeInterface } from "../types/prop-types"; |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ /// <reference types="react" /> |
@@ -48,2 +48,13 @@ import React from "react"; | ||
/** | ||
* Creates an array of numbers (positive and/or negative) progressing | ||
* from start up to, but not including, end. | ||
* A step of -1 is used if a negative start is specified without an end or step. | ||
* If end is not specified, it's set to start with start then set to 0. | ||
* | ||
* @param start The length of the array to create, or the start value | ||
* @param end [The end value] If this is defined, start is the start value | ||
* @returns An array of the given length | ||
*/ | ||
export declare function range(start: number, end?: number, increment?: number): number[]; | ||
/** | ||
* @param {Array} children: an array of child components | ||
@@ -50,0 +61,0 @@ * @param {Function} iteratee: a function with arguments "child", "childName", and "parent" |
@@ -266,2 +266,34 @@ import _keys from "lodash/keys"; | ||
/** | ||
* Creates an array of numbers (positive and/or negative) progressing | ||
* from start up to, but not including, end. | ||
* A step of -1 is used if a negative start is specified without an end or step. | ||
* If end is not specified, it's set to start with start then set to 0. | ||
* | ||
* @param start The length of the array to create, or the start value | ||
* @param end [The end value] If this is defined, start is the start value | ||
* @returns An array of the given length | ||
*/ | ||
export function range(start, end, increment) { | ||
// when the end index is not given, start from 0 | ||
var startIndex = end ? start : 0; // when the end index is not given, the end of the range is the start index | ||
var endIndex = end ? end : start; // ensure endIndex is not a falsy value | ||
if (!endIndex) endIndex = 0; | ||
var k = endIndex - startIndex; // the value range | ||
var length = Math.abs(k); // the length of the range | ||
var sign = k / length || 1; // the sign of the range (negative or positive) | ||
var inc = increment || 1; // the step size of each increment | ||
// normalize the array length when dealing with floating point values | ||
var arrayLength = Math.max(Math.ceil(length / inc), 0); | ||
return Array.from(Array(arrayLength), function (_, i) { | ||
return startIndex + i * sign * inc; | ||
}); | ||
} | ||
/** | ||
* @param {Array} children: an array of child components | ||
@@ -268,0 +300,0 @@ * @param {Function} iteratee: a function with arguments "child", "childName", and "parent" |
export { usePreviousProps } from "./use-previous-props"; | ||
export { useAnimationState } from "./use-animation-state"; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -0,0 +0,0 @@ declare type AnyObject = Record<string, any>; |
export declare function usePreviousProps<T>(props: T): T | undefined; | ||
//# sourceMappingURL=use-previous-props.d.ts.map |
@@ -0,0 +0,0 @@ import type { Iterable, List, Map } from "./immutable-types"; |
@@ -0,0 +0,0 @@ export * from "./add-events"; |
@@ -0,0 +0,0 @@ export declare function getText(props: any, datum: Record<string, any> | undefined, index: any): any; |
@@ -0,0 +0,0 @@ import * as d3Shape from "victory-vendor/d3-shape"; |
export declare function warn(message: string): void; | ||
//# sourceMappingURL=log.d.ts.map |
@@ -0,0 +0,0 @@ export declare function circle(x: number, y: number, size: number): string; |
@@ -1,2 +0,3 @@ | ||
import _range from "lodash/range"; | ||
/* eslint no-magic-numbers: ["error", { "ignore": [0, 1, 2, 2.5, 3] }]*/ | ||
import * as Helpers from "./helpers"; | ||
export function circle(x, y, size) { | ||
@@ -65,8 +66,7 @@ return "M ".concat(x, ", ").concat(y, "\n m ").concat(-size, ", 0\n a ").concat(size, ", ").concat(size, " 0 1,0 ").concat(size * 2, ",0\n a ").concat(size, ", ").concat(size, " 0 1,0 ").concat(-size * 2, ",0"); | ||
var starCoords = _range(10).map(function (index) { | ||
var starCoords = Helpers.range(10).map(function (index) { | ||
var length = index % 2 === 0 ? baseSize : baseSize / 2; | ||
return "".concat(length * Math.sin(angle * (index + 1)) + x, ",\n ").concat(length * Math.cos(angle * (index + 1)) + y); | ||
}); | ||
return "M ".concat(starCoords.join("L"), " z"); | ||
} |
@@ -0,0 +0,0 @@ import PropTypes from "prop-types"; |
@@ -0,0 +0,0 @@ import * as d3Scale from "victory-vendor/d3-scale"; |
@@ -0,0 +0,0 @@ import React from "react"; |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ import React from "react"; |
@@ -0,0 +0,0 @@ declare type TimerCallback = (elapsed: number, duration: number) => void; |
@@ -0,0 +0,0 @@ import { AnimatePropTypeInterface } from "../types/prop-types"; |
@@ -0,0 +0,0 @@ import { ForAxes, AxisType, Tuple, Datum, DatumValue } from "../types/prop-types"; |
@@ -0,0 +0,0 @@ import * as React from "react"; |
@@ -0,0 +0,0 @@ export declare function addBinsToParentPropsIfHistogram({ children, props, childComponents, parentProps, }: { |
@@ -0,0 +0,0 @@ export * from "./types/callbacks"; |
@@ -0,0 +0,0 @@ import { D3Scale, Datum, ID, ScalePropType } from "./prop-types"; |
@@ -0,0 +0,0 @@ import * as React from "react"; |
@@ -0,0 +0,0 @@ import React from "react"; |
@@ -0,0 +0,0 @@ export declare const isInterpolatable: (obj: any) => boolean; |
@@ -0,0 +0,0 @@ import React from "react"; |
@@ -62,3 +62,3 @@ import React from "react"; | ||
}; | ||
clipId: VictoryClipContainerProps["clipId"]; | ||
private clipId; | ||
constructor(props: VictoryClipContainerProps); | ||
@@ -65,0 +65,0 @@ calculateAttributes(props: any): { |
@@ -37,3 +37,3 @@ import React from "react"; | ||
} | ||
export declare class VictoryContainer<TProps extends VictoryContainerProps> extends React.Component<TProps> { | ||
export declare class VictoryContainer extends React.Component<VictoryContainerProps> { | ||
static displayName: string; | ||
@@ -86,3 +86,3 @@ static role: string; | ||
private shouldHandleWheel; | ||
constructor(props: TProps); | ||
constructor(props: VictoryContainerProps); | ||
savePortalRef: (portal: any) => any; | ||
@@ -89,0 +89,0 @@ portalUpdate: (key: any, el: any) => void; |
@@ -0,0 +0,0 @@ import React from "react"; |
@@ -0,0 +0,0 @@ import React from "react"; |
@@ -26,5 +26,5 @@ import React from "react"; | ||
portalDeregister: (key: number) => void; | ||
getChildren(): React.ReactElement<any, string | React.JSXElementConstructor<any>>[]; | ||
private getChildren; | ||
render(): JSX.Element; | ||
} | ||
//# sourceMappingURL=portal.d.ts.map |
@@ -23,5 +23,5 @@ import React from "react"; | ||
private checkedContext; | ||
private renderInPlace; | ||
private element; | ||
private portalKey; | ||
renderInPlace: boolean; | ||
element: React.ReactElement; | ||
componentDidMount(): void; | ||
@@ -28,0 +28,0 @@ componentDidUpdate(): void; |
@@ -62,5 +62,5 @@ "use strict"; | ||
_this.checkedContext = void 0; | ||
_this.portalKey = void 0; | ||
_this.renderInPlace = void 0; | ||
_this.element = void 0; | ||
_this.portalKey = void 0; | ||
return _this; | ||
@@ -67,0 +67,0 @@ } |
@@ -13,3 +13,2 @@ import React from "react"; | ||
startAngle?: number; | ||
type?: string; | ||
} | ||
@@ -16,0 +15,0 @@ export declare const Arc: { |
@@ -0,0 +0,0 @@ import React from "react"; |
@@ -0,0 +0,0 @@ import React from "react"; |
@@ -0,0 +0,0 @@ import React from "react"; |
@@ -0,0 +0,0 @@ import React from "react"; |
@@ -0,0 +0,0 @@ export * from "./arc"; |
@@ -0,0 +0,0 @@ import React from "react"; |
@@ -0,0 +0,0 @@ import React from "react"; |
@@ -0,0 +0,0 @@ import React from "react"; |
@@ -0,0 +0,0 @@ import PropTypes from "prop-types"; |
@@ -0,0 +0,0 @@ import React from "react"; |
@@ -0,0 +0,0 @@ import React from "react"; |
@@ -0,0 +0,0 @@ /// <reference types="react" /> |
@@ -0,0 +0,0 @@ import { VictoryCommonPrimitiveProps } from "../victory-util/common-props"; |
@@ -0,0 +0,0 @@ import React from "react"; |
import { VictoryThemeDefinition } from "./types"; | ||
export declare const grayscale: VictoryThemeDefinition; | ||
//# sourceMappingURL=grayscale.d.ts.map |
import { VictoryThemeDefinition } from "./types"; | ||
export declare const material: VictoryThemeDefinition; | ||
//# sourceMappingURL=material.d.ts.map |
@@ -0,0 +0,0 @@ import * as React from "react"; |
@@ -0,0 +0,0 @@ export * from "./types"; |
@@ -0,0 +0,0 @@ import React from "react"; |
@@ -0,0 +0,0 @@ import React from "react"; |
@@ -0,0 +0,0 @@ import { D3Scale } from "../types/prop-types"; |
@@ -28,4 +28,2 @@ "use strict"; | ||
var _range2 = _interopRequireDefault(require("lodash/range")); | ||
var _uniq2 = _interopRequireDefault(require("lodash/uniq")); | ||
@@ -265,3 +263,3 @@ | ||
return stringMap[tick]; | ||
}) : (0, _range2.default)(1, tickValues.length + 1); | ||
}) : Helpers.range(1, tickValues.length + 1); | ||
} | ||
@@ -268,0 +266,0 @@ |
@@ -0,0 +0,0 @@ export declare function containsStrings<T>(collection: Array<T>): boolean; |
@@ -0,0 +0,0 @@ import * as React from "react"; |
@@ -0,0 +0,0 @@ export declare function formatDataFromDomain(dataset: any, domain: any, defaultBaseline?: any): any; |
@@ -38,4 +38,2 @@ "use strict"; | ||
var _range2 = _interopRequireDefault(require("lodash/range")); | ||
var _uniq2 = _interopRequireDefault(require("lodash/uniq")); | ||
@@ -92,3 +90,3 @@ | ||
var step = (domainMax - domainMin) / samples; | ||
var values = (0, _range2.default)(domainMin, domainMax, step); | ||
var values = Helpers.range(domainMin, domainMax, step); | ||
return (0, _last2.default)(values) === domainMax ? values : values.concat(domainMax); | ||
@@ -95,0 +93,0 @@ } // Returns sorted data. If no sort keys are provided, data is returned unaltered. |
@@ -0,0 +0,0 @@ import { AnimatePropTypeInterface } from "../types/prop-types"; |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ /// <reference types="react" /> |
@@ -48,2 +48,13 @@ import React from "react"; | ||
/** | ||
* Creates an array of numbers (positive and/or negative) progressing | ||
* from start up to, but not including, end. | ||
* A step of -1 is used if a negative start is specified without an end or step. | ||
* If end is not specified, it's set to start with start then set to 0. | ||
* | ||
* @param start The length of the array to create, or the start value | ||
* @param end [The end value] If this is defined, start is the start value | ||
* @returns An array of the given length | ||
*/ | ||
export declare function range(start: number, end?: number, increment?: number): number[]; | ||
/** | ||
* @param {Array} children: an array of child components | ||
@@ -50,0 +61,0 @@ * @param {Function} iteratee: a function with arguments "child", "childName", and "parent" |
@@ -23,2 +23,3 @@ "use strict"; | ||
exports.radiansToDegrees = radiansToDegrees; | ||
exports.range = range; | ||
exports.reduceChildren = reduceChildren; | ||
@@ -316,2 +317,35 @@ exports.scalePoint = scalePoint; | ||
/** | ||
* Creates an array of numbers (positive and/or negative) progressing | ||
* from start up to, but not including, end. | ||
* A step of -1 is used if a negative start is specified without an end or step. | ||
* If end is not specified, it's set to start with start then set to 0. | ||
* | ||
* @param start The length of the array to create, or the start value | ||
* @param end [The end value] If this is defined, start is the start value | ||
* @returns An array of the given length | ||
*/ | ||
function range(start, end, increment) { | ||
// when the end index is not given, start from 0 | ||
var startIndex = end ? start : 0; // when the end index is not given, the end of the range is the start index | ||
var endIndex = end ? end : start; // ensure endIndex is not a falsy value | ||
if (!endIndex) endIndex = 0; | ||
var k = endIndex - startIndex; // the value range | ||
var length = Math.abs(k); // the length of the range | ||
var sign = k / length || 1; // the sign of the range (negative or positive) | ||
var inc = increment || 1; // the step size of each increment | ||
// normalize the array length when dealing with floating point values | ||
var arrayLength = Math.max(Math.ceil(length / inc), 0); | ||
return Array.from(Array(arrayLength), function (_, i) { | ||
return startIndex + i * sign * inc; | ||
}); | ||
} | ||
/** | ||
* @param {Array} children: an array of child components | ||
@@ -318,0 +352,0 @@ * @param {Function} iteratee: a function with arguments "child", "childName", and "parent" |
export { usePreviousProps } from "./use-previous-props"; | ||
export { useAnimationState } from "./use-animation-state"; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -0,0 +0,0 @@ declare type AnyObject = Record<string, any>; |
export declare function usePreviousProps<T>(props: T): T | undefined; | ||
//# sourceMappingURL=use-previous-props.d.ts.map |
@@ -0,0 +0,0 @@ import type { Iterable, List, Map } from "./immutable-types"; |
@@ -0,0 +0,0 @@ export * from "./add-events"; |
@@ -0,0 +0,0 @@ export declare function getText(props: any, datum: Record<string, any> | undefined, index: any): any; |
@@ -0,0 +0,0 @@ import * as d3Shape from "victory-vendor/d3-shape"; |
export declare function warn(message: string): void; | ||
//# sourceMappingURL=log.d.ts.map |
@@ -0,0 +0,0 @@ export declare function circle(x: number, y: number, size: number): string; |
@@ -16,6 +16,9 @@ "use strict"; | ||
var _range2 = _interopRequireDefault(require("lodash/range")); | ||
var Helpers = _interopRequireWildcard(require("./helpers")); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } | ||
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | ||
/* eslint no-magic-numbers: ["error", { "ignore": [0, 1, 2, 2.5, 3] }]*/ | ||
function circle(x, y, size) { | ||
@@ -92,3 +95,3 @@ return "M ".concat(x, ", ").concat(y, "\n m ").concat(-size, ", 0\n a ").concat(size, ", ").concat(size, " 0 1,0 ").concat(size * 2, ",0\n a ").concat(size, ", ").concat(size, " 0 1,0 ").concat(-size * 2, ",0"); | ||
var starCoords = (0, _range2.default)(10).map(function (index) { | ||
var starCoords = Helpers.range(10).map(function (index) { | ||
var length = index % 2 === 0 ? baseSize : baseSize / 2; | ||
@@ -95,0 +98,0 @@ return "".concat(length * Math.sin(angle * (index + 1)) + x, ",\n ").concat(length * Math.cos(angle * (index + 1)) + y); |
@@ -0,0 +0,0 @@ import PropTypes from "prop-types"; |
@@ -0,0 +0,0 @@ import * as d3Scale from "victory-vendor/d3-scale"; |
@@ -0,0 +0,0 @@ import React from "react"; |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ import React from "react"; |
@@ -0,0 +0,0 @@ declare type TimerCallback = (elapsed: number, duration: number) => void; |
@@ -0,0 +0,0 @@ import { AnimatePropTypeInterface } from "../types/prop-types"; |
@@ -0,0 +0,0 @@ import { ForAxes, AxisType, Tuple, Datum, DatumValue } from "../types/prop-types"; |
@@ -0,0 +0,0 @@ import * as React from "react"; |
@@ -0,0 +0,0 @@ export declare function addBinsToParentPropsIfHistogram({ children, props, childComponents, parentProps, }: { |
{ | ||
"name": "victory-core", | ||
"version": "36.8.5-next.0", | ||
"version": "36.8.5", | ||
"description": "Victory Core", | ||
@@ -26,3 +26,3 @@ "keywords": [ | ||
"react-fast-compare": "^3.2.0", | ||
"victory-vendor": "^36.8.5-next.0" | ||
"victory-vendor": "^36.8.5" | ||
}, | ||
@@ -33,9 +33,9 @@ "peerDependencies": { | ||
"devDependencies": { | ||
"victory-axis": "36.8.5-next.0", | ||
"victory-bar": "36.8.5-next.0", | ||
"victory-core": "36.8.5-next.0", | ||
"victory-line": "36.8.5-next.0" | ||
"victory-axis": "*", | ||
"victory-bar": "*", | ||
"victory-core": "*", | ||
"victory-line": "*" | ||
}, | ||
"publishConfig": { | ||
"provenance": false | ||
"provenance": true | ||
}, | ||
@@ -42,0 +42,0 @@ "wireit": { |
@@ -5,3 +5,2 @@ /* eslint-disable no-use-before-define */ | ||
uniq, | ||
range, | ||
last, | ||
@@ -50,3 +49,3 @@ isFunction, | ||
const step = (domainMax - domainMin) / samples; | ||
const values = range(domainMin, domainMax, step); | ||
const values = Helpers.range(domainMin, domainMax, step); | ||
return last(values) === domainMax ? values : values.concat(domainMax); | ||
@@ -53,0 +52,0 @@ } |
@@ -221,2 +221,33 @@ /* eslint-disable no-use-before-define */ | ||
/** | ||
* Creates an array of numbers (positive and/or negative) progressing | ||
* from start up to, but not including, end. | ||
* A step of -1 is used if a negative start is specified without an end or step. | ||
* If end is not specified, it's set to start with start then set to 0. | ||
* | ||
* @param start The length of the array to create, or the start value | ||
* @param end [The end value] If this is defined, start is the start value | ||
* @returns An array of the given length | ||
*/ | ||
export function range(start: number, end?: number, increment?: number) { | ||
// when the end index is not given, start from 0 | ||
const startIndex = end ? start : 0; | ||
// when the end index is not given, the end of the range is the start index | ||
let endIndex = end ? end : start; | ||
// ensure endIndex is not a falsy value | ||
if (!endIndex) endIndex = 0; | ||
const k = endIndex - startIndex; // the value range | ||
const length = Math.abs(k); // the length of the range | ||
const sign = k / length || 1; // the sign of the range (negative or positive) | ||
const inc = increment || 1; // the step size of each increment | ||
// normalize the array length when dealing with floating point values | ||
const arrayLength = Math.max(Math.ceil(length / inc), 0); | ||
return Array.from(Array(arrayLength), (_, i) => startIndex + i * sign * inc); | ||
} | ||
/** | ||
* @param {Array} children: an array of child components | ||
@@ -223,0 +254,0 @@ * @param {Function} iteratee: a function with arguments "child", "childName", and "parent" |
/* eslint no-magic-numbers: ["error", { "ignore": [0, 1, 2, 2.5, 3] }]*/ | ||
import { range } from "lodash"; | ||
import * as Helpers from "./helpers"; | ||
export function circle(x: number, y: number, size: number) { | ||
@@ -113,3 +114,3 @@ return `M ${x}, ${y} | ||
// eslint-disable-next-line no-magic-numbers | ||
const starCoords = range(10).map((index) => { | ||
const starCoords = Helpers.range(10).map((index) => { | ||
const length = index % 2 === 0 ? baseSize : baseSize / 2; | ||
@@ -116,0 +117,0 @@ return `${length * Math.sin(angle * (index + 1)) + x}, |
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
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
1
2
3125385
61511
Updatedvictory-vendor@^36.8.5