fix: if group is missing, recreate all labels or icons

This commit is contained in:
Azgaar 2026-01-09 22:50:58 +01:00
parent 753db70283
commit fa8fd58259
6 changed files with 44 additions and 48 deletions

View file

@ -33,13 +33,16 @@ function drawBurgLabels() {
}
function drawBurgLabel(burg) {
removeBurgLabel(burg.i);
const labelGroup = burgLabels.select("#" + burg.group);
if (labelGroup.empty()) return;
if (labelGroup.empty()) {
drawBurgLabels();
return; // redraw all labels if group is missing
}
const dx = labelGroup.attr("data-dx") || 0;
const dy = labelGroup.attr("data-dy") || 0;
removeBurgLabel(burg.i);
labelGroup
.append("text")
.attr("text-rendering", "optimizeSpeed")