victory-core
Advanced tools
Comparing version 37.2.0 to 37.3.0
# victory-core | ||
## 37.3.0 | ||
### Minor Changes | ||
- Clean theme color updates and other minor adjustments ([#2920](https://github.com/FormidableLabs/victory/pull/2920)) | ||
* Fix VictoryPortal id changing for every render ([#2929](https://github.com/FormidableLabs/victory/pull/2929)) | ||
### Patch Changes | ||
- fix categories array of strings ([#2919](https://github.com/FormidableLabs/victory/pull/2919)) | ||
## 37.2.0 | ||
@@ -4,0 +16,0 @@ |
import _uniqueId from "lodash/uniqueId"; | ||
import _defaults from "lodash/defaults"; | ||
import React from "react"; | ||
import React, { useState } from "react"; | ||
import * as Log from "../victory-util/log"; | ||
@@ -15,3 +15,3 @@ import * as Helpers from "../victory-util/helpers"; | ||
}; | ||
const id = _uniqueId(); | ||
const [id] = useState(_uniqueId()); | ||
const portalContext = usePortalContext(); | ||
@@ -18,0 +18,0 @@ if (!portalContext) { |
@@ -29,2 +29,3 @@ // * | ||
"500": "#FF6F2C", | ||
"700": "#FF4E1B", | ||
"900": "#D74D26" | ||
@@ -36,10 +37,5 @@ }; | ||
"500": "#F82B60", | ||
"700": "#D31A3D", | ||
"900": "#BA1E45" | ||
}; | ||
const pink = { | ||
"100": "#FFDAF6", | ||
"300": "#F99DE2", | ||
"500": "#FF08C2", | ||
"900": "#B2158B" | ||
}; | ||
const purple = { | ||
@@ -55,2 +51,3 @@ "100": "#EDE3FE", | ||
"500": "#2D7FF9", | ||
"700": "#0056B3", | ||
"900": "#2750AE" | ||
@@ -74,2 +71,3 @@ }; | ||
"500": "#20C933", | ||
"700": "#1B9B2A", | ||
"900": "#338A17" | ||
@@ -79,19 +77,19 @@ }; | ||
blue: blue["500"], | ||
pink: pink["500"], | ||
teal: teal["500"], | ||
purple: purple["500"], | ||
cyan: cyan["500"], | ||
green: green["500"], | ||
yellow: yellow["500"], | ||
orange: orange["500"], | ||
cyan: cyan["500"], | ||
red: red["500"], | ||
yellow: yellow["500"] | ||
purple: purple["500"], | ||
teal: teal["500"] | ||
}; | ||
const colorScale = Object.values(colors); | ||
const grayscale = [gray["200"], gray["400"], gray["600"], gray["900"]]; | ||
const warm = [yellow["500"], orange["500"], red["500"], pink["500"]]; | ||
const cool = [cyan["500"], teal["500"], blue["500"], purple["500"]]; | ||
const heatmap = [green["500"], yellow["500"], red["500"]]; | ||
const redPalette = [red["500"], red["300"], red["100"]]; | ||
const greenPalette = [green["500"], green["300"], green["100"]]; | ||
const bluePalette = [blue["500"], blue["300"], blue["100"]]; | ||
const grayscale = [gray["100"], gray["300"], gray["500"], gray["700"], gray["900"]]; | ||
const warm = [yellow["300"], yellow["500"], orange["500"], orange["900"], red["500"]]; | ||
const cool = [purple["500"], blue["500"], cyan["500"], teal["500"], green["500"]]; | ||
const heatmap = [green["900"], green["500"], yellow["500"], orange["500"], red["500"]]; | ||
const redPalette = Object.values(red); | ||
const greenPalette = Object.values(green); | ||
const bluePalette = Object.values(blue); | ||
const defaultColor = blue["500"]; | ||
@@ -111,3 +109,3 @@ // * | ||
height: 300, | ||
padding: 50, | ||
padding: 60, | ||
colorScale | ||
@@ -156,3 +154,3 @@ }; | ||
data: { | ||
fill: blue["500"], | ||
fill: defaultColor, | ||
strokeWidth: 2, | ||
@@ -174,3 +172,3 @@ fillOpacity: 0.5 | ||
axisLabel: Object.assign({}, centeredLabelStyles, { | ||
padding, | ||
padding: 35, | ||
stroke: "transparent" | ||
@@ -240,3 +238,3 @@ }), | ||
data: { | ||
fill: blue["500"], | ||
fill: defaultColor, | ||
padding, | ||
@@ -280,3 +278,3 @@ strokeWidth: 1, | ||
padding, | ||
fill: teal["500"], | ||
fill: colorScale[0], | ||
rx: borderRadius, | ||
@@ -290,3 +288,3 @@ strokeWidth: 2 | ||
padding, | ||
fill: cyan["500"], | ||
fill: colorScale[1], | ||
rx: borderRadius | ||
@@ -312,4 +310,4 @@ }, | ||
candleColors: { | ||
positive: teal["500"], | ||
negative: orange["500"] | ||
positive: green["500"], | ||
negative: red["500"] | ||
}, | ||
@@ -380,3 +378,3 @@ wickStrokeWidth: 2 | ||
opacity: 1, | ||
stroke: blue["500"], | ||
stroke: defaultColor, | ||
strokeWidth: 2, | ||
@@ -412,3 +410,3 @@ strokeLinecap, | ||
data: { | ||
fill: purple["500"], | ||
fill: defaultColor, | ||
opacity: 1, | ||
@@ -451,5 +449,4 @@ stroke: "transparent", | ||
fill: blue["100"], | ||
stroke: blue["500"], | ||
strokeWidth: 2, | ||
opacity: 0.4 | ||
stroke: defaultColor, | ||
strokeWidth: 2 | ||
}, | ||
@@ -456,0 +453,0 @@ labels: Object.assign({}, baseLabelStyles, { |
@@ -20,3 +20,3 @@ export declare function addBinsToParentPropsIfHistogram({ children, props, childComponents, parentProps, }: { | ||
export declare function getChildStyle(child: any, index: any, calculatedProps: any, theme: any): any; | ||
export declare function getStringsFromCategories(childComponents: any, axis: any): any[]; | ||
export declare function getStringsFromChildrenCategories(childComponents: any, axis: any): any[]; | ||
export declare function getStringsFromData(childComponents: any): { | ||
@@ -23,0 +23,0 @@ x: number[]; |
@@ -1,2 +0,1 @@ | ||
import _isPlainObject from "lodash/isPlainObject"; | ||
import _uniqBy from "lodash/uniqBy"; | ||
@@ -314,11 +313,9 @@ import _groupBy from "lodash/groupBy"; | ||
} | ||
export function getStringsFromCategories(childComponents, axis) { | ||
export function getStringsFromChildrenCategories(childComponents, axis) { | ||
const iteratee = child => { | ||
const childProps = child.props || {}; | ||
if (!Domain.isDomainComponent(child) || !childProps.categories) { | ||
if (!Domain.isDomainComponent(child)) { | ||
return null; | ||
} | ||
const categories = childProps.categories && !Array.isArray(childProps.categories) ? childProps.categories[axis] : childProps.props.categories; | ||
const categoryStrings = categories && categories.filter(val => typeof val === "string"); | ||
return categoryStrings ? Collection.removeUndefined(categoryStrings) : []; | ||
const childProps = child.props || {}; | ||
return Data.getStringsFromCategories(childProps, axis); | ||
}; | ||
@@ -358,6 +355,6 @@ return Helpers.reduceChildren(childComponents.slice(0), iteratee); | ||
export function getCategoryAndAxisStringsFromChildren(props, axis, childComponents) { | ||
const categories = _isPlainObject(props.categories) ? props.categories[axis] : props.categories; | ||
const categories = Data.getStringsFromCategories(props, axis); | ||
const axisComponent = Axis.getAxisComponent(childComponents, axis); | ||
const axisStrings = axisComponent ? Data.getStringsFromAxes(axisComponent.props, axis) : []; | ||
const categoryStrings = categories || getStringsFromCategories(childComponents, axis); | ||
const categoryStrings = categories.length ? categories : getStringsFromChildrenCategories(childComponents, axis); | ||
return _uniq([...categoryStrings, ...axisStrings].flat()); | ||
@@ -376,4 +373,4 @@ } | ||
export function getCategories(props, childComponents, allStrings) { | ||
const xPropCategories = props.categories && !Array.isArray(props.categories) ? props.categories.x : props.categories; | ||
const yPropCategories = props.categories && !Array.isArray(props.categories) ? props.categories.y : props.categories; | ||
const xPropCategories = props.categories && Data.getStringsFromCategories(props, "x"); | ||
const yPropCategories = props.categories && Data.getStringsFromCategories(props, "y"); | ||
const fallbackRequired = !xPropCategories || !yPropCategories; | ||
@@ -380,0 +377,0 @@ const fallbackProps = fallbackRequired ? allStrings || getStringsFromChildren(props, childComponents) : {}; |
@@ -9,3 +9,3 @@ "use strict"; | ||
var _defaults2 = _interopRequireDefault(require("lodash/defaults")); | ||
var _react = _interopRequireDefault(require("react")); | ||
var _react = _interopRequireWildcard(require("react")); | ||
var Log = _interopRequireWildcard(require("../victory-util/log")); | ||
@@ -25,3 +25,3 @@ var Helpers = _interopRequireWildcard(require("../victory-util/helpers")); | ||
}; | ||
const id = (0, _uniqueId2.default)(); | ||
const [id] = (0, _react.useState)((0, _uniqueId2.default)()); | ||
const portalContext = (0, _portalContext.usePortalContext)(); | ||
@@ -28,0 +28,0 @@ if (!portalContext) { |
@@ -35,2 +35,3 @@ "use strict"; | ||
"500": "#FF6F2C", | ||
"700": "#FF4E1B", | ||
"900": "#D74D26" | ||
@@ -42,10 +43,5 @@ }; | ||
"500": "#F82B60", | ||
"700": "#D31A3D", | ||
"900": "#BA1E45" | ||
}; | ||
const pink = { | ||
"100": "#FFDAF6", | ||
"300": "#F99DE2", | ||
"500": "#FF08C2", | ||
"900": "#B2158B" | ||
}; | ||
const purple = { | ||
@@ -61,2 +57,3 @@ "100": "#EDE3FE", | ||
"500": "#2D7FF9", | ||
"700": "#0056B3", | ||
"900": "#2750AE" | ||
@@ -80,2 +77,3 @@ }; | ||
"500": "#20C933", | ||
"700": "#1B9B2A", | ||
"900": "#338A17" | ||
@@ -85,19 +83,19 @@ }; | ||
blue: blue["500"], | ||
pink: pink["500"], | ||
teal: teal["500"], | ||
purple: purple["500"], | ||
cyan: cyan["500"], | ||
green: green["500"], | ||
yellow: yellow["500"], | ||
orange: orange["500"], | ||
cyan: cyan["500"], | ||
red: red["500"], | ||
yellow: yellow["500"] | ||
purple: purple["500"], | ||
teal: teal["500"] | ||
}; | ||
const colorScale = Object.values(colors); | ||
const grayscale = [gray["200"], gray["400"], gray["600"], gray["900"]]; | ||
const warm = [yellow["500"], orange["500"], red["500"], pink["500"]]; | ||
const cool = [cyan["500"], teal["500"], blue["500"], purple["500"]]; | ||
const heatmap = [green["500"], yellow["500"], red["500"]]; | ||
const redPalette = [red["500"], red["300"], red["100"]]; | ||
const greenPalette = [green["500"], green["300"], green["100"]]; | ||
const bluePalette = [blue["500"], blue["300"], blue["100"]]; | ||
const grayscale = [gray["100"], gray["300"], gray["500"], gray["700"], gray["900"]]; | ||
const warm = [yellow["300"], yellow["500"], orange["500"], orange["900"], red["500"]]; | ||
const cool = [purple["500"], blue["500"], cyan["500"], teal["500"], green["500"]]; | ||
const heatmap = [green["900"], green["500"], yellow["500"], orange["500"], red["500"]]; | ||
const redPalette = Object.values(red); | ||
const greenPalette = Object.values(green); | ||
const bluePalette = Object.values(blue); | ||
const defaultColor = blue["500"]; | ||
@@ -117,3 +115,3 @@ // * | ||
height: 300, | ||
padding: 50, | ||
padding: 60, | ||
colorScale | ||
@@ -162,3 +160,3 @@ }; | ||
data: { | ||
fill: blue["500"], | ||
fill: defaultColor, | ||
strokeWidth: 2, | ||
@@ -180,3 +178,3 @@ fillOpacity: 0.5 | ||
axisLabel: Object.assign({}, centeredLabelStyles, { | ||
padding, | ||
padding: 35, | ||
stroke: "transparent" | ||
@@ -246,3 +244,3 @@ }), | ||
data: { | ||
fill: blue["500"], | ||
fill: defaultColor, | ||
padding, | ||
@@ -286,3 +284,3 @@ strokeWidth: 1, | ||
padding, | ||
fill: teal["500"], | ||
fill: colorScale[0], | ||
rx: borderRadius, | ||
@@ -296,3 +294,3 @@ strokeWidth: 2 | ||
padding, | ||
fill: cyan["500"], | ||
fill: colorScale[1], | ||
rx: borderRadius | ||
@@ -318,4 +316,4 @@ }, | ||
candleColors: { | ||
positive: teal["500"], | ||
negative: orange["500"] | ||
positive: green["500"], | ||
negative: red["500"] | ||
}, | ||
@@ -386,3 +384,3 @@ wickStrokeWidth: 2 | ||
opacity: 1, | ||
stroke: blue["500"], | ||
stroke: defaultColor, | ||
strokeWidth: 2, | ||
@@ -418,3 +416,3 @@ strokeLinecap, | ||
data: { | ||
fill: purple["500"], | ||
fill: defaultColor, | ||
opacity: 1, | ||
@@ -457,5 +455,4 @@ stroke: "transparent", | ||
fill: blue["100"], | ||
stroke: blue["500"], | ||
strokeWidth: 2, | ||
opacity: 0.4 | ||
stroke: defaultColor, | ||
strokeWidth: 2 | ||
}, | ||
@@ -462,0 +459,0 @@ labels: Object.assign({}, baseLabelStyles, { |
@@ -20,3 +20,3 @@ export declare function addBinsToParentPropsIfHistogram({ children, props, childComponents, parentProps, }: { | ||
export declare function getChildStyle(child: any, index: any, calculatedProps: any, theme: any): any; | ||
export declare function getStringsFromCategories(childComponents: any, axis: any): any[]; | ||
export declare function getStringsFromChildrenCategories(childComponents: any, axis: any): any[]; | ||
export declare function getStringsFromData(childComponents: any): { | ||
@@ -23,0 +23,0 @@ x: number[]; |
@@ -18,8 +18,7 @@ "use strict"; | ||
exports.getScale = getScale; | ||
exports.getStringsFromCategories = getStringsFromCategories; | ||
exports.getStringsFromChildren = getStringsFromChildren; | ||
exports.getStringsFromChildrenCategories = getStringsFromChildrenCategories; | ||
exports.getStringsFromData = getStringsFromData; | ||
exports.getStyle = getStyle; | ||
exports.getWidth = getWidth; | ||
var _isPlainObject2 = _interopRequireDefault(require("lodash/isPlainObject")); | ||
var _uniqBy2 = _interopRequireDefault(require("lodash/uniqBy")); | ||
@@ -340,11 +339,9 @@ var _groupBy2 = _interopRequireDefault(require("lodash/groupBy")); | ||
} | ||
function getStringsFromCategories(childComponents, axis) { | ||
function getStringsFromChildrenCategories(childComponents, axis) { | ||
const iteratee = child => { | ||
const childProps = child.props || {}; | ||
if (!Domain.isDomainComponent(child) || !childProps.categories) { | ||
if (!Domain.isDomainComponent(child)) { | ||
return null; | ||
} | ||
const categories = childProps.categories && !Array.isArray(childProps.categories) ? childProps.categories[axis] : childProps.props.categories; | ||
const categoryStrings = categories && categories.filter(val => typeof val === "string"); | ||
return categoryStrings ? Collection.removeUndefined(categoryStrings) : []; | ||
const childProps = child.props || {}; | ||
return Data.getStringsFromCategories(childProps, axis); | ||
}; | ||
@@ -384,6 +381,6 @@ return Helpers.reduceChildren(childComponents.slice(0), iteratee); | ||
function getCategoryAndAxisStringsFromChildren(props, axis, childComponents) { | ||
const categories = (0, _isPlainObject2.default)(props.categories) ? props.categories[axis] : props.categories; | ||
const categories = Data.getStringsFromCategories(props, axis); | ||
const axisComponent = Axis.getAxisComponent(childComponents, axis); | ||
const axisStrings = axisComponent ? Data.getStringsFromAxes(axisComponent.props, axis) : []; | ||
const categoryStrings = categories || getStringsFromCategories(childComponents, axis); | ||
const categoryStrings = categories.length ? categories : getStringsFromChildrenCategories(childComponents, axis); | ||
return (0, _uniq2.default)([...categoryStrings, ...axisStrings].flat()); | ||
@@ -402,4 +399,4 @@ } | ||
function getCategories(props, childComponents, allStrings) { | ||
const xPropCategories = props.categories && !Array.isArray(props.categories) ? props.categories.x : props.categories; | ||
const yPropCategories = props.categories && !Array.isArray(props.categories) ? props.categories.y : props.categories; | ||
const xPropCategories = props.categories && Data.getStringsFromCategories(props, "x"); | ||
const yPropCategories = props.categories && Data.getStringsFromCategories(props, "y"); | ||
const fallbackRequired = !xPropCategories || !yPropCategories; | ||
@@ -406,0 +403,0 @@ const fallbackProps = fallbackRequired ? allStrings || getStringsFromChildren(props, childComponents) : {}; |
{ | ||
"name": "victory-core", | ||
"version": "37.2.0", | ||
"version": "37.3.0", | ||
"description": "Victory Core", | ||
@@ -25,3 +25,3 @@ "keywords": [ | ||
"react-fast-compare": "^3.2.0", | ||
"victory-vendor": "37.2.0" | ||
"victory-vendor": "37.3.0" | ||
}, | ||
@@ -28,0 +28,0 @@ "peerDependencies": { |
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
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
2599272
57034
+ Addedvictory-vendor@37.3.0(transitive)
- Removedvictory-vendor@37.2.0(transitive)
Updatedvictory-vendor@37.3.0