Socket
Socket
Sign inDemoInstall

victory-voronoi-container

Package Overview
Dependencies
Maintainers
2
Versions
150
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

victory-voronoi-container - npm Package Compare versions

Comparing version 31.2.0 to 32.0.0

34

es/victory-voronoi-container.js

@@ -51,2 +51,14 @@ import _pick from "lodash/pick";

_createClass(VictoryVoronoiContainer, [{
key: "getDimension",
value: function getDimension(props) {
var horizontal = props.horizontal,
voronoiDimension = props.voronoiDimension;
if (!horizontal || !voronoiDimension) {
return voronoiDimension;
}
return voronoiDimension === "x" ? "y" : "x";
}
}, {
key: "getLabelPadding",

@@ -116,17 +128,5 @@ value: function getLabelPadding(style) {

key: "getPoint",
value: function getPoint(props, point) {
value: function getPoint(point) {
var whitelist = ["_x", "_x1", "_x0", "_y", "_y1", "_y0"];
if (!props.horizontal) {
return _pick(point, whitelist);
}
return {
_x: point._y,
_y: point._x,
_x1: point._y1,
_y1: point._x1,
_x0: point._y0,
_y0: point._x0
};
return _pick(point, whitelist);
}

@@ -137,6 +137,6 @@ }, {

var mousePosition = props.mousePosition,
voronoiDimension = props.voronoiDimension,
scale = props.scale,
voronoiPadding = props.voronoiPadding;
var point = this.getPoint(props, points[0]);
var voronoiDimension = this.getDimension(props);
var point = this.getPoint(points[0]);
var basePosition = Helpers.scalePoint(props, point);

@@ -207,3 +207,3 @@

horizontal = props.horizontal;
var point = this.getPoint(props, points[0]);
var point = this.getPoint(points[0]);
var multiPoint = voronoiDimension && points.length > 1;

@@ -210,0 +210,0 @@ var y = point._y1 !== undefined ? point._y1 : point._y;

@@ -54,4 +54,4 @@ import _includes from "lodash/includes";

var voronoiX = props.horizontal ? (+y + +y0) / 2 : (+x + +x0) / 2;
var voronoiY = props.horizontal ? (+x + +x0) / 2 : (+y + +y0) / 2;
var voronoiX = (+x + +x0) / 2;
var voronoiY = (+y + +y0) / 2;
return _assign({

@@ -58,0 +58,0 @@ _voronoiX: props.voronoiDimension === "y" ? 0 : voronoiX,

@@ -67,2 +67,14 @@ "use strict";

_createClass(VictoryVoronoiContainer, [{
key: "getDimension",
value: function getDimension(props) {
var horizontal = props.horizontal,
voronoiDimension = props.voronoiDimension;
if (!horizontal || !voronoiDimension) {
return voronoiDimension;
}
return voronoiDimension === "x" ? "y" : "x";
}
}, {
key: "getLabelPadding",

@@ -134,17 +146,5 @@ value: function getLabelPadding(style) {

key: "getPoint",
value: function getPoint(props, point) {
value: function getPoint(point) {
var whitelist = ["_x", "_x1", "_x0", "_y", "_y1", "_y0"];
if (!props.horizontal) {
return (0, _pick2.default)(point, whitelist);
}
return {
_x: point._y,
_y: point._x,
_x1: point._y1,
_y1: point._x1,
_x0: point._y0,
_y0: point._x0
};
return (0, _pick2.default)(point, whitelist);
}

@@ -155,6 +155,6 @@ }, {

var mousePosition = props.mousePosition,
voronoiDimension = props.voronoiDimension,
scale = props.scale,
voronoiPadding = props.voronoiPadding;
var point = this.getPoint(props, points[0]);
var voronoiDimension = this.getDimension(props);
var point = this.getPoint(points[0]);

@@ -228,3 +228,3 @@ var basePosition = _victoryCore.Helpers.scalePoint(props, point);

horizontal = props.horizontal;
var point = this.getPoint(props, points[0]);
var point = this.getPoint(points[0]);
var multiPoint = voronoiDimension && points.length > 1;

@@ -231,0 +231,0 @@ var y = point._y1 !== undefined ? point._y1 : point._y;

@@ -73,4 +73,4 @@ "use strict";

var voronoiX = props.horizontal ? (+y + +y0) / 2 : (+x + +x0) / 2;
var voronoiY = props.horizontal ? (+x + +x0) / 2 : (+y + +y0) / 2;
var voronoiX = (+x + +x0) / 2;
var voronoiY = (+y + +y0) / 2;
return (0, _assign2.default)({

@@ -77,0 +77,0 @@ _voronoiX: props.voronoiDimension === "y" ? 0 : voronoiX,

{
"name": "victory-voronoi-container",
"version": "31.2.0",
"version": "32.0.0",
"description": "Interactive Voronoi Mouseover Component for Victory",

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

"prop-types": "^15.5.8",
"victory-core": "^31.2.0",
"victory-tooltip": "^31.2.0"
"victory-core": "^32.0.0",
"victory-tooltip": "^32.0.0"
},

@@ -29,0 +29,0 @@ "scripts": {

@@ -65,2 +65,10 @@ import PropTypes from "prop-types";

getDimension(props) {
const { horizontal, voronoiDimension } = props;
if (!horizontal || !voronoiDimension) {
return voronoiDimension;
}
return voronoiDimension === "x" ? "y" : "x";
}
getLabelPadding(style) {

@@ -115,20 +123,11 @@ if (!style) {

getPoint(props, point) {
getPoint(point) {
const whitelist = ["_x", "_x1", "_x0", "_y", "_y1", "_y0"];
if (!props.horizontal) {
return pick(point, whitelist);
}
return {
_x: point._y,
_y: point._x,
_x1: point._y1,
_y1: point._x1,
_x0: point._y0,
_y0: point._x0
};
return pick(point, whitelist);
}
getLabelPosition(props, points, labelProps) {
const { mousePosition, voronoiDimension, scale, voronoiPadding } = props;
const point = this.getPoint(props, points[0]);
const { mousePosition, scale, voronoiPadding } = props;
const voronoiDimension = this.getDimension(props);
const point = this.getPoint(points[0]);
const basePosition = Helpers.scalePoint(props, point);

@@ -193,3 +192,3 @@ if (!voronoiDimension || points.length < 2) {

const { voronoiDimension, horizontal } = props;
const point = this.getPoint(props, points[0]);
const point = this.getPoint(points[0]);
const multiPoint = voronoiDimension && points.length > 1;

@@ -196,0 +195,0 @@ const y = point._y1 !== undefined ? point._y1 : point._y;

@@ -28,4 +28,4 @@ import { Selection, Data, Helpers } from "victory-core";

const { x, y, y0, x0 } = Helpers.getPoint(datum);
const voronoiX = props.horizontal ? (+y + +y0) / 2 : (+x + +x0) / 2;
const voronoiY = props.horizontal ? (+x + +x0) / 2 : (+y + +y0) / 2;
const voronoiX = (+x + +x0) / 2;
const voronoiY = (+y + +y0) / 2;
return assign(

@@ -32,0 +32,0 @@ {

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