New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

victory-chart

Package Overview
Dependencies
Maintainers
8
Versions
290
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

victory-chart - npm Package Compare versions

Comparing version 35.6.4 to 35.7.0

117

es/helper-methods.js

@@ -28,12 +28,3 @@ import _assign from "lodash/assign";

categories = calculatedProps.categories,
horizontal = calculatedProps.horizontal,
orientations = calculatedProps.orientations;
var childProps = Axis.modifyProps(_defaults({
horizontal: horizontal,
theme: props.theme
}, child.props));
var axis = child.type.getAxis(childProps);
var crossAxis = childProps.crossAxis === false ? false : true;
var orientation = childProps.orientation || orientations[axis];
var axisOffset = horizontal ? getHorizontalAxisOffset(props, calculatedProps, orientation) : getAxisOffset(props, calculatedProps, orientation);
horizontal = calculatedProps.horizontal;
return {

@@ -47,7 +38,3 @@ stringMap: stringMap,

domain: domain,
scale: scale,
offsetY: childProps.offsetY !== undefined ? childProps.offsetY : axisOffset.y,
offsetX: childProps.offsetX !== undefined ? childProps.offsetX : axisOffset.x,
crossAxis: crossAxis,
orientation: orientation
scale: scale
};

@@ -112,27 +99,2 @@ }

function getOrientation(axis, originSign, horizontal) {
var sign = originSign || "positive";
var orientations = {
positive: {
x: "bottom",
y: "left"
},
negative: {
x: "top",
y: "right"
}
};
var horizontalOrientations = {
positive: {
x: "left",
y: "bottom"
},
negative: {
x: "right",
y: "top"
}
};
return horizontal ? horizontalOrientations[sign][axis] : orientations[sign][axis];
}
function getCalculatedProps(props, childComponents) {

@@ -168,10 +130,2 @@ var style = getStyles(props);

var origin = polar ? Helpers.getPolarOrigin(props) : Axis.getOrigin(domain);
var originSign = {
x: Axis.getOriginSign(origin.x, domain.x),
y: Axis.getOriginSign(origin.y, domain.y)
};
var orientations = {
x: getOrientation("x", originSign.y, horizontal),
y: getOrientation("y", originSign.x, horizontal)
};
var padding = Helpers.getPadding(props);

@@ -187,4 +141,3 @@ return {

origin: origin,
padding: padding,
orientations: orientations
padding: padding
};

@@ -260,66 +213,2 @@ }

