mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-17 17:51:24 +01:00
feat: burg groups - support styling
This commit is contained in:
parent
4185611791
commit
c86f7de9de
6 changed files with 146 additions and 127 deletions
|
|
@ -10,6 +10,7 @@ function drawBurgLabels() {
|
|||
|
||||
const labelGroup = burgLabels.select("#" + name);
|
||||
if (labelGroup.empty()) continue;
|
||||
const dy = labelGroup.attr("data-dy");
|
||||
|
||||
labelGroup
|
||||
.selectAll("text")
|
||||
|
|
@ -20,7 +21,7 @@ function drawBurgLabels() {
|
|||
.attr("data-id", d => d.i)
|
||||
.attr("x", d => d.x)
|
||||
.attr("y", d => d.y)
|
||||
.attr("dy", "-0.4em")
|
||||
.attr("dy", dy + "em")
|
||||
.text(d => d.name);
|
||||
}
|
||||
|
||||
|
|
@ -28,14 +29,16 @@ function drawBurgLabels() {
|
|||
}
|
||||
|
||||
function drawBurgLabel(burg) {
|
||||
burgLabels
|
||||
.select("#" + burg.group)
|
||||
const group = burgLabels.select("#" + burg.group);
|
||||
const dy = labelGroup.attr("data-dy");
|
||||
|
||||
group
|
||||
.append("text")
|
||||
.attr("id", "burgLabel" + burg.i)
|
||||
.attr("data-id", burg.i)
|
||||
.attr("x", burg.x)
|
||||
.attr("y", burg.y)
|
||||
.attr("dy", "-0.4em")
|
||||
.attr("dy", dy + "em")
|
||||
.text(burg.name);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue