mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-17 09:41:24 +01:00
v 0.8.05b
This commit is contained in:
parent
9aa369b6df
commit
6cb21bbead
6 changed files with 66 additions and 44 deletions
|
|
@ -337,9 +337,6 @@ function togglePopulation() {
|
|||
function drawPopulation() {
|
||||
population.selectAll("line").remove();
|
||||
const cells = pack.cells, p = cells.p, burgs = pack.burgs;
|
||||
|
||||
// pack.cells.pop.reduce((s=0,v) => s+v)
|
||||
// pack.burgs.map(b => b.population).reduce((s=0,v) => s+v)
|
||||
const show = d3.transition().duration(2000).ease(d3.easeSinIn);
|
||||
|
||||
const rural = Array.from(cells.i.filter(i => cells.pop[i] > 0), i => [p[i][0], p[i][1], p[i][1] - cells.pop[i] / 8]);
|
||||
|
|
@ -348,7 +345,7 @@ function drawPopulation() {
|
|||
.attr("x2", d => d[0]).attr("y2", d => d[1])
|
||||
.transition(show).attr("y2", d => d[2]);
|
||||
|
||||
const urban = burgs.filter(b => b.i).map(b => [b.x, b.y, b.y - b.population / 8 * urbanization.value]);
|
||||
const urban = burgs.filter(b => b.i && !b.removed).map(b => [b.x, b.y, b.y - b.population / 8 * urbanization.value]);
|
||||
population.select("#urban").selectAll("line").data(urban).enter().append("line")
|
||||
.attr("x1", d => d[0]).attr("y1", d => d[1])
|
||||
.attr("x2", d => d[0]).attr("y2", d => d[1])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue