mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-17 01:41:22 +01:00
v 0.8.04b
This commit is contained in:
parent
0ada9d4c7d
commit
9aa369b6df
4 changed files with 15 additions and 11 deletions
|
|
@ -433,10 +433,10 @@
|
|||
void function drawLabels() {
|
||||
const g = labels.select("#states"), p = defs.select("#textPaths");
|
||||
g.selectAll("text").remove();
|
||||
p.selectAll("path").remove();
|
||||
p.selectAll("path[id*='stateLabel']").remove();
|
||||
|
||||
const data = paths.map(p => [round(lineGen(p[1])), "stateLabel"+p[0], states[p[0]].name, p[1]]);
|
||||
p.selectAll("path").data(data).enter().append("path").attr("d", d => d[0]).attr("id", d => "textPath_"+d[1]);
|
||||
p.selectAll(".path").data(data).enter().append("path").attr("d", d => d[0]).attr("id", d => "textPath_"+d[1]);
|
||||
|
||||
g.selectAll("text").data(data).enter()
|
||||
.append("text").attr("id", d => d[1])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue