diff --git a/demo/js/components/victory-voronoi-container-demo.js b/demo/js/components/victory-voronoi-container-demo.js index a60cea13a..e1a9a67f9 100644 --- a/demo/js/components/victory-voronoi-container-demo.js +++ b/demo/js/components/victory-voronoi-container-demo.js @@ -13,6 +13,26 @@ import { Flyout, VictoryTooltip } from "Packages/victory-tooltip/src/index"; import { VictoryLegend } from "Packages/victory-legend/src/index"; import { VictoryLabel, VictoryTheme } from "Packages/victory-core/src/index"; +const series1 = [ + { x: 0, y: 2500 }, + { x: 2, y: 3300 }, + { x: 4, y: 4300 }, + { x: 6, y: 2400 }, + { x: 8, y: 3300 }, + { x: 10, y: 5400 }, + { x: 12, y: 8900 } +]; + +const series2 = [ + { x: 0, y: 200 }, + { x: 2, y: 3100 }, + { x: 4, y: 2500 }, + { x: 6, y: 870 }, + { x: 8, y: 2300 }, + { x: 10, y: 550 }, + { x: 12, y: 5200 } +]; + class App extends React.Component { constructor() { super(); @@ -82,6 +102,22 @@ class App extends React.Component { return (
+ `y: ${datum.y}`} + /> + } + > + + + { const continuous = child && child.type && child.type.continuous; @@ -32,10 +36,11 @@ const VoronoiHelpers = { const { x, y, y0, x0 } = Helpers.getPoint(datum); const voronoiX = (+x + +x0) / 2; const voronoiY = (+y + +y0) / 2; + return assign( { - _voronoiX: props.voronoiDimension === "y" ? 0 : voronoiX, - _voronoiY: props.voronoiDimension === "x" ? 0 : voronoiY, + _voronoiX: props.voronoiDimension === "y" ? minDomain.x : voronoiX, + _voronoiY: props.voronoiDimension === "x" ? minDomain.y : voronoiY, eventKey: index, childName: name, continuous,