Skip to content

Instantly share code, notes, and snippets.

@jgaffuri
Last active January 9, 2020 20:52
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jgaffuri/cf5f187bd195f9c8771a1a3a4898079a to your computer and use it in GitHub Desktop.
Save jgaffuri/cf5f187bd195f9c8771a1a3a4898079a to your computer and use it in GitHub Desktop.
Proportional symbol map
license: EUPL-1.1
height: 780
scrolling: no
border: no
<script src="https://d3js.org/d3.v4.min.js"></script>
<script src="https://d3js.org/d3-queue.v3.min.js"></script>
<script src="https://d3js.org/topojson.v1.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3-legend/2.25.6/d3-legend.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/jsonstat@0.13.3/json-stat.js"></script>
<script src="https://cdn.jsdelivr.net/gh/eurostat/eurostat.js@0.9.15/js/eurostat-lib.js"></script>
<script src="https://cdn.jsdelivr.net/gh/eurostat/eurostat.js@0.9.15/js/eurostat-map.js"></script>
<script src="https://cdn.jsdelivr.net/gh/eurostat/eurostat.js@0.9.15/js/eurostat-tooltip.js"></script>
<svg id="map"></svg>
<script>
//load parameters from URL
var opts = EstLib.getURLParameters();
//make map
EstLib.map()
.width(900)
.datasetCode("demo_r_pjangrp3")
.filters({ age : "TOTAL", sex : "T", unit : "NR", time : opts.time || 2016 })
.type("ps")
.psMaxSize(25)
.psStrokeWidth(0.3)
.unitText("inhabitants")
.tooltipShowFlags("long")
.legendTitleText("Population")
.legendLabelDecNb(0)
.legendBoxHeight(200)
.legendBoxWidth(140)
.set(opts)
.build();
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment