eurostat-map 4.4.1 → 4.4.3
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/README.md +147 -221
- package/build/215.eurostatmap.min.js +1 -1
- package/build/215.eurostatmap.min.js.map +1 -1
- package/build/eurostatmap.js +5006 -5001
- package/build/eurostatmap.min.js +2 -2
- package/build/eurostatmap.min.js.map +1 -1
- package/build/package.json +1 -1
- package/build/types/core/MapConfig.d.ts +74 -1
- package/build/types/core/MapInstance.d.ts +94 -1
- package/build/types/index.d.ts +27 -3
- package/build/types/legend/LegendConfig.d.ts +24 -7
- package/build/types/legend/choropleth/ChoroplethLegendConfig.d.ts +80 -0
- package/build/types/map-types/choropleth/BivariateChoroplethConfig.d.ts +4 -0
- package/build/types/map-types/choropleth/ChoroplethConfig.d.ts +4 -0
- package/build/types/map-types/choropleth/TrivariateChoroplethConfig.d.ts +4 -0
- package/build/types/map-types/composition/bar/BarMap.d.ts +1 -1
- package/build/types/map-types/composition/coxcomb/CoxcombMap.d.ts +1 -1
- package/build/types/map-types/composition/pie/PieMap.d.ts +1 -1
- package/build/types/map-types/composition/stripe/StripeMap.d.ts +1 -1
- package/build/types/map-types/composition/waffle/WaffleMap.d.ts +1 -1
- package/build/types/map-types/spark/SparkMap.d.ts +1 -1
- package/package.json +8 -3
package/README.md
CHANGED
|
@@ -1,221 +1,147 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
<img src="https://img.shields.io/
|
|
5
|
-
<
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
<br>
|
|
11
|
-
<div align="center">
|
|
12
|
-
<img src="https://raw.githubusercontent.com/eurostat/eurostat-map/master/docs/img/eurostat-map-logo-cropped.png" alt="examples" width="400"/>
|
|
13
|
-
</div>
|
|
14
|
-
<div align="center">
|
|
15
|
-
<em>Build publication-ready statistical maps of Europe in minutes.</em>
|
|
16
|
-
</div>
|
|
17
|
-
|
|
18
|
-
<div align="center">
|
|
19
|
-
|
|
20
|
-
</div>
|
|
21
|
-
|
|
22
|
-
<div align="center">
|
|
23
|
-
<a href="docs/reference.md"><strong>
|
|
24
|
-
<a href="https://eurostat.github.io/eurostat-map/examples/
|
|
25
|
-
<a href="https://observablehq.com/collection/@eurostat-ws/eurostatmap-js"><strong>Quickstart notebook</strong></a>
|
|
26
|
-
</div>
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
- **
|
|
31
|
-
- **
|
|
32
|
-
- **
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
<
|
|
36
|
-
<
|
|
37
|
-
|
|
38
|
-
<
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
-
|
|
47
|
-
-
|
|
48
|
-
-
|
|
49
|
-
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
- [
|
|
120
|
-
- [
|
|
121
|
-
- [
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
<script src="https://unpkg.com/eurostat-map"></script>
|
|
149
|
-
```
|
|
150
|
-
|
|
151
|
-
For a fixed version, use:
|
|
152
|
-
|
|
153
|
-
```html
|
|
154
|
-
<script src="https://unpkg.com/eurostat-map@X.Y.Z"></script>
|
|
155
|
-
```
|
|
156
|
-
|
|
157
|
-
where X.Y.Z is a [version number](https://www.npmjs.com/package/eurostat-map?activeTab=versions).
|
|
158
|
-
|
|
159
|
-
## Documentation
|
|
160
|
-
|
|
161
|
-
For detailed documentation see the **[API reference page](docs/reference.md)**.
|
|
162
|
-
|
|
163
|
-
You can jump directly to map-type sections from the table of contents in [docs/reference.md](docs/reference.md).
|
|
164
|
-
|
|
165
|
-
Anything unclear or missing? Feel free to [ask](https://github.com/eurostat/eurostat.js/issues/new)!
|
|
166
|
-
|
|
167
|
-
## Developer Path
|
|
168
|
-
|
|
169
|
-
### Local setup
|
|
170
|
-
|
|
171
|
-
```bash
|
|
172
|
-
npm install
|
|
173
|
-
npm run server
|
|
174
|
-
```
|
|
175
|
-
|
|
176
|
-
### Build and quality checks
|
|
177
|
-
|
|
178
|
-
```bash
|
|
179
|
-
npm run build-prod
|
|
180
|
-
npm run format
|
|
181
|
-
```
|
|
182
|
-
|
|
183
|
-
### Where to start in the codebase
|
|
184
|
-
|
|
185
|
-
- Factory and map creation: [src/eurostat-map.js](src/eurostat-map.js)
|
|
186
|
-
- Core map scaffolding: [src/core/map-instance.js](src/core/map-instance.js), [src/core/stat-map.js](src/core/stat-map.js)
|
|
187
|
-
- Map types: [src/map-types](src/map-types)
|
|
188
|
-
- Legend system: [src/legend](src/legend)
|
|
189
|
-
- Type declarations: [src/types](src/types)
|
|
190
|
-
|
|
191
|
-
### Contribution flow
|
|
192
|
-
|
|
193
|
-
1. Pick an issue or propose one in Discussions/Issues.
|
|
194
|
-
2. Add or update an example in [examples](examples) when changing behavior.
|
|
195
|
-
3. Run build and formatting before opening a PR.
|
|
196
|
-
4. Link relevant docs updates in [docs/reference.md](docs/reference.md) when APIs change.
|
|
197
|
-
|
|
198
|
-
## Technical details
|
|
199
|
-
|
|
200
|
-
Maps based on [NUTS regions](http://ec.europa.eu/eurostat/web/nuts/overview) rely on [Nuts2json API](https://github.com/eurostat/Nuts2json) and [TopoJSON](https://github.com/mbostock/topojson/wiki) format. Statistical data are accessed using [Eurostat STATISTICS API](https://wikis.ec.europa.eu/display/EUROSTATHELP/API+-+Getting+started+with+statistics+API) for [JSON-stat](https://json-stat.org/) data. The data are decoded and queried using [JSON-stat library](https://json-stat.com/). Custom data can also be used with `map.statData().setData({ES:3,FR:2,DE:5})`. Maps are rendered as SVG maps using [D3.js library](https://d3js.org/).
|
|
201
|
-
|
|
202
|
-
## About
|
|
203
|
-
|
|
204
|
-
| | |
|
|
205
|
-
| -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
206
|
-
| _contributors_ | [<img src="https://github.com/jgaffuri.png" height="40" />](https://github.com/jgaffuri) [<img src="https://github.com/JoeWDavies.png" height="40" />](https://github.com/JoeWDavies) |
|
|
207
|
-
| _version_ | See [npm](https://www.npmjs.com/package/eurostat-map?activeTab=versions) |
|
|
208
|
-
| _status_ | Since 2018 |
|
|
209
|
-
| _license_ | [EUPL 1.2](https://github.com/eurostat/Nuts2json/blob/master/LICENSE) |
|
|
210
|
-
|
|
211
|
-
## Contribute
|
|
212
|
-
|
|
213
|
-
Feel free to [ask for assistance](https://github.com/eurostat/eurostat.js/issues/new), fork the project or simply star it (it's always a pleasure).
|
|
214
|
-
|
|
215
|
-
## Copyright
|
|
216
|
-
|
|
217
|
-
The [Eurostat NUTS dataset](http://ec.europa.eu/eurostat/web/nuts/overview) is copyrighted. There are [specific provisions](https://ec.europa.eu/eurostat/web/gisco/geodata/statistical-units) for the usage of this dataset which must be respected. The usage of these data is subject to their acceptance. See the [Eurostat-GISCO website](https://ec.europa.eu/eurostat/web/gisco/geodata/statistical-units) for more information.
|
|
218
|
-
|
|
219
|
-
## Disclaimer
|
|
220
|
-
|
|
221
|
-
The designations employed and the presentation of material on these maps do not imply the expression of any opinion whatsoever on the part of the European Union concerning the legal status of any country, territory, city or area or of its authorities, or concerning the delimitation of its frontiers or boundaries. Kosovo*: This designation is without prejudice to positions on status, and is in line with UNSCR 1244/1999 and the ICJ Opinion on the Kosovo declaration of independence. Palestine*: This designation shall not be construed as recognition of a State of Palestine and is without prejudice to the individual positions of the Member States on this issue.
|
|
1
|
+
# eurostat-map: Data-Driven Maps
|
|
2
|
+
|
|
3
|
+
<div align="center">
|
|
4
|
+
<img src="https://img.shields.io/bundlephobia/min/eurostat-map" alt="npm bundle size">
|
|
5
|
+
<img src="https://img.shields.io/npm/v/eurostat-map" alt="npm">
|
|
6
|
+
<img src="https://img.shields.io/badge/license-EUPL-success" alt="license">
|
|
7
|
+
<a href="http://www.awesomeofficialstatistics.org"><img src="https://awesome.re/mentioned-badge.svg" alt="Mentioned in Awesome Official Statistics"></a>
|
|
8
|
+
</div>
|
|
9
|
+
|
|
10
|
+
<br>
|
|
11
|
+
<div align="center">
|
|
12
|
+
<img src="https://raw.githubusercontent.com/eurostat/eurostat-map/master/docs/img/eurostat-map-logo-cropped.png" alt="examples" width="400"/>
|
|
13
|
+
</div>
|
|
14
|
+
<div align="center">
|
|
15
|
+
<em>Build publication-ready statistical maps of Europe in minutes.</em>
|
|
16
|
+
</div>
|
|
17
|
+
|
|
18
|
+
<div align="center">
|
|
19
|
+
D3-based mapping library for Eurostat and custom data - the engine that powers <a href="https://gisco-services.ec.europa.eu/image/" target="_blank"><strong>IMAGE</strong></a>.
|
|
20
|
+
</div>
|
|
21
|
+
|
|
22
|
+
<div align="center">
|
|
23
|
+
<a href="docs/reference.md" target="_blank"><strong>Documentation</strong></a> ·
|
|
24
|
+
<a href="https://eurostat.github.io/eurostat-map/examples/index.html" target="_blank"><strong>Live examples</strong></a> ·
|
|
25
|
+
<a href="https://observablehq.com/collection/@eurostat-ws/eurostatmap-js" target="_blank"><strong>Quickstart notebook</strong></a>
|
|
26
|
+
</div>
|
|
27
|
+
<hr>
|
|
28
|
+
|
|
29
|
+
- **Interactive SVG maps** rendered using **D3.js**.
|
|
30
|
+
- **TypeScript support** with built-in definition typings.
|
|
31
|
+
- **NUTS geometries** fetched dynamically via the **Nuts2json API** (TopoJSON format).
|
|
32
|
+
- **Eurostat API integration** using the **JSON-stat** standard.
|
|
33
|
+
|
|
34
|
+
<hr>
|
|
35
|
+
<br>
|
|
36
|
+
<div align="center">
|
|
37
|
+
|
|
38
|
+
<table>
|
|
39
|
+
<tr>
|
|
40
|
+
<td><a href="https://eurostat.github.io/eurostat-map/examples/choropleth/population-density.html" target="_blank"><img src="examples/img/previews/population-density.png" alt="Population density example" /></a></td>
|
|
41
|
+
<td><a href="https://eurostat.github.io/eurostat-map/examples/proportional/prop-circles.html" target="_blank"><img src="examples/img/previews/prop-circles.png" alt="Proportional circles example" /></a></td>
|
|
42
|
+
<td><a href="https://eurostat.github.io/eurostat-map/examples/flow/flowmap.html" target="_blank"><img src="examples/img/previews/flowmap.png" alt="Flow map example" /></a></td>
|
|
43
|
+
<td><a href="https://eurostat.github.io/eurostat-map/examples/mushroom/mushroom.html" target="_blank"><img src="examples/img/previews/mushroom.png" alt="Mushroom map example" /></a></td>
|
|
44
|
+
</tr>
|
|
45
|
+
<tr>
|
|
46
|
+
<td><a href="https://eurostat.github.io/eurostat-map/examples/sparklines/sparklines-grid-cartogram.html" target="_blank"><img src="examples/img/previews/sparklines-grid-cartogram.png" alt="Sparklines map example" /></a></td>
|
|
47
|
+
<td><a href="https://eurostat.github.io/eurostat-map/examples/bivariate/pop-unemploy-bivariate.html" target="_blank"><img src="examples/img/previews/pop-unemploy-bivariate.png" alt="Bivariate map example" /></a></td>
|
|
48
|
+
<td><a href="https://eurostat.github.io/eurostat-map/examples/trivariate/trivariate.html" target="_blank"><img src="examples/img/previews/trivariate.png" alt="Trivariate map example" /></a></td>
|
|
49
|
+
<td><a href="https://eurostat.github.io/eurostat-map/examples/stripe/livestock_composition.html" target="_blank"><img src="examples/img/previews/livestock_composition.png" alt="Trivariate map example" /></a></td>
|
|
50
|
+
</tr>
|
|
51
|
+
</table>
|
|
52
|
+
</div>
|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
## Resources
|
|
57
|
+
|
|
58
|
+
- [Quick Start](#quick-start)
|
|
59
|
+
- [Examples](https://eurostat.github.io/eurostat-map/examples/index.html)
|
|
60
|
+
- [Documentation](#documentation)
|
|
61
|
+
- [Made with eurostat-map](#made-with-eurostat-map)
|
|
62
|
+
- [About](#about)
|
|
63
|
+
- [Contribute](#contribute)
|
|
64
|
+
- [Copyright](#copyright)
|
|
65
|
+
- [Disclaimer](#disclaimer)
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
## Quick Start
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
npm install eurostat-map
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
```javascript
|
|
76
|
+
import eurostatmap from 'eurostat-map'
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
or
|
|
80
|
+
|
|
81
|
+
```javascript
|
|
82
|
+
const eurostatmap = require('eurostat-map')
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
or
|
|
86
|
+
|
|
87
|
+
```html
|
|
88
|
+
<script src="https://unpkg.com/eurostat-map"></script>
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
then
|
|
92
|
+
|
|
93
|
+
```javascript
|
|
94
|
+
eurostatmap
|
|
95
|
+
.map('choropleth')
|
|
96
|
+
.title('Population density in Europe')
|
|
97
|
+
.stat({ eurostatDatasetCode: 'demo_r_d3dens', unitText: 'people/km²' })
|
|
98
|
+
.legend({ x: 500, y: 180, title: 'Density, people/km²' })
|
|
99
|
+
.build()
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
Want a guided setup? Try the notebook:
|
|
103
|
+
https://observablehq.com/@joewdavies/eurostat-map-js
|
|
104
|
+
|
|
105
|
+
## Documentation
|
|
106
|
+
|
|
107
|
+
For detailed documentation on what eurostat-map can do, see the **[documentation page](docs/reference.md)**.
|
|
108
|
+
|
|
109
|
+
For generated, signature-accurate API docs from TypeScript/JSDoc, see [the API docs](https://eurostat.github.io/eurostat-map/docs/api/index.html).
|
|
110
|
+
|
|
111
|
+
Anything unclear or missing? Feel free to [ask](https://github.com/eurostat/eurostat.js/issues/new)!
|
|
112
|
+
|
|
113
|
+
## Made with eurostat-map
|
|
114
|
+
|
|
115
|
+
Here are some public projects and publications built with eurostat-map:
|
|
116
|
+
|
|
117
|
+
- [IMAGE](https://gisco-services.ec.europa.eu/image/) - Eurostat's interactive map generator.
|
|
118
|
+
- [Regions in Europe 2025](https://ec.europa.eu/eurostat/web/interactive-publications/regions-2025) - interactive publication.
|
|
119
|
+
- [Eurostat Regional Yearbook](https://ec.europa.eu/eurostat/statistics-explained/index.php?title=Eurostat_regional_yearbook) - interactive publication.
|
|
120
|
+
- [Women make up 53% of science & technology ranks](https://ec.europa.eu/eurostat/web/products-eurostat-news/w/ddn-20260529-2)
|
|
121
|
+
- [Average work week nearly 36 hours in the EU in 2025](https://ec.europa.eu/eurostat/en/web/products-eurostat-news/w/ddn-20260527-1)
|
|
122
|
+
- [Tourism nights booked via platforms hit nearly 1 billion](https://ec.europa.eu/eurostat/en/web/products-eurostat-news/w/ddn-20260401-1)
|
|
123
|
+
- [EU rail passengers made 8.7 billion trips in 2024](https://ec.europa.eu/eurostat/web/products-eurostat-news/w/ddn-20260514-1)
|
|
124
|
+
- [EU life expectancy increases again and hits 81.5 years](https://ec.europa.eu/eurostat/web/products-eurostat-news/w/ddn-20260313-3)
|
|
125
|
+
|
|
126
|
+
## About
|
|
127
|
+
|
|
128
|
+
eurostat-map is an open-source JavaScript library for building interactive, publication-ready statistical maps focused on Europe. It combines D3-based SVG rendering with direct support for Eurostat datasets (JSON-stat), NUTS geographies from Nuts2json, and custom data workflows, and includes map types such as choropleth, proportional symbols, cartograms, flow maps, and composition charts. The project is designed for analysts, journalists, and institutions that need reproducible, configurable map visualizations for both exploratory analysis and official communication.
|
|
129
|
+
|
|
130
|
+
| | |
|
|
131
|
+
| -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
132
|
+
| _contributors_ | [<img src="https://github.com/jgaffuri.png" height="40" />](https://github.com/jgaffuri) [<img src="https://github.com/JoeWDavies.png" height="40" />](https://github.com/JoeWDavies) |
|
|
133
|
+
| _version_ | See [npm](https://www.npmjs.com/package/eurostat-map?activeTab=versions) |
|
|
134
|
+
| _status_ | Since 2018 |
|
|
135
|
+
| _license_ | [EUPL 1.2](https://github.com/eurostat/Nuts2json/blob/master/LICENSE) |
|
|
136
|
+
|
|
137
|
+
## Contribute
|
|
138
|
+
|
|
139
|
+
Feel free to [ask for assistance](https://github.com/eurostat/eurostat.js/issues/new), fork the project or simply star it (it's always a pleasure).
|
|
140
|
+
|
|
141
|
+
## Copyright
|
|
142
|
+
|
|
143
|
+
The [Eurostat NUTS dataset](http://ec.europa.eu/eurostat/web/nuts/overview) is copyrighted. There are [specific provisions](https://ec.europa.eu/eurostat/web/gisco/geodata/statistical-units) for the usage of this dataset which must be respected. The usage of these data is subject to their acceptance. See the [Eurostat-GISCO website](https://ec.europa.eu/eurostat/web/gisco/geodata/statistical-units) for more information.
|
|
144
|
+
|
|
145
|
+
## Disclaimer
|
|
146
|
+
|
|
147
|
+
The designations employed and the presentation of material on these maps do not imply the expression of any opinion whatsoever on the part of the European Union concerning the legal status of any country, territory, city or area or of its authorities, or concerning the delimitation of its frontiers or boundaries. Kosovo*: This designation is without prejudice to positions on status, and is in line with UNSCR 1244/1999 and the ICJ Opinion on the Kosovo declaration of independence. Palestine*: This designation shall not be construed as recognition of a State of Palestine and is without prejudice to the individual positions of the Member States on this issue.
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/*! /*! eurostat-map v4.4.
|
|
1
|
+
/*! /*! eurostat-map v4.4.3 | 2026 Eurostat | EUPL License. See https://github.com/eurostat/eurostat-map/blob/master/LICENSE * / */
|
|
2
2
|
!function webpackUniversalModuleDefinition(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.eurostatmap=t():e.eurostatmap=t()}(self,()=>(onmessage=function onmessage(e){var t=e.data,o=t.nodes,r=t.radii,n=t.strengthX,s=t.strengthY,i=t.iterations,p=t.d3URL;importScripts(p||"https://unpkg.com/d3@7/dist/d3.min.js");for(var a=o.map(function(e,t){return e.x=e.properties.centroid[0],e.y=e.properties.centroid[1],e.r=r[t],e}),c=d3.forceSimulation(a).force("x",d3.forceX(function(e){return e.properties.centroid[0]}).strength(n)).force("y",d3.forceY(function(e){return e.properties.centroid[1]}).strength(s)).force("collide",d3.forceCollide(function(e){return e.r}).iterations(i)).stop(),d=Math.ceil(Math.log(c.alphaMin())/Math.log(1-c.alphaDecay())),f=0;f<d;f++)c.tick(),f%10==0&&postMessage({type:"progress",progress:f,total:d});postMessage({type:"end",nodes:a}),self.close()},{}));
|
|
3
3
|
//# sourceMappingURL=215.eurostatmap.min.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"215.eurostatmap.min.js","mappings":";CAAA,
|
|
1
|
+
{"version":3,"file":"215.eurostatmap.min.js","mappings":";CAAA,SAAUA,iCAAiCC,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IACQ,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,GAAIH,GACe,iBAAZC,QACdA,QAAqB,YAAID,IAEzBD,EAAkB,YAAIC,GACvB,CATD,CASGK,KAAM,KCTTC,UAAY,SAAZA,UAAaC,GACT,IAAAC,EAA8ED,EAAME,KAArEC,EAAUF,EAAjBG,MAAmBC,EAAKJ,EAALI,MAAOC,EAASL,EAATK,UAAWC,EAASN,EAATM,UAAWC,EAAUP,EAAVO,WAAYC,EAAKR,EAALQ,MAGpEC,cAAcD,GAAS,yCAkBvB,IAhBA,IAAML,EAAQD,EAAWQ,IAAI,SAACC,EAAGC,GAI7B,OAHAD,EAAEE,EAAIF,EAAEG,WAAWC,SAAS,GAC5BJ,EAAEK,EAAIL,EAAEG,WAAWC,SAAS,GAC5BJ,EAAEM,EAAIb,EAAMQ,GACLD,CACX,GAEMO,EAAMC,GACPC,gBAAgBjB,GAChBkB,MAAM,IAAKF,GAAGG,OAAO,SAACC,GAAC,OAAKA,EAAET,WAAWC,SAAS,EAAE,GAAES,SAASnB,IAC/DgB,MAAM,IAAKF,GAAGM,OAAO,SAACF,GAAC,OAAKA,EAAET,WAAWC,SAAS,EAAE,GAAES,SAASlB,IAC/De,MAAM,UAAWF,GAAGO,aAAa,SAACH,GAAC,OAAKA,EAAEN,CAAC,GAAEV,WAAWA,IACxDoB,OAECC,EAASC,KAAKC,KAAKD,KAAKE,IAAIb,EAAIc,YAAcH,KAAKE,IAAI,EAAIb,EAAIe,eAE5DrB,EAAI,EAAGA,EAAIgB,EAAQhB,IACxBM,EAAIgB,OACAtB,EAAI,IAAO,GACXuB,YAAY,CAAEC,KAAM,WAAYC,SAAUzB,EAAG0B,MAAOV,IAI5DO,YAAY,CAAEC,KAAM,MAAOjC,MAAAA,IAC3BN,KAAK0C,OACT,E","sources":["webpack://eurostatmap/webpack/universalModuleDefinition","webpack://eurostatmap/./src/core/dorling/dorling-worker.js"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"eurostatmap\"] = factory();\n\telse\n\t\troot[\"eurostatmap\"] = factory();\n})(self, () => {\nreturn ","onmessage = (event) => {\r\n const { nodes: inputNodes, radii, strengthX, strengthY, iterations, d3URL } = event.data\r\n\r\n // Load D3 dynamically into the worker\r\n importScripts(d3URL || 'https://unpkg.com/d3@7/dist/d3.min.js')\r\n\r\n const nodes = inputNodes.map((n, i) => {\r\n n.x = n.properties.centroid[0]\r\n n.y = n.properties.centroid[1]\r\n n.r = radii[i]\r\n return n\r\n })\r\n\r\n const sim = d3\r\n .forceSimulation(nodes)\r\n .force('x', d3.forceX((d) => d.properties.centroid[0]).strength(strengthX))\r\n .force('y', d3.forceY((d) => d.properties.centroid[1]).strength(strengthY))\r\n .force('collide', d3.forceCollide((d) => d.r).iterations(iterations))\r\n .stop()\r\n\r\n const nTicks = Math.ceil(Math.log(sim.alphaMin()) / Math.log(1 - sim.alphaDecay()))\r\n\r\n for (let i = 0; i < nTicks; i++) {\r\n sim.tick()\r\n if (i % 10 === 0) {\r\n postMessage({ type: 'progress', progress: i, total: nTicks })\r\n }\r\n }\r\n\r\n postMessage({ type: 'end', nodes })\r\n self.close()\r\n}\r\n"],"names":["webpackUniversalModuleDefinition","root","factory","exports","module","define","amd","self","onmessage","event","_event$data","data","inputNodes","nodes","radii","strengthX","strengthY","iterations","d3URL","importScripts","map","n","i","x","properties","centroid","y","r","sim","d3","forceSimulation","force","forceX","d","strength","forceY","forceCollide","stop","nTicks","Math","ceil","log","alphaMin","alphaDecay","tick","postMessage","type","progress","total","close"],"sourceRoot":""}
|