mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-18 02:01:22 +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 {TIME} from "config/logging";
|
||||
import {isLand} from "utils/graphUtils";
|
||||
import {rn} from "utils/numberUtils";
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
import * as d3 from "d3";
|
||||
import FlatQueue from "flatqueue";
|
||||
import Delaunator from "delaunator";
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
import * as d3 from "d3";
|
||||
|
||||
import {ERROR, TIME} from "config/logging";
|
||||
import {reMarkFeatures} from "modules/markup";
|
||||
import {clipPoly} from "utils/lineUtils";
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
import * as d3 from "d3";
|
||||
import FlatQueue from "flatqueue";
|
||||
|
||||
import {TIME} from "config/logging";
|
||||
|
|
|
|||
|
|
@ -29,3 +29,54 @@ let distanceScale;
|
|||
let urbanization;
|
||||
let urbanDensity;
|
||||
let statesNeutral;
|
||||
|
||||
// svg d3 selections
|
||||
let svg,
|
||||
defs,
|
||||
viewbox,
|
||||
scaleBar,
|
||||
legend,
|
||||
ocean,
|
||||
oceanLayers,
|
||||
oceanPattern,
|
||||
lakes,
|
||||
landmass,
|
||||
texture,
|
||||
terrs,
|
||||
biomes,
|
||||
cells,
|
||||
gridOverlay,
|
||||
coordinates,
|
||||
compass,
|
||||
rivers,
|
||||
terrain,
|
||||
relig,
|
||||
cults,
|
||||
regions,
|
||||
statesBody,
|
||||
statesHalo,
|
||||
provs,
|
||||
zones,
|
||||
borders,
|
||||
stateBorders,
|
||||
provinceBorders,
|
||||
routes,
|
||||
roads,
|
||||
trails,
|
||||
searoutes,
|
||||
temperature,
|
||||
coastline,
|
||||
ice,
|
||||
prec,
|
||||
population,
|
||||
emblems,
|
||||
labels,
|
||||
icons,
|
||||
burgLabels,
|
||||
burgIcons,
|
||||
anchors,
|
||||
armies,
|
||||
markers,
|
||||
fogging,
|
||||
ruler,
|
||||
debug;
|
||||
|
|
|
|||
|
|
@ -1,57 +1,6 @@
|
|||
"use strict";
|
||||
// temporary define svg elements as globals
|
||||
import * as d3 from "d3";
|
||||
|
||||
let svg,
|
||||
defs,
|
||||
viewbox,
|
||||
scaleBar,
|
||||
legend,
|
||||
ocean,
|
||||
oceanLayers,
|
||||
oceanPattern,
|
||||
lakes,
|
||||
landmass,
|
||||
texture,
|
||||
terrs,
|
||||
biomes,
|
||||
cells,
|
||||
gridOverlay,
|
||||
coordinates,
|
||||
compass,
|
||||
rivers,
|
||||
terrain,
|
||||
relig,
|
||||
cults,
|
||||
regions,
|
||||
statesBody,
|
||||
statesHalo,
|
||||
provs,
|
||||
zones,
|
||||
borders,
|
||||
stateBorders,
|
||||
provinceBorders,
|
||||
routes,
|
||||
roads,
|
||||
trails,
|
||||
searoutes,
|
||||
temperature,
|
||||
coastline,
|
||||
ice,
|
||||
prec,
|
||||
population,
|
||||
emblems,
|
||||
labels,
|
||||
icons,
|
||||
burgLabels,
|
||||
burgIcons,
|
||||
anchors,
|
||||
armies,
|
||||
markers,
|
||||
fogging,
|
||||
ruler,
|
||||
debug;
|
||||
|
||||
function defineSvg(width, height) {
|
||||
export function defineSvg(width, height) {
|
||||
// append svg layers (in default order)
|
||||
svg = d3.select("#map");
|
||||
defs = svg.select("#deftemp");
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
import * as d3 from "d3";
|
||||
|
||||
import {findCell} from "utils/graphUtils";
|
||||
import {rn} from "utils/numberUtils";
|
||||
import {rand, P, rw} from "utils/probabilityUtils";
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
import * as d3 from "d3";
|
||||
|
||||
import {restoreDefaultEvents} from "scripts/events";
|
||||
import {findAll, findCell, getPackPolygon, isLand} from "utils/graphUtils";
|
||||
import {tip, showMainTip, clearMainTip} from "scripts/tooltips";
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
import * as d3 from "d3";
|
||||
|
||||
import {restoreDefaultEvents} from "scripts/events";
|
||||
import {findAll, findCell, getPackPolygon, isLand} from "utils/graphUtils";
|
||||
import {tip, showMainTip, clearMainTip} from "scripts/tooltips";
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
import * as d3 from "d3";
|
||||
|
||||
import {restoreDefaultEvents} from "scripts/events";
|
||||
import {findAll, findCell, getPackPolygon, isLand} from "utils/graphUtils";
|
||||
import {byId} from "utils/shorthands";
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
import * as d3 from "d3";
|
||||
|
||||
import {heightmapTemplates} from "config/heightmap-templates";
|
||||
import {precreatedHeightmaps} from "config/precreated-heightmaps";
|
||||
import {shouldRegenerateGrid, generateGrid} from "utils/graphUtils";
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
import * as d3 from "d3";
|
||||
|
||||
import {byId} from "utils/shorthands";
|
||||
import {tip} from "scripts/tooltips";
|
||||
import {capitalize} from "utils/stringUtils";
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
import * as d3 from "d3";
|
||||
|
||||
import {isWater} from "utils/graphUtils";
|
||||
import {tip} from "scripts/tooltips";
|
||||
import {byId} from "utils/shorthands";
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
import * as d3 from "d3";
|
||||
|
||||
import {heightmapTemplates} from "config/heightmap-templates";
|
||||
import {TIME} from "config/logging";
|
||||
import {createTypedArray} from "utils/arrayUtils";
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
import * as d3 from "d3";
|
||||
|
||||
import {getGridPolygon} from "utils/graphUtils";
|
||||
import {unique} from "utils/arrayUtils";
|
||||
import {tip} from "scripts/tooltips";
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
import * as d3 from "d3";
|
||||
|
||||
import {updatePresetInput} from "layers";
|
||||
import {restoreDefaultEvents} from "scripts/events";
|
||||
import {ldb} from "scripts/indexedDB";
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
import * as d3 from "d3";
|
||||
|
||||
import {TIME} from "config/logging";
|
||||
import {rn} from "utils/numberUtils";
|
||||
import {aleaPRNG} from "scripts/aleaPRNG";
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
import * as d3 from "d3";
|
||||
|
||||
import {rn} from "../utils/numberUtils";
|
||||
import {parseTransform} from "utils/stringUtils";
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
import * as d3 from "d3";
|
||||
|
||||
import {TIME} from "config/logging";
|
||||
import {last} from "utils/arrayUtils";
|
||||
import {rn} from "utils/numberUtils";
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
import * as d3 from "d3";
|
||||
import polylabel from "polylabel";
|
||||
|
||||
import {last} from "utils/arrayUtils";
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
import * as d3 from "d3";
|
||||
|
||||
import {TIME} from "config/logging";
|
||||
import {rn, minmax} from "utils/numberUtils";
|
||||
import {rand, gauss, ra} from "utils/probabilityUtils";
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
import * as d3 from "d3";
|
||||
|
||||
import {TIME} from "config/logging";
|
||||
import {clipPoly} from "utils/lineUtils";
|
||||
import {rn} from "utils/numberUtils";
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
import * as d3 from "d3";
|
||||
|
||||
import {TIME} from "config/logging";
|
||||
import {minmax} from "utils/numberUtils";
|
||||
import {rand} from "utils/probabilityUtils";
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
import * as d3 from "d3";
|
||||
|
||||
import {getPackPolygon} from "utils/graphUtils";
|
||||
import {rn, minmax} from "utils/numberUtils";
|
||||
import {rand} from "utils/probabilityUtils";
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
import * as d3 from "d3";
|
||||
import FlatQueue from "flatqueue";
|
||||
|
||||
import {TIME} from "config/logging";
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
import * as d3 from "d3";
|
||||
|
||||
import {TIME, WARN} from "config/logging";
|
||||
import {last} from "utils/arrayUtils";
|
||||
import {rn} from "utils/numberUtils";
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
import * as d3 from "d3";
|
||||
import FlatQueue from "flatqueue";
|
||||
|
||||
import {TIME} from "config/logging";
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
import * as d3 from "d3";
|
||||
|
||||
import {findCell} from "utils/graphUtils";
|
||||
import {getMiddlePoint} from "utils/lineUtils";
|
||||
import {rn} from "utils/numberUtils";
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
import * as d3 from "d3";
|
||||
|
||||
import {TIME} from "config/logging";
|
||||
import {minmax, rn} from "utils/numberUtils";
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
import * as d3 from "d3";
|
||||
|
||||
import {last} from "utils/arrayUtils";
|
||||
import {tip} from "scripts/tooltips";
|
||||
import {wiki} from "utils/linkUtils";
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
import * as d3 from "d3";
|
||||
|
||||
import {restoreDefaultEvents} from "scripts/events";
|
||||
import {findAll, findCell, getPackPolygon, isLand} from "utils/graphUtils";
|
||||
import {tip, showMainTip, clearMainTip} from "scripts/tooltips";
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
import * as d3 from "d3";
|
||||
|
||||
import {findCell} from "utils/graphUtils";
|
||||
import {tip, clearMainTip} from "scripts/tooltips";
|
||||
import {rn} from "utils/numberUtils";
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
import * as d3 from "d3";
|
||||
|
||||
import {restoreDefaultEvents} from "scripts/events";
|
||||
import {findCell} from "utils/graphUtils";
|
||||
import {tip, clearMainTip} from "scripts/tooltips";
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
import * as d3 from "d3";
|
||||
|
||||
import {getPackPolygon} from "utils/graphUtils";
|
||||
import {tip} from "scripts/tooltips";
|
||||
import {clipPoly} from "utils/lineUtils";
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
import * as d3 from "d3";
|
||||
|
||||
import {restoreDefaultEvents} from "scripts/events";
|
||||
import {findCell} from "utils/graphUtils";
|
||||
import {tip, clearMainTip} from "scripts/tooltips";
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
import * as d3 from "d3";
|
||||
|
||||
import {restoreDefaultEvents} from "scripts/events";
|
||||
import {findCell} from "utils/graphUtils";
|
||||
import {byId} from "utils/shorthands";
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
import * as d3 from "d3";
|
||||
|
||||
import {findCell} from "utils/graphUtils";
|
||||
import {rn} from "utils/numberUtils";
|
||||
import {getColorScheme, getHeightColor} from "utils/colorUtils";
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
import * as d3 from "d3";
|
||||
|
||||
import {clearMainTip} from "scripts/tooltips";
|
||||
import {tip} from "scripts/tooltips";
|
||||
import {openURL} from "utils/linkUtils";
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
import * as d3 from "d3";
|
||||
import RgbQuant from "rgbquant";
|
||||
|
||||
import {heightmapTemplates} from "config/heightmap-templates";
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
import * as d3 from "d3";
|
||||
|
||||
import {findGridCell, getGridPolygon} from "utils/graphUtils";
|
||||
import {tip, clearMainTip} from "scripts/tooltips";
|
||||
import {rn} from "utils/numberUtils";
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
import * as d3 from "d3";
|
||||
|
||||
import {getPackPolygon} from "utils/graphUtils";
|
||||
import {tip} from "scripts/tooltips";
|
||||
import {rn} from "utils/numberUtils";
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
import * as d3 from "d3";
|
||||
|
||||
import {restoreDefaultEvents} from "scripts/events";
|
||||
import {findCell} from "utils/graphUtils";
|
||||
import {clearMainTip} from "scripts/tooltips";
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
import * as d3 from "d3";
|
||||
|
||||
import {tip} from "scripts/tooltips";
|
||||
import {wiki} from "utils/linkUtils";
|
||||
import {rn} from "utils/numberUtils";
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
import * as d3 from "d3";
|
||||
|
||||
import {unique} from "utils/arrayUtils";
|
||||
import {tip} from "scripts/tooltips";
|
||||
import {openURL} from "utils/linkUtils";
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
import * as d3 from "d3";
|
||||
|
||||
import {heightmapTemplates} from "config/heightmap-templates";
|
||||
import {precreatedHeightmaps} from "config/precreated-heightmaps";
|
||||
import {lock, locked} from "scripts/options/lock";
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
import * as d3 from "d3";
|
||||
|
||||
import {restoreDefaultEvents} from "scripts/events";
|
||||
import {findAll, findCell, getPackPolygon, isLand} from "utils/graphUtils";
|
||||
import {unique} from "utils/arrayUtils";
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
import * as d3 from "d3";
|
||||
|
||||
import {restoreDefaultEvents} from "scripts/events";
|
||||
import {findCell} from "utils/graphUtils";
|
||||
import {last} from "utils/arrayUtils";
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
import * as d3 from "d3";
|
||||
|
||||
import {findCell} from "utils/graphUtils";
|
||||
import {last} from "utils/arrayUtils";
|
||||
import {tip, clearMainTip} from "scripts/tooltips";
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
import * as d3 from "d3";
|
||||
|
||||
import {restoreDefaultEvents} from "scripts/events";
|
||||
import {findCell} from "utils/graphUtils";
|
||||
import {tip, showMainTip, clearMainTip} from "scripts/tooltips";
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
import * as d3 from "d3";
|
||||
|
||||
import {restoreDefaultEvents} from "scripts/events";
|
||||
import {getPackPolygon, findCell} from "utils/graphUtils";
|
||||
import {last} from "utils/arrayUtils";
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
import * as d3 from "d3";
|
||||
|
||||
import {findCell, getPackPolygon} from "utils/graphUtils";
|
||||
import {tip, clearMainTip} from "scripts/tooltips";
|
||||
import {getSegmentId} from "utils/lineUtils";
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
import * as d3 from "d3";
|
||||
|
||||
import {rn} from "utils/numberUtils";
|
||||
|
||||
export function overviewRivers() {
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
import * as d3 from "d3";
|
||||
|
||||
import {tip, showMainTip, clearMainTip} from "scripts/tooltips";
|
||||
import {getSegmentId} from "utils/lineUtils";
|
||||
import {rn} from "utils/numberUtils";
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
import * as d3 from "d3";
|
||||
|
||||
import {tip} from "scripts/tooltips";
|
||||
import {rn} from "utils/numberUtils";
|
||||
import {parseTransform} from "utils/stringUtils";
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
import * as d3 from "d3";
|
||||
|
||||
import {tip} from "scripts/tooltips";
|
||||
import {rn} from "utils/numberUtils";
|
||||
import {round} from "utils/stringUtils";
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
import * as d3 from "d3";
|
||||
|
||||
import {restoreDefaultEvents} from "scripts/events";
|
||||
import {findCell} from "utils/graphUtils";
|
||||
import {last} from "utils/arrayUtils";
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
import * as d3 from "d3";
|
||||
|
||||
import {restoreDefaultEvents} from "scripts/events";
|
||||
import {findCell} from "utils/graphUtils";
|
||||
import {tip} from "scripts/tooltips";
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
import * as d3 from "d3";
|
||||
|
||||
import {tip} from "scripts/tooltips";
|
||||
import {rn} from "utils/numberUtils";
|
||||
import {round, parseTransform} from "utils/stringUtils";
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
import * as d3 from "d3";
|
||||
|
||||
import {restoreDefaultEvents} from "scripts/events";
|
||||
import {findAll, findCell, getPackPolygon} from "utils/graphUtils";
|
||||
import {unique} from "utils/arrayUtils";
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
import * as d3 from "d3";
|
||||
import FlatQueue from "flatqueue";
|
||||
|
||||
import {TIME} from "config/logging";
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
import * as d3 from "d3";
|
||||
|
||||
import {debounce} from "utils/functionUtils";
|
||||
import {handleZoom, invokeActiveZooming} from "/src/modules/activeZooming";
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue