diff --git a/modules/svg/areas.js b/modules/svg/areas.js index 8826ddcad..01a12de7f 100644 --- a/modules/svg/areas.js +++ b/modules/svg/areas.js @@ -58,9 +58,10 @@ export function svgAreas(projection, context) { // Targets allow hover and vertex snapping + var targetData = data.targets.filter(getPath); var targets = selection.selectAll('.area.target-allowed') .filter(function(d) { return filter(d.properties.entity); }) - .data(data.targets, function key(d) { return d.id; }); + .data(targetData, function key(d) { return d.id; }); // exit targets.exit() @@ -75,9 +76,10 @@ export function svgAreas(projection, context) { // NOPE + var nopeData = data.nopes.filter(getPath); var nopes = selection.selectAll('.area.target-nope') .filter(function(d) { return filter(d.properties.entity); }) - .data(data.nopes, function key(d) { return d.id; }); + .data(nopeData, function key(d) { return d.id; }); // exit nopes.exit() @@ -92,7 +94,6 @@ export function svgAreas(projection, context) { } - function drawAreas(selection, graph, entities, filter) { var path = svgPath(projection, graph, true), areas = {}, diff --git a/modules/svg/lines.js b/modules/svg/lines.js index 24eb23870..67c2cce9a 100644 --- a/modules/svg/lines.js +++ b/modules/svg/lines.js @@ -54,9 +54,10 @@ export function svgLines(projection, context) { // Targets allow hover and vertex snapping + var targetData = data.targets.filter(getPath); var targets = selection.selectAll('.line.target-allowed') .filter(function(d) { return filter(d.properties.entity); }) - .data(data.targets, function key(d) { return d.id; }); + .data(targetData, function key(d) { return d.id; }); // exit targets.exit() @@ -71,9 +72,10 @@ export function svgLines(projection, context) { // NOPE + var nopeData = data.nopes.filter(getPath); var nopes = selection.selectAll('.line.target-nope') .filter(function(d) { return filter(d.properties.entity); }) - .data(data.nopes, function key(d) { return d.id; }); + .data(nopeData, function key(d) { return d.id; }); // exit nopes.exit()