Skip to content

Instantly share code, notes, and snippets.

@jgaffuri
Last active January 9, 2020 20:53
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/6bff324484f404c3e09cc2408a3e5265 to your computer and use it in GitHub Desktop.
Save jgaffuri/6bff324484f404c3e09cc2408a3e5265 to your computer and use it in GitHub Desktop.
NUTS 3 urban-rural typology
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://d3js.org/d3-color.v1.min.js"></script>
<script src="https://d3js.org/d3-interpolate.v1.min.js"></script>
<script src="https://d3js.org/d3-scale-chromatic.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>
EstLib.map()
.scale("60M")
.width(900)
.NUTSyear(2013)
.nutsLvl(3).csvDataSource({url:"https://raw.githubusercontent.com/eurostat/eurostat.js/master/assets/data/urb_rur_typo.csv", geoCol:"NUTS_ID_2013", valueCol:"urban_rural"})
.type("ct")
.classToFillStyleCT( { urb: "#fdb462", int: "#ffffb3", rur: "#ccebc5" } )
.classToText( { "urb":"Urban", "int":"Intermediate", "rur":"Rural" } )
.legendLabelDecNb(0)
.legendBoxHeight(110)
.legendBoxWidth(130)
.build();
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment