eurostat-map 4.4.0 → 4.4.2

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.
Files changed (48) hide show
  1. package/README.md +54 -78
  2. package/build/215.eurostatmap.min.js +1 -1
  3. package/build/eurostatmap.js +2700 -353
  4. package/build/eurostatmap.min.js +2 -2
  5. package/build/eurostatmap.min.js.map +1 -1
  6. package/build/types/core/DorlingSettings.d.ts +29 -0
  7. package/build/types/core/GridCartogramSettings.d.ts +30 -0
  8. package/build/types/core/InsetConfig.d.ts +9 -1
  9. package/build/types/core/MapConfig.d.ts +124 -41
  10. package/build/types/core/MapInstance.d.ts +120 -32
  11. package/build/types/core/TooltipConfig.d.ts +3 -0
  12. package/build/types/core/decoration/CoastalMarginSettings.d.ts +21 -0
  13. package/build/types/core/geo/geometries.d.ts +15 -0
  14. package/build/types/core/geo/kosovo.d.ts +2 -0
  15. package/build/types/core/stat/StatData.d.ts +6 -0
  16. package/build/types/core/utils.d.ts +4 -0
  17. package/build/types/index.d.ts +28 -12
  18. package/build/types/legend/LegendConfig.d.ts +42 -17
  19. package/build/types/legend/SparklineLegendConfig.d.ts +6 -68
  20. package/build/types/legend/choropleth/ChoroplethLegendConfig.d.ts +80 -0
  21. package/build/types/legend/composition/CoxcombLegendConfig.d.ts +85 -0
  22. package/build/types/legend/composition/PieChartLegendConfig.d.ts +68 -0
  23. package/build/types/legend/composition/SparklineLegendConfig.d.ts +94 -0
  24. package/build/types/legend/composition/StripeCompositionLegendConfig.d.ts +11 -0
  25. package/build/types/legend/composition/WaffleLegendConfig.d.ts +74 -0
  26. package/build/types/map-types/choropleth/BivariateChoroplethConfig.d.ts +12 -0
  27. package/build/types/map-types/choropleth/ChoroplethConfig.d.ts +15 -5
  28. package/build/types/map-types/choropleth/TrivariateChoroplethConfig.d.ts +14 -0
  29. package/build/types/map-types/composition/CompositionStatConfig.d.ts +14 -1
  30. package/build/types/map-types/composition/bar/BarMap.d.ts +4 -3
  31. package/build/types/map-types/composition/bar/BarMapConfig.d.ts +25 -1
  32. package/build/types/map-types/composition/coxcomb/CoxcombMap.d.ts +4 -0
  33. package/build/types/map-types/composition/coxcomb/CoxcombMapConfig.d.ts +14 -0
  34. package/build/types/map-types/composition/coxcomb/CoxcombStatConfig.d.ts +4 -2
  35. package/build/types/map-types/composition/pie/PieMap.d.ts +10 -3
  36. package/build/types/map-types/composition/pie/PieMapConfig.d.ts +19 -1
  37. package/build/types/map-types/composition/stripe/StripeMap.d.ts +9 -0
  38. package/build/types/map-types/composition/stripe/StripeMapConfig.d.ts +12 -0
  39. package/build/types/map-types/composition/waffle/WaffleMap.d.ts +10 -3
  40. package/build/types/map-types/composition/waffle/WaffleMapConfig.d.ts +20 -1
  41. package/build/types/map-types/flow/FlowMapConfig.d.ts +55 -0
  42. package/build/types/map-types/proportional-symbol/ProportionalSymbolConfig.d.ts +4 -11
  43. package/build/types/map-types/proportional-symbol/ProportionalSymbolMap.d.ts +0 -9
  44. package/build/types/map-types/proportional-symbol/mushroom/MushroomMapConfig.d.ts +5 -0
  45. package/build/types/map-types/spark/SparkMap.d.ts +6 -2
  46. package/build/types/map-types/spark/SparkMapConfig.d.ts +17 -0
  47. package/build/types/map-types/spark/SparkStatConfig.d.ts +6 -0
  48. package/package.json +9 -2
package/README.md CHANGED
@@ -1,38 +1,63 @@
1
+ # eurostat-map: Data-Driven Maps
2
+
1
3
  <div align="center">
2
4
  <img src="https://img.shields.io/bundlephobia/min/eurostat-map" alt="npm bundle size">
3
5
  <img src="https://img.shields.io/npm/v/eurostat-map" alt="npm">
4
6
  <img src="https://img.shields.io/badge/license-EUPL-success" alt="license">
5
7
  <a href="http://www.awesomeofficialstatistics.org"><img src="https://awesome.re/mentioned-badge.svg" alt="Mentioned in Awesome Official Statistics"></a>
6
8
  </div>
