eurostat-map 3.6.132 → 4.0.0

Sign up to get free protection for your applications and to get access to all the features.
package/README.md CHANGED
@@ -1,87 +1,113 @@
1
- # eurostat-map.js
1
+ # [eurostat-map](https://github.com/eurostat/eurostat-map)
2
2
 
3
- ![npm bundle size](https://img.shields.io/bundlephobia/min/eurostat-map)
3
+ ![npm bundle size](https://img.shields.io/bundlephobia/min/eurostat-map)
4
4
  ![npm](https://img.shields.io/npm/v/eurostat-map)
5
- [![Build Status](https://travis-ci.org/eurostat/eurostat-map.js.svg?branch=master)](https://travis-ci.org/eurostat/eurostat-map.js)
6
5
  ![license](https://img.shields.io/badge/license-EUPL-success)
7
6
 
8
- Quickly create and customise thematic web maps based on [NUTS regions](https://ec.europa.eu/eurostat/web/nuts/background), showing [Eurostat](https://ec.europa.eu/eurostat) data directly retrieved from the [Eurostat database](https://ec.europa.eu/eurostat/data/database).
7
+ Eurostat-map.js allows developers to quickly create and customise thematic web maps based on [NUTS regions](https://ec.europa.eu/eurostat/web/nuts/background), showing [Eurostat](https://ec.europa.eu/eurostat) data directly retrieved from the [Eurostat database](https://ec.europa.eu/eurostat/data/database), or custom data added manually.
9
8
 
10
9
  <div>
11
- <a href="https://eurostat.github.io/eurostat-map.js/examples/population-density.html" target="_blank"> <img src="https://raw.githubusercontent.com/eurostat/eurostat-map.js/master/docs/img/previews/ch.png" alt="choropleth" width="400"/> </a>
12
- <a href="https://eurostat.github.io/eurostat-map.js/examples/prop-circles.html" target="_blank"> <img src="https://raw.githubusercontent.com/eurostat/eurostat-map.js/master/docs/img/previews/prop.png" alt="proportional circles" width="400"/></a>
13
- <a href="https://eurostat.github.io/eurostat-map.js/examples/prop-symbols.html" target="_blank"> <img src="https://raw.githubusercontent.com/eurostat/eurostat-map.js/master/docs/img/previews/euro.png" alt="proportional symbols" width="400"/></a>
14
- <a href="https://eurostat.github.io/eurostat-map.js/examples/prop-piecharts.html" target="_blank"> <img src="https://raw.githubusercontent.com/eurostat/eurostat-map.js/master/docs/img/previews/pie.png" alt="pie charts" width="400"/></a>
15
- <a href="https://eurostat.github.io/eurostat-map.js/examples/livestock_composition.html" target="_blank"> <img src="https://raw.githubusercontent.com/eurostat/eurostat-map.js/master/docs/img/previews/stripe.png" alt="stripes" width="400"/></a>
16
- <a href="https://eurostat.github.io/eurostat-map.js/examples/pop-unemploy-bivariate.html" target="_blank"> <img src="https://raw.githubusercontent.com/eurostat/eurostat-map.js/master/docs/img/previews/bivar.png" alt="bivariate choropleth" width="400"/></a>
17
- <a href="https://eurostat.github.io/eurostat-map.js/examples/categorical.html" target="_blank"> <img src="https://raw.githubusercontent.com/eurostat/eurostat-map.js/master/docs/img/previews/cat.png" alt="categorical" width="400"/></a>
18
- <a href="https://eurostat.github.io/eurostat-map.js/examples/population-dot-density.html" target="_blank"> <img src="https://raw.githubusercontent.com/eurostat/eurostat-map.js/master/docs/img/previews/dot.png" alt="dot density" width="400"/></a>
19
- <a href="https://eurostat.github.io/eurostat-map.js/examples/world.html" target="_blank"> <img src="https://raw.githubusercontent.com/eurostat/eurostat-map.js/master/docs/img/previews/world.png" alt="dot density" width="400" height="70px"/></a>
20
- <a href="https://eurostat.github.io/eurostat-map.js/examples/sparklines.html" target="_blank"> <img src="https://raw.githubusercontent.com/eurostat/eurostat-map.js/master/docs/img/previews/sparkline.png" alt="dot density" width="400" height="70px"/></a>
10
+ <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/previews/ch.png" alt="choropleth" width="400"/> </a>
11
+ <a href="https://eurostat.github.io/eurostat-map/examples/prop-circles.html" target="_blank"> <img src="https://raw.githubusercontent.com/eurostat/eurostat-map/master/docs/img/previews/prop.png" alt="proportional circles" width="400"/></a>
12
+ <a href="https://eurostat.github.io/eurostat-map/examples/prop-symbols.html" target="_blank"> <img src="https://raw.githubusercontent.com/eurostat/eurostat-map/master/docs/img/previews/euro.png" alt="proportional symbols" width="400"/></a>
13
+ <a href="https://eurostat.github.io/eurostat-map/examples/prop-piecharts.html" target="_blank"> <img src="https://raw.githubusercontent.com/eurostat/eurostat-map/master/docs/img/previews/pie.png" alt="pie charts" width="400"/></a>
14
+ <a href="https://eurostat.github.io/eurostat-map/examples/livestock_composition.html" target="_blank"> <img src="https://raw.githubusercontent.com/eurostat/eurostat-map/master/docs/img/previews/stripe.png" alt="stripes" width="400"/></a>
15
+ <a href="https://eurostat.github.io/eurostat-map/examples/pop-unemploy-bivariate.html" target="_blank"> <img src="https://raw.githubusercontent.com/eurostat/eurostat-map/master/docs/img/previews/bivar.png" alt="bivariate choropleth" width="400"/></a>
16
+ <a href="https://eurostat.github.io/eurostat-map/examples/categorical.html" target="_blank"> <img src="https://raw.githubusercontent.com/eurostat/eurostat-map/master/docs/img/previews/cat.png" alt="categorical" width="400"/></a>
17
+ <a href="https://eurostat.github.io/eurostat-map/examples/population-dot-density.html" target="_blank"> <img src="https://raw.githubusercontent.com/eurostat/eurostat-map/master/docs/img/previews/dot.png" alt="dot density" width="400"/></a>
18
+ <a href="https://eurostat.github.io/eurostat-map/examples/world.html" target="_blank"> <img src="https://raw.githubusercontent.com/eurostat/eurostat-map/master/docs/img/previews/world.png" alt="dot density" width="400" height="70px"/></a>
19
+ <a href="https://eurostat.github.io/eurostat-map/examples/sparklines.html" target="_blank"> <img src="https://raw.githubusercontent.com/eurostat/eurostat-map/master/docs/img/previews/sparkline.png" alt="dot density" width="400" height="70px"/></a>
21
20
  </div>
22
21
 
23
22
  ## Examples
24
23
 
25
- - [Population density](https://eurostat.github.io/eurostat-map.js/examples/population-density.html) (see [the code](https://github.com/eurostat/eurostat-map.js/blob/master/examples/population-density.html))
26
- - [Population density map with dot pattern](https://eurostat.github.io/eurostat-map.js/examples/population-dot-density.html) (see [the code](https://github.com/eurostat/eurostat-map.js/blob/master/examples/population-dot-density.html))
27
- - [Population map with proportional circles](https://eurostat.github.io/eurostat-map.js/examples/prop-circles.html) (see [the code](https://github.com/eurostat/eurostat-map.js/blob/master/examples/prop-circles.html))
28
- - [GDP map with custom proportional symbols](https://eurostat.github.io/eurostat-map.js/examples/prop-symbols.html) (see [the code](https://github.com/eurostat/eurostat-map.js/blob/master/examples/prop-symbols.html))
29
- - [Causes of death with proportional pie charts](https://eurostat.github.io/eurostat-map.js/examples/prop-piecharts.html) (see [the code](https://github.com/eurostat/eurostat-map.js/blob/master/examples/prop-piecharts.html))
30
- - [Population change ](https://eurostat.github.io/eurostat-map.js/examples/population-change.html) (see [the code](https://github.com/eurostat/eurostat-map.js/blob/master/examples/population-change.html))
31
- - [NUTS typology as a categorical map](https://eurostat.github.io/eurostat-map.js/examples/categorical.html) (see [the code](https://github.com/eurostat/eurostat-map.js/blob/master/examples/categorical.html))
32
- - [Focus on Spain](https://eurostat.github.io/eurostat-map.js/examples/spain.html) (see [the code](https://github.com/eurostat/eurostat-map.js/blob/master/examples/spain.html))
33
- - [20 years of GDP change in Europe](https://eurostat.github.io/eurostat-map.js/examples/small_multiple.html) (see [the code](https://github.com/eurostat/eurostat-map.js/blob/master/examples/small_multiple.html))
34
- - [Unemployment/population relation](https://eurostat.github.io/eurostat-map.js/examples/pop-unemploy-bivariate.html) (see [the code](https://github.com/eurostat/eurostat-map.js/blob/master/examples/pop-unemploy-bivariate.html))
35
- - [Farm sizes composition](https://eurostat.github.io/eurostat-map.js/examples/farm_size.html) (see [the code](https://github.com/eurostat/eurostat-map.js/blob/master/examples/farm_size.html))
36
- - [Livestock composition](https://eurostat.github.io/eurostat-map.js/examples/livestock_composition.html) (see [the code](https://github.com/eurostat/eurostat-map.js/blob/master/examples/livestock_composition.html))
37
- - [Sparklines: Population in Europe since 2012](https://eurostat.github.io/eurostat-map.js/examples/sparklines.html) (see [the code](https://github.com/eurostat/eurostat-map.js/blob/master/examples/sparklines.html))
38
- - [World map](https://eurostat.github.io/eurostat-map.js/examples/world.html) (see [the code](https://github.com/eurostat/eurostat-map.js/blob/master/examples/world.html))
39
-
24
+ You can build an interactive statistical map with just a few lines of code:
25
+
26
+ ```javascript
27
+ eurostatmap
28
+ .map('choropleth')
29
+ .title('Population density in Europe')
30
+ .stat({ eurostatDatasetCode: 'demo_r_d3dens', unitText: 'people/km²' })
31
+ .legend({ x: 500, y: 180, title: 'Density, people/km²' })
32
+ .build()
33
+ ```
34
+
35
+ - [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))
36
+ - [Population density map with dot pattern](https://eurostat.github.io/eurostat-map/examples/population-dot-density.html) (see [the code](https://github.com/eurostat/eurostat-map/blob/master/examples/population-dot-density.html))
37
+ - [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))
38
+ - [GDP map with custom proportional symbols](https://eurostat.github.io/eurostat-map/examples/prop-symbols.html) (see [the code](https://github.com/eurostat/eurostat-map/blob/master/examples/prop-symbols.html))
39
+ - [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))
40
+ - [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))
41
+ - [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))
42
+ - [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))
43
+ - [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))
44
+ - [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))
45
+ - [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))
46
+ - [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))
47
+ - [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))
48
+ - [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))
40
49
 
41
50
  ## Installation
42
51
 
43
- - **Node.js**: With ``npm install eurostatmap`` and then ``eurostatmap = require("eurostatmap")``.
44
- - **Standalone**: For the latest version, use ``<script src="https://unpkg.com/eurostat-map"></script>`` as shown in [the examples](#examples). For a fixed version, use ``<script src="https://unpkg.com/eurostat-map@X.Y.Z"></script>``, where *X.Y.Z* is a version number among [these ones](https://www.npmjs.com/package/eurostat-map?activeTab=versions).
52
+ ### Node.js
53
+
54
+ `npm install eurostatmap`
55
+
56
+ then
57
+
58
+ ```javascript
59
+ import eurostatmap from 'eurostatmap'
60
+ ```
45
61
 
62
+ or
63
+
64
+ ```javascript
65
+ eurostatmap = require('eurostatmap')
66
+ ```
67
+
68
+ ### Standalone
69
+
70
+ - For the latest version, use `<script src="https://unpkg.com/eurostat-map"></script>` as shown in [the examples](#examples).
71
+ - For a fixed version, use `<script src="https://unpkg.com/eurostat-map@X.Y.Z"></script>`, where _X.Y.Z_ is a [version number](https://www.npmjs.com/package/eurostat-map?activeTab=versions).
46
72
 
47
73
  ## Documentation
48
74
 
49
- See the **[API reference](docs/reference.md)**:
50
- - For a [choropleth map](docs/reference.md#choropleth-map),
51
- - For a [proportional symbol map](docs/reference.md#proportional-symbol-map),
52
- - For a [proportional pie chart map](docs/reference.md#proportional-pie-chart-map),
53
- - For a [categorical map](docs/reference.md#categorical-map).
54
- - For a [bivariate choropleth map](docs/reference.md#bivariate-choropleth-map).
55
- - For a [stripe composition map](docs/reference.md#stripe-composition-map).
56
- - For a [sparkline map](docs/reference.md#sparkline-map).
75
+ For a quick tutorial check out this notebook:
76
+ https://observablehq.com/@joewdavies/eurostat-map-js
57
77
 
58
- Anything unclear or missing? Feel free to [ask](https://github.com/eurostat/eurostat.js/issues/new) !
78
+ Or see the **[API reference](docs/reference.md)**:
59
79
 
80
+ - For a [choropleth map](docs/reference.md#choropleth-map),
81
+ - For a [proportional symbol map](docs/reference.md#proportional-symbol-map),
82
+ - For a [proportional pie chart map](docs/reference.md#proportional-pie-chart-map),
83
+ - For a [categorical map](docs/reference.md#categorical-map).
84
+ - For a [bivariate choropleth map](docs/reference.md#bivariate-choropleth-map).
85
+ - For a [stripe composition map](docs/reference.md#stripe-composition-map).
86
+ - For a [sparkline map](docs/reference.md#sparkline-map).
60
87
 
61
- ## Technical details
88
+ Anything unclear or missing? Feel free to [ask](https://github.com/eurostat/eurostat.js/issues/new) !
62
89
 
63
- 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 REST webservice](http://ec.europa.eu/eurostat/web/json-and-unicode-web-services/getting-started/rest-request) for [JSON-stat](https://json-stat.org/) data. The data are decoded and queried using [JSON-stat library](https://json-stat.com/). Maps are rendered as SVG maps using [D3.js library](https://d3js.org/).
90
+ ## Technical details
64
91
 
92
+ 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/). Maps are rendered as SVG maps using [D3.js library](https://d3js.org/).
65
93
 
66
94
  ## About
67
95
 
68
- | | |
69
- | ------ | -------- |
70
- | *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) |
71
- | *version* | See [npm](https://www.npmjs.com/package/eurostat-map?activeTab=versions) |
72
- | *status* | Since 2018 |
73
- | *license* | [EUPL 1.2](https://github.com/eurostat/Nuts2json/blob/master/LICENSE) |
74
-
96
+ | | |
97
+ | -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
98
+ | _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) |
99
+ | _version_ | See [npm](https://www.npmjs.com/package/eurostat-map?activeTab=versions) |
100
+ | _status_ | Since 2018 |
101
+ | _license_ | [EUPL 1.2](https://github.com/eurostat/Nuts2json/blob/master/LICENSE) |
75
102
 
76
103
  ## Support and contribution
77
104
 
78
105
  Feel free to [ask support](https://github.com/eurostat/eurostat.js/issues/new), fork the project or simply star it (it's always a pleasure).
79
106
 
80
-
81
107
  ## Copyright
82
108
 
83
109
  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/reference-data/administrative-units-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](http://ec.europa.eu/eurostat/web/gisco/geodata/reference-data/administrative-units-statistical-units/nuts) for more information.
84
110
 
85
-
86
111
  ## Disclaimer
112
+
87
113
  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.