|
|
|
@ -8058,13 +8058,10 @@ nv.models.scatter = function() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (clipVoronoi) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var pointClipsEnter = wrap.select('defs').selectAll('.nv-point-clips')
|
|
|
|
|
.data([id])
|
|
|
|
|
.enter();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
pointClipsEnter.append('clipPath')
|
|
|
|
|
.attr('class', 'nv-point-clips')
|
|
|
|
|
.attr('id', 'nv-points-clip-' + id);
|
|
|
|
@ -8087,8 +8084,10 @@ nv.models.scatter = function() {
|
|
|
|
|
if (useVoronoi === true) {
|
|
|
|
|
if(vertices.length < 3) {
|
|
|
|
|
// 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]);
|
|
|
|
|
vertices.push([x.range()[0] - 2000, y.range()[0] - 2000, null, null]);
|
|
|
|
|
vertices.push([x.range()[1] + 2000, y.range()[1] + 2000, null, null]);
|
|
|
|
|
vertices.push([x.range()[0] - 2000, y.range()[0] + 2000, null, null]);
|
|
|
|
|
vertices.push([x.range()[1] + 2000, y.range()[1] - 2000, null, null]);
|
|
|
|
|
}
|
|
|
|
|
var voronoi = d3.geom.voronoi(vertices).map(function(d, i) {
|
|
|
|
|
return {
|
|
|
|
@ -8105,7 +8104,7 @@ nv.models.scatter = function() {
|
|
|
|
|
.attr('class', function(d,i) { return 'nv-path-'+i; });
|
|
|
|
|
pointPaths.exit().remove();
|
|
|
|
|
pointPaths
|
|
|
|
|
.attr('d', function(d) { return 'M' + d.data.join(',') + 'Z'; });
|
|
|
|
|
.attr('d', function(d) { return 'M' + d.data.join('L') + 'Z'; });
|
|
|
|
|
|
|
|
|
|
eventElements = pointPaths;
|
|
|
|
|
|
|
|
|
|