9
+
7
10
  <br>
8
11
  <div align="center">
9
12
  <img src="https://raw.githubusercontent.com/eurostat/eurostat-map/master/docs/img/eurostat-map-logo-cropped.png" alt="examples" width="400"/>
10
13
  </div>
11
14
  <div align="center">
12
- <em>Customizable thematic maps. See <strong><a href="docs/reference.md">documentation</a></strong>.</em>
15
+ <em>Build publication-ready statistical maps of Europe in minutes.</em>
13
16
  </div>
14
17
 
15
- <hr>
16
-
17
18
  <div align="center">
18
- Based on D3 and designed for Eurostat data but compatible with custom geometries and stats.
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>.
19
20
  </div>
21
+
20
22
  <div align="center">
21
- Check out <a href="https://observablehq.com/collection/@eurostat-ws/eurostatmap-js" target="_blank">this observable notebook</a> for a quickstart guide.
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>
22
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>
23
35
  <br>
24
36
  <div align="center">
25
- <a href="https://eurostat.github.io/eurostat-map/examples/population-density.html" target="_blank"> <img src="https://raw.githubusercontent.com/eurostat/eurostat-map/master/docs/img/examples.gif" alt="examples" width="600"/> </a>
37
+
38
+ <table>
39
+ <tr>
40
+ <td><a href="https://eurostat.github.io/eurostat-map/examples/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/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/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.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-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/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.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/livestock_composition.html" target="_blank"><img src="examples/img/previews/livestock_composition.png" alt="Trivariate map example" /></a></td>
50
+ </tr>
51
+ </table>
26
52
  </div>
27
53
 
28
54
  ---
29
55
 
30
- ## Table of Contents
56
+ ## Resources
31
57
 
