don't show bubble chart if no data

This commit is contained in:
Azgaar 2021-10-17 12:21:42 +03:00
parent d06dba2d81
commit e13796bd72
2 changed files with 85 additions and 18 deletions

View file

@ -295,6 +295,7 @@ function overviewBurgs() {
const name = s.fullName ? s.fullName : s.name;
return {id: s.i, state: s.i ? 0 : null, color, name};
});
const burgs = pack.burgs
.filter(b => b.i && !b.removed)
.map(b => {
@ -306,6 +307,7 @@ function overviewBurgs() {
return {id, i: b.i, state: b.state, culture: b.culture, province, parent, name: b.name, population, capital, x: b.x, y: b.y};
});
const data = states.concat(burgs);
if (data.length < 2) return tip("No burgs to show", false, "error");
const root = d3
.stratify()