eurostat-map 4.4.5 → 4.5.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/README.md +33 -4
- package/build/215.eurostatmap.min.js +1 -1
- package/build/215.eurostatmap.min.js.map +1 -1
- package/build/eurostatmap.js +19801 -16163
- 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/GridCartogramSettings.d.ts +33 -0
- package/build/types/core/MapConfig.d.ts +13 -2
- package/build/types/core/MapInstance.d.ts +80 -4
- package/build/types/core/encoding/EncodingConfig.d.ts +31 -0
- package/build/types/core/layer/Layer.d.ts +31 -0
- package/build/types/core/layer/LayerConfig.d.ts +19 -0
- package/build/types/core/layer/LayerRole.d.ts +1 -0
- package/build/types/core/locations.d.ts +44 -16
- package/build/types/core/stat/StatConfig.d.ts +7 -0
- package/build/types/index.d.ts +38 -33
- package/build/types/layers/CategoricalMap.d.ts +21 -0
- package/build/types/layers/CategoricalMapConfig.d.ts +11 -0
- package/build/types/layers/MapType.d.ts +34 -0
- package/build/types/layers/choropleth/BivariateChoroplethConfig.d.ts +27 -0
- package/build/types/layers/choropleth/BivariateChoroplethMap.d.ts +39 -0
- package/build/types/layers/choropleth/ChoroplethConfig.d.ts +39 -0
- package/build/types/layers/choropleth/ChoroplethMap.d.ts +48 -0
- package/build/types/layers/choropleth/TrivariateChoroplethConfig.d.ts +41 -0
- package/build/types/layers/choropleth/TrivariateChoroplethMap.d.ts +18 -0
- package/build/types/layers/choropleth/ValueByAlphaConfig.d.ts +8 -0
- package/build/types/layers/choropleth/ValueByAlphaMap.d.ts +9 -0
- package/build/types/layers/composition/CompositionStatConfig.d.ts +59 -0
- package/build/types/layers/composition/bar/BarMap.d.ts +97 -0
- package/build/types/layers/composition/bar/BarMapConfig.d.ts +76 -0
- package/build/types/layers/composition/coxcomb/CoxcombMap.d.ts +75 -0
- package/build/types/layers/composition/coxcomb/CoxcombMapConfig.d.ts +47 -0
- package/build/types/layers/composition/coxcomb/CoxcombStatConfig.d.ts +13 -0
- package/build/types/layers/composition/pie/PieMap.d.ts +84 -0
- package/build/types/layers/composition/pie/PieMapConfig.d.ts +50 -0
- package/build/types/layers/composition/stripe/StripeMap.d.ts +80 -0
- package/build/types/layers/composition/stripe/StripeMapConfig.d.ts +45 -0
- package/build/types/layers/composition/waffle/WaffleMap.d.ts +124 -0
- package/build/types/layers/composition/waffle/WaffleMapConfig.d.ts +58 -0
- package/build/types/layers/flow/FlowMap.d.ts +218 -0
- package/build/types/layers/flow/FlowMapConfig.d.ts +220 -0
- package/build/types/layers/proportional-symbol/ProportionalSymbolConfig.d.ts +47 -0
- package/build/types/layers/proportional-symbol/ProportionalSymbolMap.d.ts +94 -0
- package/build/types/layers/proportional-symbol/mushroom/MushroomMap.d.ts +67 -0
- package/build/types/layers/proportional-symbol/mushroom/MushroomMapConfig.d.ts +39 -0
- package/build/types/layers/spark/SparkMap.d.ts +56 -0
- package/build/types/layers/spark/SparkMapConfig.d.ts +75 -0
- package/build/types/layers/spark/SparkStatConfig.d.ts +33 -0
- package/build/types/legend/LegendConfig.d.ts +3 -0
- package/build/types/legend/choropleth/BivariateLegendConfig.d.ts +79 -0
- package/build/types/legend/choropleth/legend-choropleth-bivariate.d.ts +2 -2
- package/build/types/legend/choropleth/legend-choropleth-trivariate.d.ts +2 -2
- package/build/types/legend/choropleth/legend-choropleth.d.ts +2 -2
- package/build/types/legend/composition/legend-bar-chart.d.ts +2 -2
- package/build/types/legend/flow/legend-flow.d.ts +2 -2
- package/build/types/legend/legend-categorical.d.ts +2 -2
- package/build/types/legend/legend-continuous.d.ts +2 -2
- package/build/types/legend/legend-discrete.d.ts +2 -2
- package/build/types/legend/legend.d.ts +13 -13
- package/build/types/legend/proportional-symbol/legend-proportional-symbols.d.ts +2 -2
- package/build/types/map-types/CategoricalMapConfig.d.ts +11 -11
- package/build/types/map-types/choropleth/map-choropleth-bivariate.d.ts +4 -4
- package/build/types/map-types/choropleth/map-choropleth-trivariate.d.ts +4 -4
- package/build/types/map-types/choropleth/map-value-by-alpha.d.ts +4 -4
- package/build/types/map-types/composition/CompositionStatConfig.d.ts +7 -0
- package/build/types/map-types/composition/bar/BarMap.d.ts +97 -79
- package/build/types/map-types/composition/bar/BarMapConfig.d.ts +76 -54
- package/build/types/map-types/composition/coxcomb/CoxcombMap.d.ts +29 -0
- package/build/types/map-types/composition/coxcomb/CoxcombMapConfig.d.ts +15 -0
- package/build/types/map-types/composition/map-spark.d.ts +5 -5
- package/build/types/map-types/composition/map-stripe.d.ts +5 -5
- package/build/types/map-types/composition/pie/PieMap.d.ts +1 -5
- package/build/types/map-types/composition/stripe/StripeMap.d.ts +19 -2
- package/build/types/map-types/composition/stripe/StripeMapConfig.d.ts +11 -0
- package/build/types/map-types/composition/waffle/WaffleMap.d.ts +1 -0
- package/build/types/map-types/flow/FlowMap.d.ts +121 -0
- package/build/types/map-types/flow/FlowMapConfig.d.ts +62 -0
- package/build/types/map-types/flow/map-flow.d.ts +5 -5
- package/build/types/map-types/proportional-symbol/ProportionalSymbolConfig.d.ts +30 -0
- package/build/types/map-types/proportional-symbol/ProportionalSymbolMap.d.ts +4 -0
- package/build/types/map-types/proportional-symbol/mushroom/MushroomMap.d.ts +37 -0
- package/build/types/map-types/proportional-symbol/mushroom/MushroomMapConfig.d.ts +19 -0
- package/build/types/map-types/spark/SparkMap.d.ts +4 -0
- package/build/types/map-types/spark/SparkMapConfig.d.ts +32 -0
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
<table>
|
|
39
39
|
<tr>
|
|
40
40
|
<td><a href="https://eurostat.github.io/eurostat-map/examples/choropleth/population-density.html" target="_blank"><img src="examples/img/previews/choropleth/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/proportional/prop-circles.png" alt="Proportional circles example" /></a></td>
|
|
41
|
+
<td><a href="https://eurostat.github.io/eurostat-map/examples/proportional-symbols/prop-circles.html" target="_blank"><img src="examples/img/previews/proportional/prop-circles.png" alt="Proportional circles example" /></a></td>
|
|
42
42
|
<td><a href="https://eurostat.github.io/eurostat-map/examples/flow/flowmap.html" target="_blank"><img src="examples/img/previews/flow/flowmap.png" alt="Flow map example" /></a></td>
|
|
43
43
|
<td><a href="https://eurostat.github.io/eurostat-map/examples/mushroom/mushroom.html" target="_blank"><img src="examples/img/previews/mushroom/mushroom.png" alt="Mushroom map example" /></a></td>
|
|
44
44
|
</tr>
|
|
@@ -91,14 +91,43 @@ or
|
|
|
91
91
|
then
|
|
92
92
|
|
|
93
93
|
```javascript
|
|
94
|
-
eurostatmap
|
|
94
|
+
const map = eurostatmap
|
|
95
95
|
.map('choropleth')
|
|
96
96
|
.title('Population density in Europe')
|
|
97
|
-
|
|
98
|
-
.
|
|
97
|
+
// define statistical dataset
|
|
98
|
+
.stat('population-density', {
|
|
99
|
+
eurostatDatasetCode: 'demo_r_d3dens',
|
|
100
|
+
unitText: 'people/km²',
|
|
101
|
+
})
|
|
102
|
+
// encode dataset into visual variable(s)
|
|
103
|
+
.encoding('fill', { stat: 'population-density', scale: 'quantile', classes: 7 })
|
|
104
|
+
.legend({ position: 'top right', title: 'Density, people/km²' })
|
|
99
105
|
.build()
|
|
100
106
|
```
|
|
101
107
|
|
|
108
|
+
For multivariate maps, you can use data-driven visual variables like so:
|
|
109
|
+
|
|
110
|
+
```javascript
|
|
111
|
+
const map = eurostatmap
|
|
112
|
+
.map('proportionalSymbol')
|
|
113
|
+
.nutsLevel(1)
|
|
114
|
+
.stat('population', {
|
|
115
|
+
eurostatDatasetCode: 'demo_r_pjangrp3',
|
|
116
|
+
filters: { age: 'TOTAL', sex: 'T', unit: 'NR', time: '2023' },
|
|
117
|
+
unitText: 'inhabitants',
|
|
118
|
+
})
|
|
119
|
+
.stat('gdpPerCapita', {
|
|
120
|
+
eurostatDatasetCode: 'nama_10r_3gdp',
|
|
121
|
+
filters: { unit: 'EUR_HAB', time: '2023' },
|
|
122
|
+
unitText: 'EUR/inhabitant',
|
|
123
|
+
})
|
|
124
|
+
.encoding('size', { stat: 'population', scale: 'sqrt', range: [5, 30] })
|
|
125
|
+
.encoding('color', { stat: 'gdpPerCapita', scale: 'quantile', classes: 5 })
|
|
126
|
+
.build()
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
Legacy patterns such as `stat({...})` for single-dataset maps or channel-named datasets (`stat('size', ...)`, `stat('color', ...)`) remain supported for backward compatibility.
|
|
130
|
+
|
|
102
131
|
Want a guided setup? Try the notebook:
|
|
103
132
|
https://observablehq.com/@joewdavies/eurostat-map-js
|
|
104
133
|
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/*! /*! eurostat-map v4.
|
|
1
|
+
/*! /*! eurostat-map v4.5.0 | 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":""}
|