sky-burgs-sky-routes

This commit is contained in:
barrulus 2025-09-05 21:07:42 +01:00
parent 2c3692f000
commit 73ab86b957
23 changed files with 919 additions and 49 deletions

View file

@ -5,8 +5,8 @@ function drawBurgIcons() {
icons.selectAll("circle, use").remove(); // cleanup
// capitals
const capitals = pack.burgs.filter(b => b.capital && !b.removed);
// capitals (exclude sky burgs)
const capitals = pack.burgs.filter(b => b.capital && !b.removed && !(b.flying || b.skyPort));
const capitalIcons = burgIcons.select("#cities");
const capitalSize = capitalIcons.attr("size") || 1;
const capitalAnchors = anchors.selectAll("#cities");
@ -35,8 +35,8 @@ function drawBurgIcons() {
.attr("width", capitalAnchorsSize)
.attr("height", capitalAnchorsSize);
// towns
const towns = pack.burgs.filter(b => b.i && !b.capital && !b.removed);
// towns (exclude sky burgs)
const towns = pack.burgs.filter(b => b.i && !b.capital && !b.removed && !(b.flying || b.skyPort));
const townIcons = burgIcons.select("#towns");
const townSize = townIcons.attr("size") || 0.5;
const townsAnchors = anchors.selectAll("#towns");
@ -66,4 +66,20 @@ function drawBurgIcons() {
.attr("height", townsAnchorsSize);
TIME && console.timeEnd("drawBurgIcons");
// Sky burgs (flying or sky port) — styled separately
const sky = pack.burgs.filter(b => b.i && !b.removed && (b.flying || b.skyPort));
const skyIcons = burgIcons.select("#skyburgs");
const skySize = skyIcons.attr("size") || 0.6;
skyIcons
.selectAll("circle")
.data(sky)
.enter()
.append("circle")
.attr("id", d => "burg" + d.i)
.attr("data-id", d => d.i)
.attr("cx", d => d.x)
.attr("cy", d => d.y)
.attr("r", skySize);
}