const city = this.g
.selectAll("
g.city")
.data(topojson.feature(cities, cities.objects.cities).features)
.enter()
.append("g")
.attr("class", "city")
.style("display", "none")
.attr("transform", (d) => {
if (d.geometry) {
const lon = Number(d.geometry.coordinates[0]);
const lat = Number(d.geometry.coordinates[1]);
return "translate(" + this.projection([lon, lat]) + ")";
}
});
city
.append("circle")
.attr("class", "city-point")
.attr("r", 0.2)
.style("fill", "orange")
.style("display", "none");
city
.append("text")
.attr("class", "city-name")
.attr("x", 0.4)
.attr("y", 0.15)
.attr("fill", "#fff")
.attr("font-size", "0.5px")
.style("display", "none")
.text((d) => {
return
d.properties.name;
});
я сразу их добавляю с display:none