Issue #283 voronoi based point interaction now works with less than 3 points

master-patched
Bob Monteverde 12 years ago
parent abf23e3727
commit 3e5d1e4807

@ -7979,6 +7979,9 @@ nv.models.scatter = function() {
//inject series and point index for reference into voronoi
if (useVoronoi === true) {
// Issue #283 - Adding 2 dummy points to the voronoi b/c voronoi requires min 3 points to work
vertices.push([x.range()[0] - 20, y.range()[0] - 20, null, null]);
vertices.push([x.range()[1] + 20, y.range()[1] + 20, null, null]);
var voronoi = d3.geom.voronoi(vertices).map(function(d, i) {
return {
'data': d,

10
nv.d3.min.js vendored

File diff suppressed because one or more lines are too long

@ -172,6 +172,9 @@ nv.models.scatter = function() {
//inject series and point index for reference into voronoi
if (useVoronoi === true) {
// Issue #283 - Adding 2 dummy points to the voronoi b/c voronoi requires min 3 points to work
vertices.push([x.range()[0] - 20, y.range()[0] - 20, null, null]);
vertices.push([x.range()[1] + 20, y.range()[1] + 20, null, null]);
var voronoi = d3.geom.voronoi(vertices).map(function(d, i) {
return {
'data': d,

Loading…
Cancel
Save