var getAxisOffset = function (props, calculatedProps, orientation) {
var scale = calculatedProps.scale,
origin = calculatedProps.origin,
domain = calculatedProps.domain,
padding = calculatedProps.padding;
var top = padding.top,
bottom = padding.bottom,
left = padding.left,
right = padding.right;
var orientations = {
x: orientation === "bottom" || orientation === "top" ? orientation : calculatedProps.orientations.x,
y: orientation === "left" || orientation === "right" ? orientation : calculatedProps.orientations.y
}; // make the axes line up, and cross when appropriate
var orientationOffset = {
y: orientations.x === "bottom" ? bottom : top,
x: orientations.y === "left" ? left : right
};
var originOffset = {
x: orientations.y === "left" ? 0 : props.width,
y: orientations.x === "bottom" ? props.height : 0
};
var originPosition = {
x: origin.x === domain.x[0] || origin.x === domain.x[1] ? 0 : scale.x(origin.x),
y: origin.y === domain.y[0] || origin.y === domain.y[1] ? 0 : scale.y(origin.y)
};
return {
x: originPosition.x ? Math.abs(originOffset.x - originPosition.x) : orientationOffset.x,
y: originPosition.y ? Math.abs(originOffset.y - originPosition.y) : orientationOffset.y
};
};
var getHorizontalAxisOffset = function (props, calculatedProps, orientation) {
var scale = calculatedProps.scale,
origin = calculatedProps.origin,
domain = calculatedProps.domain,
padding = calculatedProps.padding;
var top = padding.top,
bottom = padding.bottom,
left = padding.left,
right = padding.right;
var orientations = {
y: orientation === "bottom" || orientation === "top" ? orientation : calculatedProps.orientations.x,
x: orientation === "left" || orientation === "right" ? orientation : calculatedProps.orientations.y
}; // make the axes line up, and cross when appropriate
var orientationOffset = {
x: orientations.y === "bottom" ? bottom : top,
y: orientations.x === "left" ? left : right
};
var originOffset = {
y: orientations.x === "left" ? 0 : props.width,
x: orientations.y === "bottom" ? props.height : 0
};
var originPosition = {
x: origin.x === domain.x[0] || origin.x === domain.x[1] ? 0 : scale.x(origin.x),
y: origin.y === domain.y[0] || origin.y === domain.y[1] ? 0 : scale.y(origin.y)
};
return {
y: originPosition.x ? Math.abs(originOffset.x - originPosition.x) : orientationOffset.x,
x: originPosition.y ? Math.abs(originOffset.y - originPosition.y) : orientationOffset.y
};
};
var createStringMap = function (props, childComponents, allStrings) {

@@ -326,0 +215,0 @@ var x = !allStrings.x || allStrings.x.length === 0 ? null : allStrings.x.reduce(function (memo, string, index) {

@@ -40,14 +40,3 @@ "use strict";

categories = calculatedProps.categories,
horizontal = calculatedProps.horizontal,
orientations = calculatedProps.orientations;
var childProps = _victoryCore.Axis.modifyProps((0, _defaults2.default)({
horizontal: horizontal,
theme: props.theme
}, child.props));
var axis = child.type.getAxis(childProps);
var crossAxis = childProps.crossAxis === false ? false : true;
var orientation = childProps.orientation || orientations[axis];
var axisOffset = horizontal ? getHorizontalAxisOffset(props, calculatedProps, orientation) : getAxisOffset(props, calculatedProps, orientation);
horizontal = calculatedProps.horizontal;
return {

@@ -61,7 +50,3 @@ stringMap: stringMap,

domain: domain,
scale: scale,
offsetY: childProps.offsetY !== undefined ? childProps.offsetY : axisOffset.y,
offsetX: childProps.offsetX !== undefined ? childProps.offsetX : axisOffset.x,
crossAxis: crossAxis,
orientation: orientation
scale: scale
};

@@ -126,27 +111,2 @@ }

function getOrientation(axis, originSign, horizontal) {
var sign = originSign || "positive";
var orientations = {
positive: {
x: "bottom",
y: "left"
},
negative: {
x: "top",
y: "right"
}
};
var horizontalOrientations = {
positive: {
x: "left",
y: "bottom"
},
negative: {
x: "right",
y: "top"
}
};
return horizontal ? horizontalOrientations[sign][axis] : orientations[sign][axis];
}
function getCalculatedProps(props, childComponents) {

@@ -185,10 +145,2 @@ var style = getStyles(props);

var origin = polar ? _victoryCore.Helpers.getPolarOrigin(props) : _victoryCore.Axis.getOrigin(domain);
var originSign = {
x: _victoryCore.Axis.getOriginSign(origin.x, domain.x),
y: _victoryCore.Axis.getOriginSign(origin.y, domain.y)
};
var orientations = {
x: getOrientation("x", originSign.y, horizontal),
y: getOrientation("y", originSign.x, horizontal)
};

@@ -206,4 +158,3 @@ var padding = _victoryCore.Helpers.getPadding(props);

origin: origin,
padding: padding,
orientations: orientations
padding: padding
};

@@ -282,66 +233,2 @@ }

var getAxisOffset = function (props, calculatedProps, orientation) {
var scale = calculatedProps.scale,
origin = calculatedProps.origin,
domain = calculatedProps.domain,
padding = calculatedProps.padding;
var top = padding.top,
bottom = padding.bottom,
left = padding.left,
right = padding.right;
var orientations = {
x: orientation === "bottom" || orientation === "top" ? orientation : calculatedProps.orientations.x,
y: orientation === "left" || orientation === "right" ? orientation : calculatedProps.orientations.y
}; // make the axes line up, and cross when appropriate
var orientationOffset = {
y: orientations.x === "bottom" ? bottom : top,
x: orientations.y === "left" ? left : right
};
var originOffset = {
x: orientations.y === "left" ? 0 : props.width,
y: orientations.x === "bottom" ? props.height : 0
};
var originPosition = {
x: origin.x === domain.x[0] || origin.x === domain.x[1] ? 0 : scale.x(origin.x),
y: origin.y === domain.y[0] || origin.y === domain.y[1] ? 0 : scale.y(origin.y)
};
return {
x: originPosition.x ? Math.abs(originOffset.x - originPosition.x) : orientationOffset.x,
y: originPosition.y ? Math.abs(originOffset.y - originPosition.y) : orientationOffset.y
};
};
var getHorizontalAxisOffset = function (props, calculatedProps, orientation) {
var scale = calculatedProps.scale,
origin = calculatedProps.origin,
domain = calculatedProps.domain,
padding = calculatedProps.padding;
var top = padding.top,
bottom = padding.bottom,
left = padding.left,
right = padding.right;
var orientations = {
y: orientation === "bottom" || orientation === "top" ? orientation : calculatedProps.orientations.x,
x: orientation === "left" || orientation === "right" ? orientation : calculatedProps.orientations.y
}; // make the axes line up, and cross when appropriate
var orientationOffset = {
x: orientations.y === "bottom" ? bottom : top,
y: orientations.x === "left" ? left : right
};
var originOffset = {
y: orientations.x === "left" ? 0 : props.width,
x: orientations.y === "bottom" ? props.height : 0
};
var originPosition = {
x: origin.x === domain.x[0] || origin.x === domain.x[1] ? 0 : scale.x(origin.x),
y: origin.y === domain.y[0] || origin.y === domain.y[1] ? 0 : scale.y(origin.y)
};
return {
y: originPosition.x ? Math.abs(originOffset.x - originPosition.x) : orientationOffset.x,
x: originPosition.y ? Math.abs(originOffset.y - originPosition.y) : orientationOffset.y
};
};
var createStringMap = function (props, childComponents, allStrings) {

@@ -348,0 +235,0 @@ var x = !allStrings.x || allStrings.x.length === 0 ? null : allStrings.x.reduce(function (memo, string, index) {

4

package.json
{
"name": "victory-chart",
"version": "35.6.4",
"version": "35.7.0",
"description": "Chart Component for Victory",

@@ -25,3 +25,3 @@ "keywords": [

"react-fast-compare": "^2.0.0",
"victory-axis": "^35.6.4",
"victory-axis": "^35.7.0",
"victory-core": "^35.6.4",

@@ -28,0 +28,0 @@ "victory-polar-axis": "^35.6.4",

@@ -15,10 +15,3 @@ /* eslint-disable func-style */

function getAxisProps(child, props, calculatedProps) {
const { domain, scale, stringMap, categories, horizontal, orientations } = calculatedProps;
const childProps = Axis.modifyProps(defaults({ horizontal, theme: props.theme }, child.props));
const axis = child.type.getAxis(childProps);
const crossAxis = childProps.crossAxis === false ? false : true;
const orientation = childProps.orientation || orientations[axis];
const axisOffset = horizontal
? getHorizontalAxisOffset(props, calculatedProps, orientation)
: getAxisOffset(props, calculatedProps, orientation);
const { domain, scale, stringMap, categories, horizontal } = calculatedProps;
return {

@@ -32,7 +25,3 @@ stringMap,

domain,
scale,
offsetY: childProps.offsetY !== undefined ? childProps.offsetY : axisOffset.y,
offsetX: childProps.offsetX !== undefined ? childProps.offsetX : axisOffset.x,
crossAxis,
orientation
scale
};

@@ -98,15 +87,2 @@ }

function getOrientation(axis, originSign, horizontal) {
const sign = originSign || "positive";
const orientations = {
positive: { x: "bottom", y: "left" },
negative: { x: "top", y: "right" }
};
const horizontalOrientations = {
positive: { x: "left", y: "bottom" },
negative: { x: "right", y: "top" }
};
return horizontal ? horizontalOrientations[sign][axis] : orientations[sign][axis];
}
function getCalculatedProps(props, childComponents) {

@@ -139,12 +115,2 @@ const style = getStyles(props);

const originSign = {
x: Axis.getOriginSign(origin.x, domain.x),
y: Axis.getOriginSign(origin.y, domain.y)
};
const orientations = {
x: getOrientation("x", originSign.y, horizontal),
y: getOrientation("y", originSign.x, horizontal)
};
const padding = Helpers.getPadding(props);

@@ -161,4 +127,3 @@

origin,
padding,
orientations
padding
};

@@ -232,70 +197,2 @@ }

const getAxisOffset = (props, calculatedProps, orientation) => {
const { scale, origin, domain, padding } = calculatedProps;
const { top, bottom, left, right } = padding;
const orientations = {
x:
orientation === "bottom" || orientation === "top"
? orientation
: calculatedProps.orientations.x,
y:
orientation === "left" || orientation === "right"
? orientation
: calculatedProps.orientations.y
};
// make the axes line up, and cross when appropriate
const orientationOffset = {
y: orientations.x === "bottom" ? bottom : top,
x: orientations.y === "left" ? left : right
};
const originOffset = {
x: orientations.y === "left" ? 0 : props.width,
y: orientations.x === "bottom" ? props.height : 0
};
const originPosition = {
x: origin.x === domain.x[0] || origin.x === domain.x[1] ? 0 : scale.x(origin.x),
y: origin.y === domain.y[0] || origin.y === domain.y[1] ? 0 : scale.y(origin.y)
};
return {
x: originPosition.x ? Math.abs(originOffset.x - originPosition.x) : orientationOffset.x,
y: originPosition.y ? Math.abs(originOffset.y - originPosition.y) : orientationOffset.y
};
};
const getHorizontalAxisOffset = (props, calculatedProps, orientation) => {
const { scale, origin, domain, padding } = calculatedProps;
const { top, bottom, left, right } = padding;
const orientations = {
y:
orientation === "bottom" || orientation === "top"
? orientation
: calculatedProps.orientations.x,
x:
orientation === "left" || orientation === "right"
? orientation
: calculatedProps.orientations.y
};
// make the axes line up, and cross when appropriate
const orientationOffset = {
x: orientations.y === "bottom" ? bottom : top,
y: orientations.x === "left" ? left : right
};
const originOffset = {
y: orientations.x === "left" ? 0 : props.width,
x: orientations.y === "bottom" ? props.height : 0
};
const originPosition = {
x: origin.x === domain.x[0] || origin.x === domain.x[1] ? 0 : scale.x(origin.x),
y: origin.y === domain.y[0] || origin.y === domain.y[1] ? 0 : scale.y(origin.y)
};
return {
y: originPosition.x ? Math.abs(originOffset.x - originPosition.x) : orientationOffset.x,
x: originPosition.y ? Math.abs(originOffset.y - originPosition.y) : orientationOffset.y
};
};
const createStringMap = (props, childComponents, allStrings) => {

@@ -302,0 +199,0 @@ const x =

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc