mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-17 17:51:24 +01:00
refactor: import d3
This commit is contained in:
parent
1847772d74
commit
98ae3292fc
83 changed files with 709 additions and 69 deletions
|
|
@ -1,3 +1,5 @@
|
|||
import * as d3 from "d3";
|
||||
|
||||
import {rn} from "utils/numberUtils";
|
||||
import {round} from "utils/stringUtils";
|
||||
import {byId} from "utils/shorthands";
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
import * as d3 from "d3";
|
||||
|
||||
import {getProvincesVertices} from "./drawProvinces";
|
||||
import {minmax, rn} from "utils/numberUtils";
|
||||
import {byId} from "utils/shorthands";
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
import * as d3 from "d3";
|
||||
|
||||
export function drawGrid() {
|
||||
gridOverlay.selectAll("*").remove();
|
||||
const pattern = "#pattern_" + (gridOverlay.attr("type") || "pointyHex");
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
import * as d3 from "d3";
|
||||
|
||||
import {getColorScheme, getHeightColor} from "utils/colorUtils";
|
||||
|
||||
export function drawHeightmap() {
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
import * as d3 from "d3";
|
||||
|
||||
export function drawPopulation(event) {
|
||||
population.selectAll("line").remove();
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
import * as d3 from "d3";
|
||||
|
||||
export function drawPrecipitation() {
|
||||
prec.selectAll("circle").remove();
|
||||
const {cells, points} = grid;
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
import * as d3 from "d3";
|
||||
|
||||
import polylabel from "polylabel";
|
||||
|
||||
export function drawStates() {
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
import * as d3 from "d3";
|
||||
|
||||
import {convertTemperature} from "utils/unitUtils";
|
||||
|
||||
export function drawTemperature() {
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
import * as d3 from "d3";
|
||||
|
||||
import {tip} from "scripts/tooltips";
|
||||
import {getBase64} from "utils/functionUtils";
|
||||
import {isCtrlPressed} from "utils/keyboardUtils";
|
||||
|
|
@ -139,14 +141,14 @@ function togglePopulation(event?: MouseEvent) {
|
|||
.select("#rural")
|
||||
.selectAll("line")
|
||||
.transition(hide)
|
||||
.attr("y2", d => d[1])
|
||||
.attr("y2", (d: any[]) => d[1])
|
||||
.remove();
|
||||
population
|
||||
.select("#urban")
|
||||
.selectAll("line")
|
||||
.transition(hide)
|
||||
.delay(1000)
|
||||
.attr("y2", d => d[1])
|
||||
.attr("y2", (d: any[]) => d[1])
|
||||
.remove();
|
||||
}
|
||||
}
|
||||
|
|
@ -473,8 +475,8 @@ function toggleScaleBar(event?: MouseEvent) {
|
|||
}
|
||||
|
||||
async function openUnitsEditor() {
|
||||
// @ts-ignore fix dynamic import
|
||||
const {editUnits} = await import("./../modules/ui/unitsEditor.js");
|
||||
// @ts-ignore untyped module
|
||||
const {editUnits} = await import("../modules/ui/units-editor.js");
|
||||
editUnits();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue