@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.
@@ -1,8 +1,3 @@
1
- /* @preserve
2
- * Leaflet 1.9.4, a JS library for interactive maps. https://leafletjs.com
3
- * (c) 2010-2023 Vladimir Agafonkin, (c) 2010-2011 CloudMade
4
- */
5
-
6
1
  //! moment.js
7
2
 
8
3
  //! moment.js locale configuration
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lgv/visualization-map",
3
- "version": "1.1.5",
3
+ "version": "1.2.0",
4
4
  "type": "module",
5
5
  "description": "ES6 d3.js core visualization scaffold object and utilities for maps.",
6
6
  "main": "src/index.js",
@@ -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
- import L from "leaflet";
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