Skip to content

Commit

Permalink
coerce values to numbers when calculating voronoi positions
Browse files Browse the repository at this point in the history
  • Loading branch information
boygirl committed Aug 4, 2018
1 parent bccb7c1 commit e0f8740
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/victory-voronoi-container/src/voronoi-helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ const VoronoiHelpers = {
const style = child ? child.props && child.props.style : props.style;
return data.map((datum, index) => {
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 = props.horizontal ? (+y + +y0) / 2 : (+x + +x0) / 2;
const voronoiY = props.horizontal ? (+x + +x0) / 2 : (+y + +y0) / 2;
return assign({
_voronoiX: props.voronoiDimension === "y" ? 0 : voronoiX,
_voronoiY: props.voronoiDimension === "x" ? 0 : voronoiY,
Expand Down

0 comments on commit e0f8740

Please sign in to comment.