32
- - [Examples](#examples)
33
- - [Installation](#installation)
58
+ - [Quick Start](#quick-start)
59
+ - [Examples](https://eurostat.github.io/eurostat-map/examples/index.html)
34
60
  - [Documentation](#documentation)
35
- - [Technical details](#technical-details)
36
61
  - [About](#about)
37
62
  - [Contribute](#contribute)
38
63
  - [Copyright](#copyright)
@@ -40,103 +65,54 @@ Based on D3 and designed for Eurostat data but compatible with custom geometries
40
65
 
41
66
  ---
42
67
 
43
- ## Examples
44
-
45
- You can build an interactive statistical map with just a few lines of code:
46
-
47
- ```javascript
48
- const map = eurostatmap
49
- .map('choropleth') // Specify the map type
50
- .title('Population density in Europe') // Add a title
51
- .stat({ eurostatDatasetCode: 'demo_r_d3dens', unitText: 'people/km²' }) // Configure dataset
52
- .legend({ x: 500, y: 180, title: 'Density, people/km²' }) // Add a legend
53
- .build() // Build the map
54
-
55
- // Or you can use your own statistics like so:
56
- map.statData().setData({ ES: 3, FR: 2, DE: 5 })
57
- ```
58
-
59
- For a quick tutorial check out this notebook:
60
- https://observablehq.com/@joewdavies/eurostat-map-js
68
+ ## Quick Start
61
69
 
62
- - [Population density](https://eurostat.github.io/eurostat-map/examples/population-density.html) (see [the code](https://github.com/eurostat/eurostat-map/blob/master/examples/population-density.html))
63
- - [Population map with proportional circles](https://eurostat.github.io/eurostat-map/examples/prop-circles.html) (see [the code](https://github.com/eurostat/eurostat-map/blob/master/examples/prop-circles.html))
64
- - [Causes of death with proportional pie charts](https://eurostat.github.io/eurostat-map/examples/prop-piecharts.html) (see [the code](https://github.com/eurostat/eurostat-map/blob/master/examples/prop-piecharts.html))
65
- - [Population change ](https://eurostat.github.io/eurostat-map/examples/population-change.html) (see [the code](https://github.com/eurostat/eurostat-map/blob/master/examples/population-change.html))
66
- - [NUTS typology as a categorical map](https://eurostat.github.io/eurostat-map/examples/categorical.html) (see [the code](https://github.com/eurostat/eurostat-map/blob/master/examples/categorical.html))
67
- - [Focus on Spain](https://eurostat.github.io/eurostat-map/examples/spain.html) (see [the code](https://github.com/eurostat/eurostat-map/blob/master/examples/spain.html))
68
- - [20 years of GDP change in Europe](https://eurostat.github.io/eurostat-map/examples/small_multiple.html) (see [the code](https://github.com/eurostat/eurostat-map/blob/master/examples/small_multiple.html))
69
- - [Unemployment/population relation](https://eurostat.github.io/eurostat-map/examples/pop-unemploy-bivariate.html) (see [the code](https://github.com/eurostat/eurostat-map/blob/master/examples/pop-unemploy-bivariate.html))
70
- - [Farm sizes composition](https://eurostat.github.io/eurostat-map/examples/farm_size.html) (see [the code](https://github.com/eurostat/eurostat-map/blob/master/examples/farm_size.html))
71
- - [Livestock composition](https://eurostat.github.io/eurostat-map/examples/livestock_composition.html) (see [the code](https://github.com/eurostat/eurostat-map/blob/master/examples/livestock_composition.html))
72
- - [Sparklines: Population in Europe since 2012](https://eurostat.github.io/eurostat-map/examples/sparklines.html) (see [the code](https://github.com/eurostat/eurostat-map/blob/master/examples/sparklines.html))
73
- - [World map](https://eurostat.github.io/eurostat-map/examples/world.html) (see [the code](https://github.com/eurostat/eurostat-map/blob/master/examples/world.html))
74
- - [Flow map](https://eurostat.github.io/eurostat-map/examples/flowmap.html) (see [the code](https://github.com/eurostat/eurostat-map/blob/master/examples/flowmap.html))
75
-
76
- ## Installation
77
-
78
- ### Node.js
79
-
80
- ```npm
70
+ ```bash
81
71
  npm install eurostat-map
82
72
  ```
83
73
 
84
- then
85
-
86
74
  ```javascript
87
- import eurostatmap from 'eurostatmap'
75
+ import eurostatmap from 'eurostat-map'
88
76
  ```
89
77
 
90
78
  or
91
79
 
92
80
  ```javascript
93
- eurostatmap = require('eurostatmap')
81
+ const eurostatmap = require('eurostat-map')
94
82
  ```
95
83
 
96
- ### Standalone
97
-
98
- For the latest version, use:
84
+ or
99
85
 
100
86
  ```html
101
87
  <script src="https://unpkg.com/eurostat-map"></script>
102
88
  ```
103
89
 
104
- For a fixed version, use:
90
+ then
105
91
 
106
- ```html
107
- <script src="https://unpkg.com/eurostat-map@X.Y.Z"></script>
92
+ ```javascript
93
+ eurostatmap
94
+ .map('choropleth')
95
+ .title('Population density in Europe')
96
+ .stat({ eurostatDatasetCode: 'demo_r_d3dens', unitText: 'people/km²' })
97
+ .legend({ x: 500, y: 180, title: 'Density, people/km²' })
98
+ .build()
108
99
  ```
109
100
 
110
- where X.Y.Z is a [version number](https://www.npmjs.com/package/eurostat-map?activeTab=versions).
101
+ Want a guided setup? Try the notebook:
102
+ https://observablehq.com/@joewdavies/eurostat-map-js
111
103
 
112
104
  ## Documentation
113
105
 
114
- For detailed documentation see the **[API reference page](docs/reference.md)**.
115
-
116
- Code examples:
106
+ For detailed documentation on what eurostat-map can do, see the **[documentation page](docs/reference.md)**.
117
107
 
118
- - [Choropleth map](docs/reference.md#choropleth-map).
119
- - [Proportional symbol map](docs/reference.md#proportional-symbol-map).
120
- - [Pie chart map](docs/reference.md#proportional-pie-chart-map).
121
- - [Categorical map](docs/reference.md#categorical-map).
122
- - [Bivariate choropleth map](docs/reference.md#bivariate-choropleth-map).
123
- - [Stripe composition map](docs/reference.md#stripe-composition-map).
124
- - [Sparkline map](docs/reference.md#sparkline-map).
125
- - [Flow map](docs/reference.md#flow-map).
126
- - [Ternary choropleth](docs/reference.md#trivariate-choropleth-map).
127
- - [Coxcomb map](docs/reference.md#coxcomb-map).
128
- - [Mushroom map](docs/reference.md#mushroom-map).
129
- - [Waffle map](docs/reference.md#waffle-map).
130
- - [Cartograms](docs/reference.md#cartograms).
108
+ For generated, signature-accurate API docs from TypeScript/JSDoc, see [the API docs](https://eurostat.github.io/eurostat-map/docs/api/index.html).
131
109
 
132
110
  Anything unclear or missing? Feel free to [ask](https://github.com/eurostat/eurostat.js/issues/new)!
133
111
 
134
- ## Technical details
135
-
136
- 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/).
137
-
138
112
  ## About
139
113
 
114
+ 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.
115
+
140
116
  | | |
141
117
  | -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
142
118
  | _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) |
@@ -1,3 +1,3 @@
1
- /*! /*! eurostat-map v4.4.0 | 2026 Eurostat | EUPL License. See https://github.com/eurostat/eurostat-map/blob/master/LICENSE * / */
1
+ /*! /*! eurostat-map v4.4.1 | 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