@fishawack/lab-d3
Advanced tools
Comparing version 3.1.0 to 3.1.1
{ | ||
"name": "@fishawack/lab-d3", | ||
"version": "3.1.0", | ||
"version": "3.1.1", | ||
"description": "Abstract layer built on top of d3", | ||
@@ -5,0 +5,0 @@ "scripts": { |
@@ -316,9 +316,9 @@ "use strict"; | ||
var selection = local.geometry.selectAll(".feature").data(local.geoJson.features); | ||
var group = selection.enter().append('g').attr('class', function (d) { | ||
var enter = selection.enter().append('g').attr('class', function (d) { | ||
return 'feature feature-' + d.id; | ||
}).attr('tabindex', 1).on('click', local.clicked).on('keyup', local.clicked); | ||
group.append('path'); | ||
group.append('line'); | ||
group.append('circle').attr('r', att.anchorRadius); | ||
group.append('text').attr('dy', '0.5em').attr('class', function (d) { | ||
enter.append('path'); | ||
enter.append('line'); | ||
enter.append('circle').attr('r', att.anchorRadius); | ||
enter.append('text').attr('dy', '0.5em').attr('class', function (d) { | ||
if (d.properties.offset && d.properties.offset.anchor) { | ||
@@ -332,7 +332,7 @@ return 'anchor'; | ||
}); | ||
group = group.merge(selection); | ||
var text = group.select('text'); | ||
var path = group.select('path'); | ||
var line = group.select('line'); | ||
var circle = group.select('circle'); | ||
var update = enter.merge(selection); | ||
var text = update.select('text'); | ||
var path = update.select('path'); | ||
var line = update.select('line'); | ||
var circle = update.select('circle'); | ||
path.attr("d", local.path).transition().ease(d3['ease' + att.transitionType]).delay(att.delaySpeed).duration(att.transitionSpeed); | ||
@@ -409,3 +409,3 @@ var bounds = local.path.bounds(local.geoJson); | ||
}); | ||
var filter = group.filter(function (d) { | ||
var filter = update.filter(function (d) { | ||
return !(d.properties.offset && d.properties.offset.anchor); | ||
@@ -489,2 +489,9 @@ }); | ||
}); | ||
if (att.inject[0]) { | ||
att.inject[0].call(this, { | ||
enter: enter, | ||
update: update, | ||
selection: selection | ||
}); | ||
} | ||
@@ -500,9 +507,2 @@ // Coords | ||
remove.remove(); | ||
if (att.inject[0]) { | ||
att.inject[0].call(this, { | ||
enter: enter, | ||
update: update, | ||
selection: selection | ||
}); | ||
} | ||
if (att.inject.render) { | ||
@@ -509,0 +509,0 @@ att.inject.render.call(this); |
559302