Code Monkey home page Code Monkey logo

eurostat-map.js's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

eurostat-map.js's Issues

List of inspiration sources for new map types

Add possibility to show shadowed effect for the countries AND buffered lines as on this image:
https://previews.123rf.com/images/schwabenblitz/schwabenblitz1606/schwabenblitz160601040/58074061-map-of-denmark-with-the-provinces-south-denmark-is-highlighted-by-a-hatching-.jpg

Show temporal data using:
https://github.com/tomshanley/d3-spiral-heatmap

As an alternative to pie charts, use other types of shapes do show decomposition (radial pie charts, squares (flag like), etc.). See some examples here, in some images at the bottom:
https://observablehq.com/@tomshanley/cheysson-color-palettes

Make compositions possible?

  • compositions chroploth + prop circle
  • composition choropleth map showing variation (diverging colors) + rectangle/bar showing quantities +/-

Several statistics maps

In order to be able to make maps based on several statistics, it is necessary to make it possible to load not only one but several statistical sources.

Examples of such maps:

Programmatic definition of statistical data

Make it possible to define cartographic figures directly in javascript code like that:

map.setStat(
{
  LU01: 3534.345,
  DE02: 45.453,
  LV45: 6454.3534,
...
});

Rely on out._statDataIndex; attribute.

Add map insets

Based on what has been recently added to Nuts2json API.

.psStrokeWidth not working

Proportional circle map stroke width setter only changes stroke width of legend circles:

.psStrokeWidth(0.1)

Zoom effect on stroke-width

When using the zoom, the "stroke-width" styles should be changed according to the real value specified by the user. Currently, the zoom sets the width to 1px, whatever the zoom level.

Free color ramps

Currently, color ramps for choropleth maps are based on color-brewer/d3-chromatic lib.
The possibility should be given to use any kind of user defined color ramp, such as the Eurostat color ramps (already defined in eurostat-map.js).

Do not show countries

  • include a new geometry in nuts2json for the land mass.
  • show this new geometry as a background, above the sea rectangle and below the nuts/cntr geometries.
  • add option to show/hide country geometries
  • add option for the fill style of this land mass geometry.

Note that this land mass geometry is required for the value-by-alpha map. Otherwise, when changing the regions opacity, the blue of the sea will appear...

The land mass polygon could be used to make coastal margin: https://observablehq.com/@jgaffuri/coastal-margin-with-css-stroke-width

Show map data source

Currently, the source of the map information is not shown on the examples.
For maps based on eurostat data, we should have something like: "Source, Eurostat XXX" where XXX is the eurostat database code, with a link to the corresponding page on Eurostat website.
Example: https://ec.europa.eu/eurostat/databrowser/view/road_eqs_busmot_h/ for database with code road_eqs_busmot_h.

This could information be shown as part of the legend box, the bottom text (currently used for the copyright) or another map component ? Maybe another map component at the bottom right corner, or under the insets, is the most suitable.

Add new map types: Bivariate choropleth

Document and comment

  • Comment the code
  • Keep documentation (README.md) progressively synchronised with latest developments, as much as possible
  • Keep examples progressively synchronised with latest developments, as much as possible

New example map for prop symbols

Currently on the website, we have only one example map showing prop symb as circles. It would be nice to add a new one with another type of symbol. With another variable than population (as soon as it is a quantity!).
This task should include the addition of a 250*250 thumbnail of the new map on the pages.

proportional symbols - make other symbols possible, not only circles

  1. The "transform" attribute should be used to scale and move the group symbol instead of current circle radius.
  2. Propose list of predefined symbols (circle, square, etc. see https://github.com/d3/d3-shape#symbols) and maybe user defined ones (as SVG paths)
  3. Beside proportionnal symbols, vertical bars could also be proposed. In that case, the scaling of the symbol would occur only along the vertical dimension. Example: https://4.bp.blogspot.com/-IbwkPe0Cd7o/Tv74ukFKxbI/AAAAAAAAALw/hDwLkziybiw/s1600/barMap.png

Add geographical names

The map template could be enhanced by adding few geographical names such as ocean names or country names for large maps.

See for example how it could look like on country names: https://www.nytimes.com/interactive/2020/10/22/world/europe/europe-hospitals-covid.html
https://www.mapsofworld.com/europe/maps/political-map-of-europe.jpg

Some useful resources:
https://css-tricks.com/snippets/svg/curved-text-along-path/
https://vanseodesign.com/web-design/svg-text-on-a-path-part-1/
Suitable cartographic fonts could be used: https://www.typography.com/fonts/styles/cartography

Export map. As a SVG file.

For users willing to further customise their map, a possibility to export the map as a SVG file to be edited with (for example) inkscape, should be provided.
In oder to make these SVG files thiner, it might be needed to round the coordinates first, with d3.round function.

Continuous color ramps for choropleth maps

Currently, only discrete classifications are available for choropleth maps.
Continuous color ramps, with different scaling functions (linear, logarithmic, exponential, etc.) should be proposed.

Make application with interactivity

Use GUI components to allow users to change map parameters (Converging toward a new IMAGE ?).
Or make SVG elements (map title, etc.) editable (example: click on a text element to edit it)

  • Time slider
  • Selection of databases.

Add new map type: Composition stripes map

This map shows the composition of something using striped texture. Each stripe represent a category. Different colors are used to differenciate the different categories. The width of each stripe is proportionnal to the share of the category in the total. The total width of the stripes for all categories is the same for all regions (equal to 100%). For each region, the stripe sequence is repeated periodically accross the region geometry.

Example:
See image, top row, second from the right: https://philogb.github.io/blog/assets/france/bertin.png

Use that to show:

  • Population by age group
  • Livestock composition by animal
  • GDP by NACE type
  • Mortality by cause of death
  • Household consumption by COICOP
  • Governement expenditure by COFOG
  • etc.

Define map styles with CSS

Currently, map styles are defined in javascript with .style(...) functions.
It could be interesting to see if some styling parameters could be defined with CSS instead.
Check if CSS overrides the SVG styling.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.