mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-17 01:41:22 +01:00
scale previpitation layer circles
This commit is contained in:
parent
604dcfacf6
commit
05217d176d
2 changed files with 4 additions and 6 deletions
|
|
@ -471,16 +471,14 @@ function togglePrec(event) {
|
|||
function drawPrec() {
|
||||
prec.selectAll("circle").remove();
|
||||
const {cells, points} = grid;
|
||||
|
||||
prec.style("display", "block");
|
||||
const show = d3.transition().duration(800).ease(d3.easeSinIn);
|
||||
prec.selectAll("text").attr("opacity", 0).transition(show).attr("opacity", 1);
|
||||
|
||||
const cellsNumberModifier = pointsInput.dataset.cells / 10000;
|
||||
const cellsNumberModifier = (pointsInput.dataset.cells / 10000) ** 0.25;
|
||||
const data = cells.i.filter(i => cells.h[i] >= 20 && cells.prec[i]);
|
||||
const getRadius = prec => {
|
||||
const base = prec / cellsNumberModifier / 2;
|
||||
return rn(Math.sqrt(base), 2);
|
||||
};
|
||||
const getRadius = prec => rn(Math.sqrt(prec / 4) / cellsNumberModifier, 2);
|
||||
|
||||
prec
|
||||
.selectAll("circle")
|
||||
|
|
|
|||
|
|
@ -831,7 +831,7 @@ function applyDefaultStyle() {
|
|||
landmass.attr("opacity", 1).attr("fill", "#eef6fb").attr("filter", null);
|
||||
markers.attr("opacity", null).attr("rescale", 1).attr("filter", "url(#dropShadow01)");
|
||||
|
||||
prec.attr("opacity", null).attr("stroke", "#000000").attr("stroke-width", 0.1).attr("fill", "#003dff").attr("filter", null);
|
||||
prec.attr("opacity", null).attr("stroke", "#000000").attr("stroke-width", 0).attr("fill", "#003dff").attr("filter", null);
|
||||
population.attr("opacity", null).attr("stroke-width", 1.6).attr("stroke-dasharray", null).attr("stroke-linecap", "butt").attr("filter", null);
|
||||
population.select("#rural").attr("stroke", "#0000ff");
|
||||
population.select("#urban").attr("stroke", "#ff0000");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue