@lgv/visualization-map 1.1.5 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { select } from "d3-selection";
|
|
2
2
|
import { LinearGrid } from "@lgv/visualization-chart";
|
|
3
3
|
import { mean } from "d3-array";
|
|
4
|
-
|
|
4
|
+
|
|
5
|
+
let L;
|
|
6
|
+
if (typeof window !== "undefined") L = await import("leaflet");
|
|
5
7
|
|
|
6
8
|
import leafletCss from "./leafletCss.js";
|
|
7
9
|
import { MapData as MD } from "../structure/index.js";
|
|
@@ -154,6 +156,9 @@ class VisualizationMap extends LinearGrid {
|
|
|
154
156
|
// update tile server
|
|
155
157
|
L.tileLayer(this.tileServerUrl).addTo(this.map);
|
|
156
158
|
|
|
159
|
+
// fit to data if provided
|
|
160
|
+
if (this.data) this.fitToData();
|
|
161
|
+
|
|
157
162
|
}
|
|
158
163
|
|
|
159
164
|
/**
|
|
@@ -167,6 +172,9 @@ class VisualizationMap extends LinearGrid {
|
|
|
167
172
|
// generate patterns
|
|
168
173
|
this.generatePatterns();
|
|
169
174
|
|
|
175
|
+
// generate chart
|
|
176
|
+
this.generateChart();
|
|
177
|
+
|
|
170
178
|
// add handlers for leaflet events
|
|
171
179
|
this.attachEvents();
|
|
172
180
|
|