mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-18 18:11:24 +01:00
refactor: drawPrec
This commit is contained in:
parent
dffe7f4774
commit
b3dc8da683
1 changed files with 3 additions and 5 deletions
|
|
@ -261,7 +261,6 @@ 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);
|
||||
|
||||
|
|
@ -270,6 +269,7 @@ function drawPrec() {
|
|||
const getRadius = prec => rn(Math.sqrt(prec / 4) / cellsNumberModifier, 2);
|
||||
|
||||
prec
|
||||
.style("display", "block")
|
||||
.selectAll("circle")
|
||||
.data(data)
|
||||
.enter()
|
||||
|
|
@ -287,11 +287,9 @@ function togglePopulation(event) {
|
|||
drawPopulation();
|
||||
if (event && isCtrlClick(event)) editStyle("population");
|
||||
} else {
|
||||
if (event && isCtrlClick(event)) {
|
||||
editStyle("population");
|
||||
return;
|
||||
}
|
||||
if (event && isCtrlClick(event)) return editStyle("population");
|
||||
turnButtonOff("togglePopulation");
|
||||
|
||||
const isD3data = population.select("line").datum();
|
||||
if (!isD3data) {
|
||||
// just remove
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue