SVG map Since 0.7.0
A simple map to show GeoJSON. It can have place labels and markers.
Usage
To use this component in a Nunjucks template you would add the following (assumes you've loaded OI Lume Viz into componentNamespace: 'oi'
):
{% comp 'oi.map.svg', { "config": config } %}{% endcomp %}
where config
is replaced by an object that contains some or all of these variables:
data
- (optional) Either a reference to a CSV file in the Lume site or an array of rows with named attributes. If used you will need to match this to the GeoJSON properties usingkey
.columns
- As with many of the visualisation types you can optionally add virtual columns.geojson
- (required):key
- The GeoJSON property to use to match with thedata
.data
- Either a reference to a GeoJSON file in the Lume site or inline GeoJSON.
colours
- Define some visualisation-specific named colours.width
- An optional minimum width (e.g.400px
) for each panel. Panels may then be arranged by however many columns will fit in the page width.projection
- Set the map projection:name
- One ofaitoff
,equirectangular
,gall-peters
,orthographic
(for orthographic you can also set thelat
/lon
for the projection centre),web-mercator
(default), orosgb
.
bounds
- Set a longitude/latitude bounds of the map:lat
- The latitude bounds:min
- The minimum latitudemax
- The maximum latitude
lon
- The longitude bounds:min
- The minimum longitudemax
- The maximum longitude
layers
- An array of map layers in the order they will be layered. Each layer has a propertytype
which can be one of:background
- Set a GeoJSON background:geojson
- Either a reference to a GeoJSON file in the Lume site or inline GeoJSONcolour
- The colour for the background polygons.
data
- Add the data layer to the map:key
- The title of the column to use to match IDs with the GeoJSON.value
- The title of the column that will be used to get the colour of a polygon. If the value is a number you should also set thescale
.tooltip
- Either a string, template string, or the column heading to use to build a tooltip.scale
- A colour scale to use to colour the polygons based on the value.min
- Used withscale
andmax
to define the colour scale.max
- Used withscale
andmin
to define the colour scale.
graticule
- Add a graticule:step
- An array defining the latitude and longitude spacing of the graticule in degrees.
labels
- Add a place label layer:places
- An array of place markers that sit above the interactive layer. A place can be defined with the following properties:name
- the label to use for the place labellatitude
- set the latitude of the label (can be omitted if it is a UK place we know about)longitude
- set the longitude of the label (can be omitted if it is a UK place we know about)text-anchor
- set to eitherstart
,middle
, orend
to anchor the textcolour
- the colour of the label (default is black)border
- the colour of the label border (default is white)font-size
- manually set the font size (if omitted it will be scaled to the population where known)font-weight
- manually set the font weight (e.g. to "bold")font-family
- manually set the font family
markers
- An array of markersmarkers
- A marker can be defined with the following properties:icon
- Can be either be a string (one ofdefault
,geo
,geo-alt
,asterisk
,pin
,balloon
,balloon-heart
,chat-square
) or an object with the form:svg
- The SVG string to usesize
- e.g.[40,40]
anchor
- e.g.[20,0]
latitude
- set the latitude of the markerlongitude
- set the longitude of the markercolour
- the colour of the label (default is black)tooltip
- the content of an optional tooltip
padding
- Set the padding between the data layer and the map edges. The value is given in the pixel scale of the generated map (which may not be the same as the pixels the map takes up on screen).legend
- Define the legend.options
- Set some options:fillOpacity
- The fill-opacity of the polygons
tools
- Add some useful interactive tools:filter
- A search tool to filter hexes:label
- The title of the column to use as the displayed name for a hex in the search results.max
- The maximum number of results to show.
slider
Since 0.16.2 - A slider tool that will change the colouring of the hexes:columns
- An array of column titles to use to change the colouring of the hexes.
attribution
- Add a line of attribution text under the visualisation.
Examples
- A basic map
- Colour a map - defined colours
- Colour a map - using a defined scale
- Set opacity of the data layer
- Add a legend
- Custom tooltips
- Place labels
- Map markers
- Add a background
- Set padding
- Add a graticule
- Set layer order
- Filter map
- Display a line
- Projection: Aitoff
- Projection: Equirectangular
- Projection: Gall-Peters
- Projection: Orthographic
- Projection: Orthographic zoomed
- Projection: Web-Mercator
- Projection: Web-Mercator zoomed
- Projection: OS Grid
1. A basic map§
The polygons are defined by the geojson→data
key which loads a GeoJSON file (you may want to put your GeoJSON through our GeoJSON Minify tool first).
The geojson→key
attribute is used to match a property in geojson→data→features[]→properties
with the key
attribute in the data
rows e.g. we try to match the code
attribute in the data (say "E08000016") with the LAD21CD
key in the GeoJSON. The value
key is the name of a column in the data
that defines the colour to use for the polygon. A tooltip
can also be specified as the name of a column in the data
.
This example was made with config
:
data:
- code: E08000016
name: Barnsley
- code: E08000032
name: Bradford
- code: E08000033
name: Calderdale
- code: E07000163
name: Craven
- code: E07000165
name: Harrogate
- code: E08000034
name: Kirklees
- code: E08000035
name: Leeds
- code: E07000169
name: Selby
- code: E08000036
name: Wakefield
- code: E06000014
name: York
geojson:
key: LAD21CD
data: geojson.leeds_city_region
key: code
tooltip: name
{
"data": [{
"code": "E08000016",
"name": "Barnsley"
},{
"code": "E08000032",
"name": "Bradford"
},{
"code": "E08000033",
"name": "Calderdale"
},{
"code": "E07000163",
"name": "Craven"
},{
"code": "E07000165",
"name": "Harrogate"
},{
"code": "E08000034",
"name": "Kirklees"
},{
"code": "E08000035",
"name": "Leeds"
},{
"code": "E07000169",
"name": "Selby"
},{
"code": "E08000036",
"name": "Wakefield"
},{
"code": "E06000014",
"name": "York"
}],
"geojson": {
"key": "LAD21CD",
"data": "geojson.leeds_city_region"
},
"key": "code",
"tooltip": "name"
}
2. Colour a map - defined colours§
This example is mostly the same as the previous one but we've added a colour
attribute to each item in data
and we set value
to that name so that each area gets a specific colour.
This example was made with config
:
data:
- code: E08000016
name: Barnsley
colour: '#E6007C'
- code: E08000032
name: Bradford
colour: '#FF6700'
- code: E08000033
name: Calderdale
colour: '#0DBC37'
- code: E07000163
name: Craven
colour: '#178CFF'
- code: E07000165
name: Harrogate
colour: '#2f529f'
- code: E08000034
name: Kirklees
colour: '#722EA5'
- code: E08000035
name: Leeds
colour: '#F9BC26'
- code: E07000169
name: Selby
colour: '#1DD3A7'
- code: E08000036
name: Wakefield
colour: '#EF3AAB'
- code: E06000014
name: York
colour: '#F92626'
geojson:
key: LAD21CD
data: geojson.leeds_city_region
key: code
tooltip: name
value: colour
{
"data": [{
"code": "E08000016",
"name": "Barnsley",
"colour": "#E6007C"
},{
"code": "E08000032",
"name": "Bradford",
"colour": "#FF6700"
},{
"code": "E08000033",
"name": "Calderdale",
"colour": "#0DBC37"
},{
"code": "E07000163",
"name": "Craven",
"colour": "#178CFF"
},{
"code": "E07000165",
"name": "Harrogate",
"colour": "#2f529f"
},{
"code": "E08000034",
"name": "Kirklees",
"colour": "#722EA5"
},{
"code": "E08000035",
"name": "Leeds",
"colour": "#F9BC26"
},{
"code": "E07000169",
"name": "Selby",
"colour": "#1DD3A7"
},{
"code": "E08000036",
"name": "Wakefield",
"colour": "#EF3AAB"
},{
"code": "E06000014",
"name": "York",
"colour": "#F92626"
}],
"geojson": {
"key": "LAD21CD",
"data": "geojson.leeds_city_region"
},
"key": "code",
"tooltip": "name",
"value": "colour"
}
3. Colour a map - using a defined scale§
In this example we'll use a numeric column (Aged 15 years and under
) in the data to set the value
to use along with scale
to colour each area. The scale
can be given as a known string (e.g. "Viridis") or a CSS-style gradient (e.g. "#ffe837 0%, #7d7d77 50%, #042450 100%"). The min
and max
for the scale
will be calculated from the data unless provided.
This example was made with config
:
data:
- LAD21CD: E08000016
LAD21NM: Barnsley
colour: '#E6007C'
Aged 15 years and under: 44782
- LAD21CD: E08000032
LAD21NM: Bradford
colour: '#FF6700'
Aged 15 years and under: 124837
- LAD21CD: E08000033
LAD21NM: Calderdale
colour: '#0DBC37'
Aged 15 years and under: 39997
- LAD21CD: E07000163
LAD21NM: Craven
colour: '#178CFF'
Aged 15 years and under: 8643
- LAD21CD: E07000165
LAD21NM: Harrogate
colour: '#2f529f'
Aged 15 years and under: 27362
- LAD21CD: E08000034
LAD21NM: Kirklees
colour: '#722EA5'
Aged 15 years and under: 86941
- LAD21CD: E08000035
LAD21NM: Leeds
colour: '#F9BC26'
Aged 15 years and under: 153483
- LAD21CD: E07000169
LAD21NM: Selby
colour: '#1DD3A7'
Aged 15 years and under: 16556
- LAD21CD: E08000036
LAD21NM: Wakefield
colour: '#EF3AAB'
Aged 15 years and under: 65832
- LAD21CD: E06000014
LAD21NM: York
colour: '#F92626'
Aged 15 years and under: 30738
geojson:
key: LAD21CD
data: geojson.leeds_city_region
key: LAD21CD
value: Aged 15 years and under
scale: Viridis
tooltip: LAD21NM
{
"data": [{
"LAD21CD": "E08000016",
"LAD21NM": "Barnsley",
"colour": "#E6007C",
"Aged 15 years and under": 44782
},{
"LAD21CD": "E08000032",
"LAD21NM": "Bradford",
"colour": "#FF6700",
"Aged 15 years and under": 124837
},{
"LAD21CD": "E08000033",
"LAD21NM": "Calderdale",
"colour": "#0DBC37",
"Aged 15 years and under": 39997
},{
"LAD21CD": "E07000163",
"LAD21NM": "Craven",
"colour": "#178CFF",
"Aged 15 years and under": 8643
},{
"LAD21CD": "E07000165",
"LAD21NM": "Harrogate",
"colour": "#2f529f",
"Aged 15 years and under": 27362
},{
"LAD21CD": "E08000034",
"LAD21NM": "Kirklees",
"colour": "#722EA5",
"Aged 15 years and under": 86941
},{
"LAD21CD": "E08000035",
"LAD21NM": "Leeds",
"colour": "#F9BC26",
"Aged 15 years and under": 153483
},{
"LAD21CD": "E07000169",
"LAD21NM": "Selby",
"colour": "#1DD3A7",
"Aged 15 years and under": 16556
},{
"LAD21CD": "E08000036",
"LAD21NM": "Wakefield",
"colour": "#EF3AAB",
"Aged 15 years and under": 65832
},{
"LAD21CD": "E06000014",
"LAD21NM": "York",
"colour": "#F92626",
"Aged 15 years and under": 30738
}],
"geojson": {
"key": "LAD21CD",
"data": "geojson.leeds_city_region"
},
"key": "LAD21CD",
"value": "Aged 15 years and under",
"scale": "Viridis",
"tooltip": "LAD21NM"
}
4. Set opacity of the data layer§
In this example we will set the fillOpacity
of the data layer to 0.5
(the default value is 1).
This example was made with config
:
data:
- LAD21CD: E08000016
LAD21NM: Barnsley
colour: '#E6007C'
Aged 15 years and under: 44782
- LAD21CD: E08000032
LAD21NM: Bradford
colour: '#FF6700'
Aged 15 years and under: 124837
- LAD21CD: E08000033
LAD21NM: Calderdale
colour: '#0DBC37'
Aged 15 years and under: 39997
- LAD21CD: E07000163
LAD21NM: Craven
colour: '#178CFF'
Aged 15 years and under: 8643
- LAD21CD: E07000165
LAD21NM: Harrogate
colour: '#2f529f'
Aged 15 years and under: 27362
- LAD21CD: E08000034
LAD21NM: Kirklees
colour: '#722EA5'
Aged 15 years and under: 86941
- LAD21CD: E08000035
LAD21NM: Leeds
colour: '#F9BC26'
Aged 15 years and under: 153483
- LAD21CD: E07000169
LAD21NM: Selby
colour: '#1DD3A7'
Aged 15 years and under: 16556
- LAD21CD: E08000036
LAD21NM: Wakefield
colour: '#EF3AAB'
Aged 15 years and under: 65832
- LAD21CD: E06000014
LAD21NM: York
colour: '#F92626'
Aged 15 years and under: 30738
geojson:
key: LAD21CD
data: geojson.leeds_city_region
key: LAD21CD
value: Aged 15 years and under
scale: Viridis
tooltip: LAD21NM
options:
fillOpacity: 0.5
{
"data": [{
"LAD21CD": "E08000016",
"LAD21NM": "Barnsley",
"colour": "#E6007C",
"Aged 15 years and under": 44782
},{
"LAD21CD": "E08000032",
"LAD21NM": "Bradford",
"colour": "#FF6700",
"Aged 15 years and under": 124837
},{
"LAD21CD": "E08000033",
"LAD21NM": "Calderdale",
"colour": "#0DBC37",
"Aged 15 years and under": 39997
},{
"LAD21CD": "E07000163",
"LAD21NM": "Craven",
"colour": "#178CFF",
"Aged 15 years and under": 8643
},{
"LAD21CD": "E07000165",
"LAD21NM": "Harrogate",
"colour": "#2f529f",
"Aged 15 years and under": 27362
},{
"LAD21CD": "E08000034",
"LAD21NM": "Kirklees",
"colour": "#722EA5",
"Aged 15 years and under": 86941
},{
"LAD21CD": "E08000035",
"LAD21NM": "Leeds",
"colour": "#F9BC26",
"Aged 15 years and under": 153483
},{
"LAD21CD": "E07000169",
"LAD21NM": "Selby",
"colour": "#1DD3A7",
"Aged 15 years and under": 16556
},{
"LAD21CD": "E08000036",
"LAD21NM": "Wakefield",
"colour": "#EF3AAB",
"Aged 15 years and under": 65832
},{
"LAD21CD": "E06000014",
"LAD21NM": "York",
"colour": "#F92626",
"Aged 15 years and under": 30738
}],
"geojson": {
"key": "LAD21CD",
"data": "geojson.leeds_city_region"
},
"key": "LAD21CD",
"value": "Aged 15 years and under",
"scale": "Viridis",
"tooltip": "LAD21NM",
"options": {
"fillOpacity": 0.5
}
}
5. Add a legend§
Sometimes you need a legend
with defined levels. To make this we first manually set min
and max
(otherwise they are calculated from the data and won't necessarily match our levels). We position
(e.g. top
, top left
, top right
, bottom
, bottom right
, bottom left
) and add items
to the legend. Each item has a value
and label
although the label can be empty.
This example was made with config
:
data:
- LAD21CD: E08000016
LAD21NM: Barnsley
colour: '#E6007C'
Aged 15 years and under: 44782
Aged 16 to 24 years: 22101
Aged 25 to 34 years: 32949
Aged 35 to 49 years: 44857
Aged 50 to 64 years: 52285
Aged 65 years and over: 47598
- LAD21CD: E08000032
LAD21NM: Bradford
colour: '#FF6700'
Aged 15 years and under: 124837
Aged 16 to 24 years: 63079
Aged 25 to 34 years: 72559
Aged 35 to 49 years: 107702
Aged 50 to 64 years: 95233
Aged 65 years and over: 83001
- LAD21CD: E08000033
LAD21NM: Calderdale
colour: '#0DBC37'
Aged 15 years and under: 39997
Aged 16 to 24 years: 19163
Aged 25 to 34 years: 24920
Aged 35 to 49 years: 39472
Aged 50 to 64 years: 43769
Aged 65 years and over: 39310
- LAD21CD: E07000163
LAD21NM: Craven
colour: '#178CFF'
Aged 15 years and under: 8643
Aged 16 to 24 years: 4324
Aged 25 to 34 years: 5353
Aged 35 to 49 years: 9303
Aged 50 to 64 years: 13675
Aged 65 years and over: 15629
- LAD21CD: E07000165
LAD21NM: Harrogate
colour: '#2f529f'
Aged 15 years and under: 27362
Aged 16 to 24 years: 14198
Aged 25 to 34 years: 16587
Aged 35 to 49 years: 29713
Aged 50 to 64 years: 36781
Aged 65 years and over: 38026
- LAD21CD: E08000034
LAD21NM: Kirklees
colour: '#722EA5'
Aged 15 years and under: 86941
Aged 16 to 24 years: 47172
Aged 25 to 34 years: 54869
Aged 35 to 49 years: 83410
Aged 50 to 64 years: 84011
Aged 65 years and over: 76813
- LAD21CD: E08000035
LAD21NM: Leeds
colour: '#F9BC26'
Aged 15 years and under: 153483
Aged 16 to 24 years: 113371
Aged 25 to 34 years: 121267
Aged 35 to 49 years: 157374
Aged 50 to 64 years: 139693
Aged 65 years and over: 126766
- LAD21CD: E07000169
LAD21NM: Selby
colour: '#1DD3A7'
Aged 15 years and under: 16556
Aged 16 to 24 years: 7619
Aged 25 to 34 years: 11398
Aged 35 to 49 years: 17234
Aged 50 to 64 years: 20409
Aged 65 years and over: 18772
- LAD21CD: E08000036
LAD21NM: Wakefield
colour: '#EF3AAB'
Aged 15 years and under: 65832
Aged 16 to 24 years: 31934
Aged 25 to 34 years: 48974
Aged 35 to 49 years: 67141
Aged 50 to 64 years: 72877
Aged 65 years and over: 66607
- LAD21CD: E06000014
LAD21NM: York
colour: '#F92626'
Aged 15 years and under: 30738
Aged 16 to 24 years: 33671
Aged 25 to 34 years: 25845
Aged 35 to 49 years: 36356
Aged 50 to 64 years: 37478
Aged 65 years and over: 38733
geojson:
key: LAD21CD
data: geojson.leeds_city_region
key: LAD21CD
tooltip: LAD21NM
value: Aged 15 years and under
scale: Viridis
min: 0
max: 160000
legend:
position: top right
items:
- value: 160000
label: 160k
- value: 120000
label: ''
- value: 80000
label: 80k
- value: 40000
label: ''
- value: 0
label: '0'
{
"data": [{
"LAD21CD": "E08000016",
"LAD21NM": "Barnsley",
"colour": "#E6007C",
"Aged 15 years and under": 44782,
"Aged 16 to 24 years": 22101,
"Aged 25 to 34 years": 32949,
"Aged 35 to 49 years": 44857,
"Aged 50 to 64 years": 52285,
"Aged 65 years and over": 47598
},{
"LAD21CD": "E08000032",
"LAD21NM": "Bradford",
"colour": "#FF6700",
"Aged 15 years and under": 124837,
"Aged 16 to 24 years": 63079,
"Aged 25 to 34 years": 72559,
"Aged 35 to 49 years": 107702,
"Aged 50 to 64 years": 95233,
"Aged 65 years and over": 83001
},{
"LAD21CD": "E08000033",
"LAD21NM": "Calderdale",
"colour": "#0DBC37",
"Aged 15 years and under": 39997,
"Aged 16 to 24 years": 19163,
"Aged 25 to 34 years": 24920,
"Aged 35 to 49 years": 39472,
"Aged 50 to 64 years": 43769,
"Aged 65 years and over": 39310
},{
"LAD21CD": "E07000163",
"LAD21NM": "Craven",
"colour": "#178CFF",
"Aged 15 years and under": 8643,
"Aged 16 to 24 years": 4324,
"Aged 25 to 34 years": 5353,
"Aged 35 to 49 years": 9303,
"Aged 50 to 64 years": 13675,
"Aged 65 years and over": 15629
},{
"LAD21CD": "E07000165",
"LAD21NM": "Harrogate",
"colour": "#2f529f",
"Aged 15 years and under": 27362,
"Aged 16 to 24 years": 14198,
"Aged 25 to 34 years": 16587,
"Aged 35 to 49 years": 29713,
"Aged 50 to 64 years": 36781,
"Aged 65 years and over": 38026
},{
"LAD21CD": "E08000034",
"LAD21NM": "Kirklees",
"colour": "#722EA5",
"Aged 15 years and under": 86941,
"Aged 16 to 24 years": 47172,
"Aged 25 to 34 years": 54869,
"Aged 35 to 49 years": 83410,
"Aged 50 to 64 years": 84011,
"Aged 65 years and over": 76813
},{
"LAD21CD": "E08000035",
"LAD21NM": "Leeds",
"colour": "#F9BC26",
"Aged 15 years and under": 153483,
"Aged 16 to 24 years": 113371,
"Aged 25 to 34 years": 121267,
"Aged 35 to 49 years": 157374,
"Aged 50 to 64 years": 139693,
"Aged 65 years and over": 126766
},{
"LAD21CD": "E07000169",
"LAD21NM": "Selby",
"colour": "#1DD3A7",
"Aged 15 years and under": 16556,
"Aged 16 to 24 years": 7619,
"Aged 25 to 34 years": 11398,
"Aged 35 to 49 years": 17234,
"Aged 50 to 64 years": 20409,
"Aged 65 years and over": 18772
},{
"LAD21CD": "E08000036",
"LAD21NM": "Wakefield",
"colour": "#EF3AAB",
"Aged 15 years and under": 65832,
"Aged 16 to 24 years": 31934,
"Aged 25 to 34 years": 48974,
"Aged 35 to 49 years": 67141,
"Aged 50 to 64 years": 72877,
"Aged 65 years and over": 66607
},{
"LAD21CD": "E06000014",
"LAD21NM": "York",
"colour": "#F92626",
"Aged 15 years and under": 30738,
"Aged 16 to 24 years": 33671,
"Aged 25 to 34 years": 25845,
"Aged 35 to 49 years": 36356,
"Aged 50 to 64 years": 37478,
"Aged 65 years and over": 38733
}],
"geojson": {
"key": "LAD21CD",
"data": "geojson.leeds_city_region"
},
"key": "LAD21CD",
"tooltip": "LAD21NM",
"value": "Aged 15 years and under",
"scale": "Viridis",
"min": 0,
"max": 160000,
"legend": {
"position": "top right",
"items": [{
"value": 160000,
"label": "160k"
},{
"value": 120000,
"label": ""
},{
"value": 80000,
"label": "80k"
},{
"value": 40000,
"label": ""
},{
"value": 0,
"label": "0"
}]
}
}
6. Custom tooltips§
We will create a virtual column with the name
"Tooltip label" to define the tooltip
text. Virtual columns must have a name
and template
which can include existing columns from the data e.g. "{{ LAD21NM }}: {{ Aged 15 years and under }}" would use the LAD21CD
and Aged 15 years and under
values from the data. Replacement values (e.g. "{{ Aged 15 years and under }}") can use the following filters:
toFixed(n)
- to limit a value ton
decimal placesmultiply(n)
- to multiply a value byn
toLocaleString()
- to use the locale's (of the server) preferred formatting for a valuecolourScale(scale,min,max)
- get a colour to, for example, use as a background stylecontrastColour
- get a contrasting colour (black or white)
This example was made with config
:
data:
- LAD21CD: E08000016
LAD21NM: Barnsley
colour: '#E6007C'
Aged 15 years and under: 44782
- LAD21CD: E08000032
LAD21NM: Bradford
colour: '#FF6700'
Aged 15 years and under: 124837
- LAD21CD: E08000033
LAD21NM: Calderdale
colour: '#0DBC37'
Aged 15 years and under: 39997
- LAD21CD: E07000163
LAD21NM: Craven
colour: '#178CFF'
Aged 15 years and under: 8643
- LAD21CD: E07000165
LAD21NM: Harrogate
colour: '#2f529f'
Aged 15 years and under: 27362
- LAD21CD: E08000034
LAD21NM: Kirklees
colour: '#722EA5'
Aged 15 years and under: 86941
- LAD21CD: E08000035
LAD21NM: Leeds
colour: '#F9BC26'
Aged 15 years and under: 153483
- LAD21CD: E07000169
LAD21NM: Selby
colour: '#1DD3A7'
Aged 15 years and under: 16556
- LAD21CD: E08000036
LAD21NM: Wakefield
colour: '#EF3AAB'
Aged 15 years and under: 65832
- LAD21CD: E06000014
LAD21NM: York
colour: '#F92626'
Aged 15 years and under: 30738
geojson:
key: LAD21CD
data: geojson.leeds_city_region
columns:
- name: Tooltip label
template: >-
{{ LAD21NM }}<br />Aged 15 and under: {{ Aged 15 years and under |
toLocaleString() }}
key: LAD21CD
tooltip: Tooltip label
value: colour
{
"data": [{
"LAD21CD": "E08000016",
"LAD21NM": "Barnsley",
"colour": "#E6007C",
"Aged 15 years and under": 44782
},{
"LAD21CD": "E08000032",
"LAD21NM": "Bradford",
"colour": "#FF6700",
"Aged 15 years and under": 124837
},{
"LAD21CD": "E08000033",
"LAD21NM": "Calderdale",
"colour": "#0DBC37",
"Aged 15 years and under": 39997
},{
"LAD21CD": "E07000163",
"LAD21NM": "Craven",
"colour": "#178CFF",
"Aged 15 years and under": 8643
},{
"LAD21CD": "E07000165",
"LAD21NM": "Harrogate",
"colour": "#2f529f",
"Aged 15 years and under": 27362
},{
"LAD21CD": "E08000034",
"LAD21NM": "Kirklees",
"colour": "#722EA5",
"Aged 15 years and under": 86941
},{
"LAD21CD": "E08000035",
"LAD21NM": "Leeds",
"colour": "#F9BC26",
"Aged 15 years and under": 153483
},{
"LAD21CD": "E07000169",
"LAD21NM": "Selby",
"colour": "#1DD3A7",
"Aged 15 years and under": 16556
},{
"LAD21CD": "E08000036",
"LAD21NM": "Wakefield",
"colour": "#EF3AAB",
"Aged 15 years and under": 65832
},{
"LAD21CD": "E06000014",
"LAD21NM": "York",
"colour": "#F92626",
"Aged 15 years and under": 30738
}],
"geojson": {
"key": "LAD21CD",
"data": "geojson.leeds_city_region"
},
"columns": [{
"name": "Tooltip label",
"template": "{{ LAD21NM }}<br />Aged 15 and under: {{ Aged 15 years and under | toLocaleString() }}"
}],
"key": "LAD21CD",
"tooltip": "Tooltip label",
"value": "colour"
}
7. Place labels§
We can add places
to a layer above the interactive map. A place can be defined with the following properties:
name
- the label to use for the place labellatitude
- set the latitude of the label (can be omitted if it is a UK place we know about)longitude
- set the longitude of the label (can be omitted if it is a UK place we know about)text-anchor
- set to eitherstart
,middle
, orend
to anchor the textcolour
- the colour of the label (default is black)border
- the colour of the label border (default is white)font-size
- manually set the font size (if omitted it will be scaled to the population where known)font-weight
- manually set the font weight (e.g. to "bold")font-family
- manually set the font family
This example was made with config
:
data:
- code: E08000016
name: Barnsley
- code: E08000032
name: Bradford
- code: E08000033
name: Calderdale
- code: E07000163
name: Craven
- code: E07000165
name: Harrogate
- code: E08000034
name: Kirklees
- code: E08000035
name: Leeds
- code: E07000169
name: Selby
- code: E08000036
name: Wakefield
- code: E06000014
name: York
geojson:
key: LAD21CD
data: geojson.leeds_city_region
key: code
tooltip: name
places:
- name: Bradford
text-anchor: end
font-size: 24
- name: Leeds
font-size: 32
font-weight: bold
font-family: 'Times, serif'
colour: '#722EA5'
border: '#1DD3A7'
- name: Halifax
- name: Harrogate
- name: Huddersfield
- name: Settle
latitude: 54.0693
longitude: -2.279
- name: Skipton
latitude: 53.9619
longitude: -2.0174
- name: Wakefield
text-anchor: start
latitude: 53.68331
longitude: -1.49768
- name: York
{
"data": [{
"code": "E08000016",
"name": "Barnsley"
},{
"code": "E08000032",
"name": "Bradford"
},{
"code": "E08000033",
"name": "Calderdale"
},{
"code": "E07000163",
"name": "Craven"
},{
"code": "E07000165",
"name": "Harrogate"
},{
"code": "E08000034",
"name": "Kirklees"
},{
"code": "E08000035",
"name": "Leeds"
},{
"code": "E07000169",
"name": "Selby"
},{
"code": "E08000036",
"name": "Wakefield"
},{
"code": "E06000014",
"name": "York"
}],
"geojson": {
"key": "LAD21CD",
"data": "geojson.leeds_city_region"
},
"key": "code",
"tooltip": "name",
"places": [{
"name": "Bradford",
"text-anchor": "end",
"font-size": 24
},{
"name": "Leeds",
"font-size": 32,
"font-weight": "bold",
"font-family": "Times, serif",
"colour": "#722EA5",
"border": "#1DD3A7"
},{
"name": "Halifax"
},{
"name": "Harrogate"
},{
"name": "Huddersfield"
},{
"name": "Settle",
"latitude": 54.0693,
"longitude": -2.279
},{
"name": "Skipton",
"latitude": 53.9619,
"longitude": -2.0174
},{
"name": "Wakefield",
"text-anchor": "start",
"latitude": 53.68331,
"longitude": -1.49768
},{
"name": "York"
}]
}
8. Map markers§
We can add markers
to a layer above the interactive map. A marker can be defined with the following properties:
icon
- can be either:string
- one ofdefault
,geo
,geo-alt
,asterisk
,pin
,balloon
,balloon-heart
,chat-square
object
- define an icon using the following propertiessvg
- the SVG string to usesize
- e.g.[40,40]
anchor
- e.g.[20,0]
latitude
- set the latitude of the markerlongitude
- set the longitude of the markercolour
- the colour of the label (default is black)tooltip
- the content of an optional tooltip
Be aware that markers sit above the interactive layer so may block some interactivity.
This example was made with config
:
data:
- code: E08000016
name: Barnsley
- code: E08000032
name: Bradford
- code: E08000033
name: Calderdale
- code: E07000163
name: Craven
- code: E07000165
name: Harrogate
- code: E08000034
name: Kirklees
- code: E08000035
name: Leeds
- code: E07000169
name: Selby
- code: E08000036
name: Wakefield
- code: E06000014
name: York
geojson:
key: LAD21CD
data: geojson.leeds_city_region
key: code
tooltip: name
markers:
- icon:
svg: >-
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16"
fill="currentColor" class="bi bi-award-fill" viewBox="0 0 16 16"><path
d="m8 0 1.669.864 1.858.282.842 1.68 1.337 1.32L13.4 6l.306 1.854-1.337
1.32-.842 1.68-1.858.282L8
12l-1.669-.864-1.858-.282-.842-1.68-1.337-1.32L2.6 6l-.306-1.854
1.337-1.32.842-1.68L6.331.864 8 0z"/><path d="M4 11.794V16l4-1 4
1v-4.206l-2.018.306L8 13.126 6.018 12.1 4 11.794z"/></svg>
size:
- 30
- 30
anchor:
- 15
- 15
tooltip: Barnsley marker
latitude: 53.5529
longitude: -1.4825
colour: '#EF3AAB'
- icon: geo
tooltip: Bradford marker
latitude: 53.7944
longitude: -1.7519
colour: '#2254F4'
- icon: balloon
tooltip: Huddersfield marker
latitude: 53.6463
longitude: -1.7853
colour: '#0DBC37'
- icon: chat-square
tooltip: Halifax marker
latitude: 53.7211
longitude: -1.8622
colour: '#722EA5'
- icon: geo-alt
tooltip: Leeds marker
latitude: 53.7968
longitude: -1.5439
colour: '#F9BC26'
- icon: pin
tooltip: Wakefield marker
latitude: 53.68331
longitude: -1.49768
colour: '#D60303'
- icon: asterisk
tooltip: York marker
latitude: 53.9601
longitude: -1.0808
- latitude: 53.9617
longitude: -2.0201
{
"data": [{
"code": "E08000016",
"name": "Barnsley"
},{
"code": "E08000032",
"name": "Bradford"
},{
"code": "E08000033",
"name": "Calderdale"
},{
"code": "E07000163",
"name": "Craven"
},{
"code": "E07000165",
"name": "Harrogate"
},{
"code": "E08000034",
"name": "Kirklees"
},{
"code": "E08000035",
"name": "Leeds"
},{
"code": "E07000169",
"name": "Selby"
},{
"code": "E08000036",
"name": "Wakefield"
},{
"code": "E06000014",
"name": "York"
}],
"geojson": {
"key": "LAD21CD",
"data": "geojson.leeds_city_region"
},
"key": "code",
"tooltip": "name",
"markers": [{
"icon": {
"svg": "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" fill=\"currentColor\" class=\"bi bi-award-fill\" viewBox=\"0 0 16 16\"><path d=\"m8 0 1.669.864 1.858.282.842 1.68 1.337 1.32L13.4 6l.306 1.854-1.337 1.32-.842 1.68-1.858.282L8 12l-1.669-.864-1.858-.282-.842-1.68-1.337-1.32L2.6 6l-.306-1.854 1.337-1.32.842-1.68L6.331.864 8 0z\"/><path d=\"M4 11.794V16l4-1 4 1v-4.206l-2.018.306L8 13.126 6.018 12.1 4 11.794z\"/></svg>",
"size": [
30,
30
],
"anchor": [
15,
15
]
},
"tooltip": "Barnsley marker",
"latitude": 53.5529,
"longitude": -1.4825,
"colour": "#EF3AAB"
},{
"icon": "geo",
"tooltip": "Bradford marker",
"latitude": 53.7944,
"longitude": -1.7519,
"colour": "#2254F4"
},{
"icon": "balloon",
"tooltip": "Huddersfield marker",
"latitude": 53.6463,
"longitude": -1.7853,
"colour": "#0DBC37"
},{
"icon": "chat-square",
"tooltip": "Halifax marker",
"latitude": 53.7211,
"longitude": -1.8622,
"colour": "#722EA5"
},{
"icon": "geo-alt",
"tooltip": "Leeds marker",
"latitude": 53.7968,
"longitude": -1.5439,
"colour": "#F9BC26"
},{
"icon": "pin",
"tooltip": "Wakefield marker",
"latitude": 53.68331,
"longitude": -1.49768,
"colour": "#D60303"
},{
"icon": "asterisk",
"tooltip": "York marker",
"latitude": 53.9601,
"longitude": -1.0808
},{
"latitude": 53.9617,
"longitude": -2.0201
}]
}
9. Add a background§
A non-interactive background
can be added as a layer behind the interactive map. It should contain GeoJSON data
. It can have its colour
set. We can also adjust the map bounds
if we'd like the view to cover an area smaller/larger than the bounds of the data. Note that the exact bounding of the map will also depend on the aspect ratio that the map ends up on the end-user's display.
This example was made with config
:
data:
- code: E08000016
LAD21NM: Barnsley
colour: '#E6007C'
Aged 15 years and under: 44782
- code: E08000032
LAD21NM: Bradford
colour: '#FF6700'
Aged 15 years and under: 124837
- code: E08000033
LAD21NM: Calderdale
colour: '#0DBC37'
Aged 15 years and under: 39997
- code: E07000163
LAD21NM: Craven
colour: '#178CFF'
Aged 15 years and under: 8643
- code: E07000165
LAD21NM: Harrogate
colour: '#2f529f'
Aged 15 years and under: 27362
- code: E08000034
LAD21NM: Kirklees
colour: '#722EA5'
Aged 15 years and under: 86941
- code: E08000035
LAD21NM: Leeds
colour: '#F9BC26'
Aged 15 years and under: 153483
- code: E07000169
LAD21NM: Selby
colour: '#1DD3A7'
Aged 15 years and under: 16556
- code: E08000036
LAD21NM: Wakefield
colour: '#EF3AAB'
Aged 15 years and under: 65832
- code: E06000014
LAD21NM: York
colour: '#F92626'
Aged 15 years and under: 30738
geojson:
key: LAD21CD
data: geojson.leeds_city_region
key: code
tooltip: LAD21NM
value: Aged 15 years and under
scale: Viridis
background:
geojson: geojson.england
colour: silver
bounds:
lat:
min: 53.3
max: 54.45
lon:
min: -3
max: -0.3
{
"data": [{
"code": "E08000016",
"LAD21NM": "Barnsley",
"colour": "#E6007C",
"Aged 15 years and under": 44782
},{
"code": "E08000032",
"LAD21NM": "Bradford",
"colour": "#FF6700",
"Aged 15 years and under": 124837
},{
"code": "E08000033",
"LAD21NM": "Calderdale",
"colour": "#0DBC37",
"Aged 15 years and under": 39997
},{
"code": "E07000163",
"LAD21NM": "Craven",
"colour": "#178CFF",
"Aged 15 years and under": 8643
},{
"code": "E07000165",
"LAD21NM": "Harrogate",
"colour": "#2f529f",
"Aged 15 years and under": 27362
},{
"code": "E08000034",
"LAD21NM": "Kirklees",
"colour": "#722EA5",
"Aged 15 years and under": 86941
},{
"code": "E08000035",
"LAD21NM": "Leeds",
"colour": "#F9BC26",
"Aged 15 years and under": 153483
},{
"code": "E07000169",
"LAD21NM": "Selby",
"colour": "#1DD3A7",
"Aged 15 years and under": 16556
},{
"code": "E08000036",
"LAD21NM": "Wakefield",
"colour": "#EF3AAB",
"Aged 15 years and under": 65832
},{
"code": "E06000014",
"LAD21NM": "York",
"colour": "#F92626",
"Aged 15 years and under": 30738
}],
"geojson": {
"key": "LAD21CD",
"data": "geojson.leeds_city_region"
},
"key": "code",
"tooltip": "LAD21NM",
"value": "Aged 15 years and under",
"scale": "Viridis",
"background": {
"geojson": "geojson.england",
"colour": "silver"
},
"bounds": {
"lat": {
"min": 53.3,
"max": 54.45
},
"lon": {
"min": -3,
"max": -0.3
}
}
}
10. Set padding§
You can set the padding
between the data layer and the map edges. The value is given in the pixel scale of the generated map (which may not be the same as the pixels the map takes up on screen).
This example was made with config
:
data:
- code: E08000016
LAD21NM: Barnsley
colour: '#E6007C'
Aged 15 years and under: 44782
- code: E08000032
LAD21NM: Bradford
colour: '#FF6700'
Aged 15 years and under: 124837
- code: E08000033
LAD21NM: Calderdale
colour: '#0DBC37'
Aged 15 years and under: 39997
- code: E07000163
LAD21NM: Craven
colour: '#178CFF'
Aged 15 years and under: 8643
- code: E07000165
LAD21NM: Harrogate
colour: '#2f529f'
Aged 15 years and under: 27362
- code: E08000034
LAD21NM: Kirklees
colour: '#722EA5'
Aged 15 years and under: 86941
- code: E08000035
LAD21NM: Leeds
colour: '#F9BC26'
Aged 15 years and under: 153483
- code: E07000169
LAD21NM: Selby
colour: '#1DD3A7'
Aged 15 years and under: 16556
- code: E08000036
LAD21NM: Wakefield
colour: '#EF3AAB'
Aged 15 years and under: 65832
- code: E06000014
LAD21NM: York
colour: '#F92626'
Aged 15 years and under: 30738
geojson:
key: LAD21CD
data: geojson.leeds_city_region
key: code
tooltip: LAD21NM
value: Aged 15 years and under
scale: Viridis
background:
geojson: geojson.england
colour: silver
padding: 50
{
"data": [{
"code": "E08000016",
"LAD21NM": "Barnsley",
"colour": "#E6007C",
"Aged 15 years and under": 44782
},{
"code": "E08000032",
"LAD21NM": "Bradford",
"colour": "#FF6700",
"Aged 15 years and under": 124837
},{
"code": "E08000033",
"LAD21NM": "Calderdale",
"colour": "#0DBC37",
"Aged 15 years and under": 39997
},{
"code": "E07000163",
"LAD21NM": "Craven",
"colour": "#178CFF",
"Aged 15 years and under": 8643
},{
"code": "E07000165",
"LAD21NM": "Harrogate",
"colour": "#2f529f",
"Aged 15 years and under": 27362
},{
"code": "E08000034",
"LAD21NM": "Kirklees",
"colour": "#722EA5",
"Aged 15 years and under": 86941
},{
"code": "E08000035",
"LAD21NM": "Leeds",
"colour": "#F9BC26",
"Aged 15 years and under": 153483
},{
"code": "E07000169",
"LAD21NM": "Selby",
"colour": "#1DD3A7",
"Aged 15 years and under": 16556
},{
"code": "E08000036",
"LAD21NM": "Wakefield",
"colour": "#EF3AAB",
"Aged 15 years and under": 65832
},{
"code": "E06000014",
"LAD21NM": "York",
"colour": "#F92626",
"Aged 15 years and under": 30738
}],
"geojson": {
"key": "LAD21CD",
"data": "geojson.leeds_city_region"
},
"key": "code",
"tooltip": "LAD21NM",
"value": "Aged 15 years and under",
"scale": "Viridis",
"background": {
"geojson": "geojson.england",
"colour": "silver"
},
"padding": 50
}
11. Add a graticule§
We can also add a graticule
to the map which will be placed above the background/data layers and below the label/markers.
This example was made with config
:
data:
- code: E08000016
LAD21NM: Barnsley
colour: '#E6007C'
Aged 15 years and under: 44782
- code: E08000032
LAD21NM: Bradford
colour: '#FF6700'
Aged 15 years and under: 124837
- code: E08000033
LAD21NM: Calderdale
colour: '#0DBC37'
Aged 15 years and under: 39997
- code: E07000163
LAD21NM: Craven
colour: '#178CFF'
Aged 15 years and under: 8643
- code: E07000165
LAD21NM: Harrogate
colour: '#2f529f'
Aged 15 years and under: 27362
- code: E08000034
LAD21NM: Kirklees
colour: '#722EA5'
Aged 15 years and under: 86941
- code: E08000035
LAD21NM: Leeds
colour: '#F9BC26'
Aged 15 years and under: 153483
- code: E07000169
LAD21NM: Selby
colour: '#1DD3A7'
Aged 15 years and under: 16556
- code: E08000036
LAD21NM: Wakefield
colour: '#EF3AAB'
Aged 15 years and under: 65832
- code: E06000014
LAD21NM: York
colour: '#F92626'
Aged 15 years and under: 30738
geojson:
key: LAD21CD
data: geojson.leeds_city_region
key: code
tooltip: LAD21NM
value: Aged 15 years and under
scale: Viridis
background:
geojson: geojson.england
colour: silver
graticule:
step:
- 0.5
- 0.5
bounds:
lat:
min: 53.3
max: 54.45
lon:
min: -3
max: -0.3
{
"data": [{
"code": "E08000016",
"LAD21NM": "Barnsley",
"colour": "#E6007C",
"Aged 15 years and under": 44782
},{
"code": "E08000032",
"LAD21NM": "Bradford",
"colour": "#FF6700",
"Aged 15 years and under": 124837
},{
"code": "E08000033",
"LAD21NM": "Calderdale",
"colour": "#0DBC37",
"Aged 15 years and under": 39997
},{
"code": "E07000163",
"LAD21NM": "Craven",
"colour": "#178CFF",
"Aged 15 years and under": 8643
},{
"code": "E07000165",
"LAD21NM": "Harrogate",
"colour": "#2f529f",
"Aged 15 years and under": 27362
},{
"code": "E08000034",
"LAD21NM": "Kirklees",
"colour": "#722EA5",
"Aged 15 years and under": 86941
},{
"code": "E08000035",
"LAD21NM": "Leeds",
"colour": "#F9BC26",
"Aged 15 years and under": 153483
},{
"code": "E07000169",
"LAD21NM": "Selby",
"colour": "#1DD3A7",
"Aged 15 years and under": 16556
},{
"code": "E08000036",
"LAD21NM": "Wakefield",
"colour": "#EF3AAB",
"Aged 15 years and under": 65832
},{
"code": "E06000014",
"LAD21NM": "York",
"colour": "#F92626",
"Aged 15 years and under": 30738
}],
"geojson": {
"key": "LAD21CD",
"data": "geojson.leeds_city_region"
},
"key": "code",
"tooltip": "LAD21NM",
"value": "Aged 15 years and under",
"scale": "Viridis",
"background": {
"geojson": "geojson.england",
"colour": "silver"
},
"graticule": {
"step": [
0.5,
0.5
]
},
"bounds": {
"lat": {
"min": 53.3,
"max": 54.45
},
"lon": {
"min": -3,
"max": -0.3
}
}
}
12. Set layer order§
The default ordering of the layers used to make the map is (bottom to top): background
→ data
→ graticule
→ labels
→ markers
. We can choose to limit or re-order the layers
explicitly by creating an array of layers ordered from bottom to top e.g. let's order the layers with the graticule
under the data
layer.
This example was made with config
:
data:
- code: E08000016
LAD21NM: Barnsley
colour: '#E6007C'
Aged 15 years and under: 44782
- code: E08000032
LAD21NM: Bradford
colour: '#FF6700'
Aged 15 years and under: 124837
- code: E08000033
LAD21NM: Calderdale
colour: '#0DBC37'
Aged 15 years and under: 39997
- code: E07000163
LAD21NM: Craven
colour: '#178CFF'
Aged 15 years and under: 8643
- code: E07000165
LAD21NM: Harrogate
colour: '#2f529f'
Aged 15 years and under: 27362
- code: E08000034
LAD21NM: Kirklees
colour: '#722EA5'
Aged 15 years and under: 86941
- code: E08000035
LAD21NM: Leeds
colour: '#F9BC26'
Aged 15 years and under: 153483
- code: E07000169
LAD21NM: Selby
colour: '#1DD3A7'
Aged 15 years and under: 16556
- code: E08000036
LAD21NM: Wakefield
colour: '#EF3AAB'
Aged 15 years and under: 65832
- code: E06000014
LAD21NM: York
colour: '#F92626'
Aged 15 years and under: 30738
geojson:
key: LAD21CD
data: geojson.leeds_city_region
bounds:
lat:
min: 53.3
max: 54.45
lon:
min: -3
max: -0.3
layers:
- type: background
geojson: geojson.england
colour: silver
- type: graticule
step:
- 0.5
- 0.5
- type: data
key: code
value: Aged 15 years and under
tooltip: LAD21NM
scale: Viridis
test: true
{
"data": [{
"code": "E08000016",
"LAD21NM": "Barnsley",
"colour": "#E6007C",
"Aged 15 years and under": 44782
},{
"code": "E08000032",
"LAD21NM": "Bradford",
"colour": "#FF6700",
"Aged 15 years and under": 124837
},{
"code": "E08000033",
"LAD21NM": "Calderdale",
"colour": "#0DBC37",
"Aged 15 years and under": 39997
},{
"code": "E07000163",
"LAD21NM": "Craven",
"colour": "#178CFF",
"Aged 15 years and under": 8643
},{
"code": "E07000165",
"LAD21NM": "Harrogate",
"colour": "#2f529f",
"Aged 15 years and under": 27362
},{
"code": "E08000034",
"LAD21NM": "Kirklees",
"colour": "#722EA5",
"Aged 15 years and under": 86941
},{
"code": "E08000035",
"LAD21NM": "Leeds",
"colour": "#F9BC26",
"Aged 15 years and under": 153483
},{
"code": "E07000169",
"LAD21NM": "Selby",
"colour": "#1DD3A7",
"Aged 15 years and under": 16556
},{
"code": "E08000036",
"LAD21NM": "Wakefield",
"colour": "#EF3AAB",
"Aged 15 years and under": 65832
},{
"code": "E06000014",
"LAD21NM": "York",
"colour": "#F92626",
"Aged 15 years and under": 30738
}],
"geojson": {
"key": "LAD21CD",
"data": "geojson.leeds_city_region"
},
"bounds": {
"lat": {
"min": 53.3,
"max": 54.45
},
"lon": {
"min": -3,
"max": -0.3
}
},
"layers": [{
"type": "background",
"geojson": "geojson.england",
"colour": "silver"
},{
"type": "graticule",
"step": [
0.5,
0.5
]
},{
"type": "data",
"key": "code",
"value": "Aged 15 years and under",
"tooltip": "LAD21NM",
"scale": "Viridis"
}],
"test": true
}
13. Filter map§
We can add an interactive filter
to our svg map. We can set tools → filter → label
to the name
of a column in the data - this defines the text used in the filter drop-down list. We can set the maximum number of results to show in the filter drop down using tools → filter → max
.
This example was made with config
:
data:
- code: E08000016
LAD21NM: Barnsley
colour: '#E6007C'
Aged 15 years and under: 44782
- code: E08000032
LAD21NM: Bradford
colour: '#FF6700'
Aged 15 years and under: 124837
- code: E08000033
LAD21NM: Calderdale
colour: '#0DBC37'
Aged 15 years and under: 39997
- code: E07000163
LAD21NM: Craven
colour: '#178CFF'
Aged 15 years and under: 8643
- code: E07000165
LAD21NM: Harrogate
colour: '#2f529f'
Aged 15 years and under: 27362
- code: E08000034
LAD21NM: Kirklees
colour: '#722EA5'
Aged 15 years and under: 86941
- code: E08000035
LAD21NM: Leeds
colour: '#F9BC26'
Aged 15 years and under: 153483
- code: E07000169
LAD21NM: Selby
colour: '#1DD3A7'
Aged 15 years and under: 16556
- code: E08000036
LAD21NM: Wakefield
colour: '#EF3AAB'
Aged 15 years and under: 65832
- code: E06000014
LAD21NM: York
colour: '#F92626'
Aged 15 years and under: 30738
geojson:
key: LAD21CD
data: geojson.leeds_city_region
key: code
tooltip: LAD21NM
value: Aged 15 years and under
scale: Viridis
background:
geojson: geojson.england
colour: silver
bounds:
lat:
min: 53.3
max: 54.45
lon:
min: -3
max: -0.3
tools:
filter:
label: filterLabel
columns:
- name: filterLabel
template: '{{ LAD21NM }} ({{ code }})'
{
"data": [{
"code": "E08000016",
"LAD21NM": "Barnsley",
"colour": "#E6007C",
"Aged 15 years and under": 44782
},{
"code": "E08000032",
"LAD21NM": "Bradford",
"colour": "#FF6700",
"Aged 15 years and under": 124837
},{
"code": "E08000033",
"LAD21NM": "Calderdale",
"colour": "#0DBC37",
"Aged 15 years and under": 39997
},{
"code": "E07000163",
"LAD21NM": "Craven",
"colour": "#178CFF",
"Aged 15 years and under": 8643
},{
"code": "E07000165",
"LAD21NM": "Harrogate",
"colour": "#2f529f",
"Aged 15 years and under": 27362
},{
"code": "E08000034",
"LAD21NM": "Kirklees",
"colour": "#722EA5",
"Aged 15 years and under": 86941
},{
"code": "E08000035",
"LAD21NM": "Leeds",
"colour": "#F9BC26",
"Aged 15 years and under": 153483
},{
"code": "E07000169",
"LAD21NM": "Selby",
"colour": "#1DD3A7",
"Aged 15 years and under": 16556
},{
"code": "E08000036",
"LAD21NM": "Wakefield",
"colour": "#EF3AAB",
"Aged 15 years and under": 65832
},{
"code": "E06000014",
"LAD21NM": "York",
"colour": "#F92626",
"Aged 15 years and under": 30738
}],
"geojson": {
"key": "LAD21CD",
"data": "geojson.leeds_city_region"
},
"key": "code",
"tooltip": "LAD21NM",
"value": "Aged 15 years and under",
"scale": "Viridis",
"background": {
"geojson": "geojson.england",
"colour": "silver"
},
"bounds": {
"lat": {
"min": 53.3,
"max": 54.45
},
"lon": {
"min": -3,
"max": -0.3
}
},
"tools": {
"filter": {
"label": "filterLabel"
}
},
"columns": [{
"name": "filterLabel",
"template": "{{ LAD21NM }} ({{ code }})"
}]
}
14. Display a line§
So far we've been showing polygons but we can also show lines. Here's the route of a bike trip along the Atlantic Coast of Europe.
Distance: 120.4 km (74.8 miles)
Total distance: 120.4 km (74.8 miles)
Elevation gain: 1097 m
Total elevation gain: 1097 m
Distance: 121.1 km (75.2 miles)
Total distance: 241.5 km (150.0 miles)
Elevation gain: 1267 m
Total elevation gain: 2364 m
Distance: 102.9 km (63.9 miles)
Total distance: 344.4 km (214.0 miles)
Elevation gain: 1109 m
Total elevation gain: 3473 m
Distance: 62.5 km (38.8 miles)
Total distance: 406.9 km (252.8 miles)
Elevation gain: 1476 m
Total elevation gain: 4949 m
Distance: 89.7 km (55.7 miles)
Total distance: 496.6 km (308.5 miles)
Elevation gain: 436 m
Total elevation gain: 5385 m
Distance: 120.2 km (74.7 miles)
Total distance: 616.8 km (383.2 miles)
Elevation gain: 1100 m
Total elevation gain: 6485 m
Distance: 30.0 km (18.6 miles)
Total distance: 646.8 km (401.8 miles)
Elevation gain: 263 m
Total elevation gain: 6748 m
Distance: 95.1 km (59.1 miles)
Total distance: 741.9 km (460.9 miles)
Elevation gain: 798 m
Total elevation gain: 7546 m
Distance: 65.8 km (40.9 miles)
Total distance: 807.7 km (501.8 miles)
Elevation gain: 915 m
Total elevation gain: 8461 m
Distance: 80.5 km (50.0 miles)
Total distance: 888.2 km (551.8 miles)
Elevation gain: 791 m
Total elevation gain: 9252 m
Distance: 3.7 km (2.3 miles)
Total distance: 964.1 km (599.0 miles)
Elevation gain: 44 m
Total elevation gain: 9960 m
Distance: ()
Total distance: ()
Elevation gain:
Total elevation gain:
Distance: 107.3 km (66.7 miles)
Total distance: 1071.4 km (665.6 miles)
Elevation gain: 888 m
Total elevation gain: 10848 m
Distance: 126.7 km (78.7 miles)
Total distance: 1198.1 km (744.3 miles)
Elevation gain: 981 m
Total elevation gain: 11829 m
Distance: 113.5 km (70.5 miles)
Total distance: 1311.6 km (814.8 miles)
Elevation gain: 530 m
Total elevation gain: 12359 m
Distance: 91.2 km (56.7 miles)
Total distance: 1402.8 km (871.5 miles)
Elevation gain: 632 m
Total elevation gain: 12991 m
Distance: ()
Total distance: ()
Elevation gain:
Total elevation gain:
Distance: 84.0 km (52.2 miles)
Total distance: 1622.9 km (1008.2 miles)
Elevation gain: 1168 m
Total elevation gain: 15219 m
Distance: 87.7 km (54.5 miles)
Total distance: 1710.6 km (1062.7 miles)
Elevation gain: 606 m
Total elevation gain: 15825 m
Distance: 120.4 km (74.8 miles)
Total distance: 1831.0 km (1137.5 miles)
Elevation gain: 1238 m
Total elevation gain: 17063 m
Distance: 119.6 km (74.3 miles)
Total distance: 1950.6 km (1211.8 miles)
Elevation gain: 802 m
Total elevation gain: 17865 m
Distance: 119.6 km (74.3 miles)
Total distance: 1950.6 km (1211.8 miles)
Elevation gain: 665 m
Total elevation gain: 18530 m
Distance: 92.3 km (57.3 miles)
Total distance: 2042.9 km (1269.2 miles)
Elevation gain: 1104 m
Total elevation gain: 19634 m
Distance: 115.8 km (71.9 miles)
Total distance: 2158.7 km (1341.1 miles)
Elevation gain: 1076 m
Total elevation gain: 20710 m
Distance: 120.4 km (74.8 miles)
Total distance: 2279.1 km (1415.9 miles)
Elevation gain: 1405 m
Total elevation gain: 22115 m
Distance: 85.4 km (53.1 miles)
Total distance: 2364.5 km (1469.0 miles)
Elevation gain: 840 m
Total elevation gain: 22955 m
Distance: 115.9 km (72.0 miles)
Total distance: 2480.4 km (1541.0 miles)
Elevation gain: 1554 m
Total elevation gain: 24509 m
Distance: 85.0 km (52.8 miles)
Total distance: 2565.4 km (1593.8 miles)
Elevation gain: 931 m
Total elevation gain: 25440 m
Distance: 108.4 km (67.3 miles)
Total distance: 2673.8 km (1661.1 miles)
Elevation gain: 765 m
Total elevation gain: 26205 m
Distance: 103.9 km (64.5 miles)
Total distance: 2777.7 km (1725.7 miles)
Elevation gain: 983 m
Total elevation gain: 27188 m
Distance: 71.2 km (44.2 miles)
Total distance: 2848.9 km (1769.9 miles)
Elevation gain: 1026 m
Total elevation gain: 28214 m
Distance: 119.3 km (74.1 miles)
Total distance: 2968.2 km (1844.0 miles)
Elevation gain: 1840 m
Total elevation gain: 30054 m
Distance: 96.4 km (59.9 miles)
Total distance: 3064.6 km (1903.9 miles)
Elevation gain: 1423 m
Total elevation gain: 31477 m
Distance: 118.6 km (73.7 miles)
Total distance: 3183.2 km (1977.6 miles)
Elevation gain: 1455 m
Total elevation gain: 32932 m
Distance: 63.7 km (39.6 miles)
Total distance: 3246.9 km (2017.1 miles)
Elevation gain: 1455 m
Total elevation gain: 32932 m
Distance: 8.4 km (5.2 miles)
Total distance: 3272.5 km (2033.1 miles)
Elevation gain: 82 m
Total elevation gain: 33227 m
Distance: 114.9 km (71.4 miles)
Total distance: 3387.4 km (2104.4 miles)
Elevation gain: 82 m
Total elevation gain: 33227 m
Distance: 53.8 km (33.4 miles)
Total distance: 3441.2 km (2137.9 miles)
Elevation gain: 441 m
Total elevation gain: 33668 m
Distance: 84.2 km (52.3 miles)
Total distance: 3525.4 km (2190.2 miles)
Elevation gain: 772 m
Total elevation gain: 34440 m
Distance: 43.9 km (27.3 miles)
Total distance: 3569.3 km (2217.4 miles)
Elevation gain: 696 m
Total elevation gain: 35136 m
Distance: 87.3 km (54.2 miles)
Total distance: 3656.6 km (2271.7 miles)
Elevation gain: 927 m
Total elevation gain: 36063 m
Distance: 82.7 km (51.4 miles)
Total distance: 3739.3 km (2323.1 miles)
Elevation gain: 1604 m
Total elevation gain: 37667 m
Distance: 31.5 km (19.6 miles)
Total distance: 3770.8 km (2342.6 miles)
Elevation gain: 366 m
Total elevation gain: 38033 m
Distance: 94.4 km (58.6 miles)
Total distance: 3865.2 km (2401.3 miles)
Elevation gain: 1109 m
Total elevation gain: 39142 m
Distance: 94.5 km (58.7 miles)
Total distance: 3959.7 km (2460.0 miles)
Elevation gain: 1109 m
Total elevation gain: 40251 m
Distance: 91.2 km (56.7 miles)
Total distance: 4050.9 km (2516.6 miles)
Elevation gain: 1522 m
Total elevation gain: 41773 m
Distance: 82.1 km (51.0 miles)
Total distance: 4133.0 km (2567.6 miles)
Elevation gain: 903 m
Total elevation gain: 42676 m
Distance: 82.4 km (51.2 miles)
Total distance: 4215.4 km (2618.8 miles)
Elevation gain: 1097 m
Total elevation gain: 43773 m
Distance: 93.7 km (58.2 miles)
Total distance: 4309.1 km (2677.0 miles)
Elevation gain: 956 m
Total elevation gain: 44729 m
Distance: 101.0 km (62.7 miles)
Total distance: 4410.1 km (2739.8 miles)
Elevation gain: 1083 m
Total elevation gain: 45812 m
Distance: 84.8 km (52.7 miles)
Total distance: 4494.9 km (2792.5 miles)
Elevation gain: 863 m
Total elevation gain: 46675 m
Distance: 49.3 km (30.6 miles)
Total distance: 4544.2 km (2823.1 miles)
Elevation gain: 298 m
Total elevation gain: 46973 m
Distance: 72.4 km (45.0 miles)
Total distance: 4616.6 km (2868.1 miles)
Elevation gain: 827 m
Total elevation gain: 47800 m
Distance: 87.5 km (54.4 miles)
Total distance: 4704.1 km (2922.4 miles)
Elevation gain: 504 m
Total elevation gain: 48304 m
Distance: 68.7 km (42.7 miles)
Total distance: 4772.8 km (2965.1 miles)
Elevation gain: 1065 m
Total elevation gain: 49369 m
Distance: 105.9 km (65.8 miles)
Total distance: 4878.7 km (3030.9 miles)
Elevation gain: 1233 m
Total elevation gain: 50602 m
Distance: 133.3 km (82.8 miles)
Total distance: 5012.0 km (3113.7 miles)
Elevation gain: 1412 m
Total elevation gain: 52014 m
Distance: 133.3 km (82.8 miles)
Total distance: 5012.0 km (3113.7 miles)
Elevation gain: 1412 m
Total elevation gain: 52014 m
Distance: 114.2 km (70.9 miles)
Total distance: 5126.2 km (3184.7 miles)
Elevation gain: 942 m
Total elevation gain: 52956 m
Distance: 134.0 km (83.2 miles)
Total distance: 5260.2 km (3267.9 miles)
Elevation gain: 862 m
Total elevation gain: 53818 m
Distance: ()
Total distance: ()
Elevation gain:
Total elevation gain:
Distance: 102.4 km (63.6 miles)
Total distance: 5464.4 km (3394.8 miles)
Elevation gain: 804 m
Total elevation gain: 55255 m
Distance: 179.0 km (111.2 miles)
Total distance: 5643.4 km (3506.0 miles)
Elevation gain: 1002 m
Total elevation gain: 56257 m
Distance: 97.1 km (60.3 miles)
Total distance: 5740.5 km (3566.3 miles)
Elevation gain: 575 m
Total elevation gain: 56832 m
Distance: 86.3 km (53.6 miles)
Total distance: 5826.8 km (3619.9 miles)
Elevation gain: 911 m
Total elevation gain: 57743 m
Distance: 149.1 km (92.6 miles)
Total distance: 5975.9 km (3712.5 miles)
Elevation gain: 1131 m
Total elevation gain: 58874 m
Distance: 43.3 km (26.9 miles)
Total distance: 6019.2 km (3739.4 miles)
Elevation gain: 590 m
Total elevation gain: 59464 m
Distance: 101.0 km (62.7 miles)
Total distance: 6120.2 km (3802.2 miles)
Elevation gain: 701 m
Total elevation gain: 60165 m
Distance: 120.5 km (74.9 miles)
Total distance: 6240.7 km (3877.1 miles)
Elevation gain: 1176 m
Total elevation gain: 61341 m
Distance: 114.0 km (70.8 miles)
Total distance: 6354.7 km (3947.9 miles)
Elevation gain: 1288 m
Total elevation gain: 62629 m
Distance: 115.6 km (71.8 miles)
Total distance: 6470.3 km (4019.7 miles)
Elevation gain: 1410 m
Total elevation gain: 64039 m
Distance: 126.6 km (78.7 miles)
Total distance: 6596.9 km (4098.3 miles)
Elevation gain: 1330 m
Total elevation gain: 65369 m
Distance: 116.0 km (72.1 miles)
Total distance: 6712.9 km (4170.4 miles)
Elevation gain: 935 m
Total elevation gain: 66304 m
Distance: 97.7 km (60.7 miles)
Total distance: 6810.6 km (4231.1 miles)
Elevation gain: 666 m
Total elevation gain: 66970 m
Distance: 126.5 km (78.6 miles)
Total distance: 6937.1 km (4309.7 miles)
Elevation gain: 1749 m
Total elevation gain: 68719 m
Distance: 177.6 km (110.3 miles)
Total distance: 7114.7 km (4420.0 miles)
Elevation gain: 1391 m
Total elevation gain: 70110 m
Distance: 100.7 km (62.6 miles)
Total distance: 7215.4 km (4482.6 miles)
Elevation gain: 572 m
Total elevation gain: 70682 m
Distance: 57.4 km (35.7 miles)
Total distance: 7272.8 km (4518.2 miles)
Elevation gain: 134 m
Total elevation gain: 70816 m
Distance: 93.3 km (58.0 miles)
Total distance: 7366.1 km (4576.2 miles)
Elevation gain: 1145 m
Total elevation gain: 71961 m
Distance: 82.7 km (51.4 miles)
Total distance: 7448.8 km (4627.6 miles)
Elevation gain: 1299 m
Total elevation gain: 73260 m
Distance: 110.5 km (68.6 miles)
Total distance: 7559.3 km (4696.2 miles)
Elevation gain: 1502 m
Total elevation gain: 74762 m
Distance: 105.9 km (65.8 miles)
Total distance: 7665.2 km (4762.0 miles)
Elevation gain: 1465 m
Total elevation gain: 76227 m
Distance: 119.6 km (74.3 miles)
Total distance: 7784.8 km (4836.3 miles)
Elevation gain: 1499 m
Total elevation gain: 77726 m
Distance: 84.3 km (52.4 miles)
Total distance: 7869.1 km (4888.7 miles)
Elevation gain: 1229 m
Total elevation gain: 78955 m
Distance: 124.3 km (77.2 miles)
Total distance: 7993.4 km (4965.9 miles)
Elevation gain: 855 m
Total elevation gain: 79810 m
Distance: 98.4 km (61.1 miles)
Total distance: 8091.8 km (5027.1 miles)
Elevation gain: 1117 m
Total elevation gain: 80927 m
Distance: 132.1 km (82.1 miles)
Total distance: 8223.9 km (5109.1 miles)
Elevation gain: 1430 m
Total elevation gain: 82357 m
Distance: 108.6 km (67.5 miles)
Total distance: 8332.5 km (5176.6 miles)
Elevation gain: 774 m
Total elevation gain: 83131 m
Distance: 149.1 km (92.6 miles)
Total distance: 8481.6 km (5269.2 miles)
Elevation gain: 818 m
Total elevation gain: 83949 m
Distance: 175.2 km (108.8 miles)
Total distance: 8656.8 km (5378.1 miles)
Elevation gain: 400 m
Total elevation gain: 84349 m
Distance: 131.6 km (81.8 miles)
Total distance: 8788.4 km (5459.8 miles)
Elevation gain: 487 m
Total elevation gain: 84836 m
Distance: 136.4 km (84.7 miles)
Total distance: 8924.8 km (5544.6 miles)
Elevation gain: 480 m
Total elevation gain: 85316 m
Distance: 128.1 km (79.6 miles)
Total distance: 9052.9 km (5624.1 miles)
Elevation gain: 458 m
Total elevation gain: 85774 m
Distance: 119.2 km (74.1 miles)
Total distance: 9172.1 km (5698.2 miles)
Elevation gain: 1400 m
Total elevation gain: 87174 m
Distance: 108.0 km (67.1 miles)
Total distance: 9280.1 km (5765.3 miles)
Elevation gain: 2529 m
Total elevation gain: 89703 m
Distance: 70.0 km (43.5 miles)
Total distance: 9350.1 km (5808.8 miles)
Elevation gain: 1619 m
Total elevation gain: 91322 m
Distance: 86.2 km (53.6 miles)
Total distance: 9436.3 km (5862.3 miles)
Elevation gain: 1325 m
Total elevation gain: 92647 m
Distance: 36.3 km (22.6 miles)
Total distance: 9472.6 km (5884.9 miles)
Elevation gain: 138 m
Total elevation gain: 92785 m
Distance: 150.0 km (93.2 miles)
Total distance: 9622.6 km (5978.1 miles)
Elevation gain: 1737 m
Total elevation gain: 94522 m
Distance: 140.4 km (87.2 miles)
Total distance: 9763.0 km (6065.3 miles)
Elevation gain: 2223 m
Total elevation gain: 96745 m
Distance: 154.3 km (95.9 miles)
Total distance: 9917.3 km (6161.2 miles)
Elevation gain: 1809 m
Total elevation gain: 98554 m
Distance: 112.5 km (69.9 miles)
Total distance: 10029.8 km (6231.0 miles)
Elevation gain: 1899 m
Total elevation gain: 100453 m
Distance: 152.8 km (94.9 miles)
Total distance: 10182.6 km (6326.0 miles)
Elevation gain: 2281 m
Total elevation gain: 102734 m
Distance: 136.1 km (84.6 miles)
Total distance: 10318.7 km (6410.5 miles)
Elevation gain: 2140 m
Total elevation gain: 104874 m
Distance: 147.3 km (91.5 miles)
Total distance: 10466.0 km (6502.0 miles)
Elevation gain: 1842 m
Total elevation gain: 106716 m
Distance: 112.7 km (70.0 miles)
Total distance: 10578.7 km (6572.0 miles)
Elevation gain: 764 m
Total elevation gain: 107480 m
Distance: 138.5 km (86.0 miles)
Total distance: 10717.2 km (6658.1 miles)
Elevation gain: 817 m
Total elevation gain: 108297 m
Distance: 120.5 km (74.9 miles)
Total distance: 10837.7 km (6733.0 miles)
Elevation gain: 664 m
Total elevation gain: 108961 m
Distance: 108.5 km (67.4 miles)
Total distance: 10946.2 km (6800.4 miles)
Elevation gain: 1000 m
Total elevation gain: 109961 m
Distance: 146.7 km (91.1 miles)
Total distance: 11092.9 km (6891.5 miles)
Elevation gain: 1974 m
Total elevation gain: 111935 m
Distance: 141.3 km (87.8 miles)
Total distance: 11234.2 km (6979.3 miles)
Elevation gain: 881 m
Total elevation gain: 112816 m
Distance: 137.7 km (85.5 miles)
Total distance: 11371.9 km (7064.8 miles)
Elevation gain: 1182 m
Total elevation gain: 113998 m
Distance: 100.1 km (62.2 miles)
Total distance: 11472.0 km (7127.0 miles)
Elevation gain: 646 m
Total elevation gain: 114644 m
Distance: 121.8 km (75.7 miles)
Total distance: 11593.8 km (7202.7 miles)
Elevation gain: 592 m
Total elevation gain: 115236 m
Distance: 119.1 km (74.0 miles)
Total distance: 11712.9 km (7276.7 miles)
Elevation gain: 288 m
Total elevation gain: 115524 m
Distance: 83.6 km (51.9 miles)
Total distance: 11796.5 km (7328.6 miles)
Elevation gain: 423 m
Total elevation gain: 115947 m
Distance: 96.4 km (59.9 miles)
Total distance: 11892.9 km (7388.5 miles)
Elevation gain: 854 m
Total elevation gain: 116801 m
This example was made with config
:
data:
- name: '2017-06-17'
- name: '2017-06-18'
- name: '2017-06-19'
- name: '2017-06-20'
- name: '2017-06-21'
- name: '2017-06-22'
- name: '2017-06-23'
- name: '2017-06-24'
- name: '2017-06-25'
- name: '2017-06-26'
- name: '2017-06-27'
- name: '2017-06-28'
- name: '2017-06-29'
- name: '2017-06-30'
- name: '2017-07-01'
- name: '2017-07-02'
- name: '2017-07-03'
- name: '2017-07-04'
- name: '2017-07-05'
- name: '2017-07-06'
- name: '2017-07-07'
- name: '2017-07-08'
- name: '2017-07-09'
- name: '2017-07-10'
- name: '2017-07-11'
- name: '2017-07-12'
- name: '2017-07-13'
- name: '2017-07-14'
- name: '2017-07-15'
- name: '2017-07-16'
- name: '2017-07-17'
- name: '2017-07-18'
- name: '2017-07-19'
- name: '2017-07-20'
- name: '2017-07-21'
- name: '2017-07-22'
- name: '2017-07-23'
- name: '2017-07-24'
- name: '2017-07-25'
- name: '2017-07-26'
- name: '2017-07-27'
- name: '2017-07-28'
- name: '2017-07-29'
- name: '2017-07-30'
- name: '2017-07-31'
- name: '2017-08-01'
- name: '2017-08-02'
- name: '2017-08-03'
- name: '2017-08-04'
- name: '2017-08-05'
- name: '2017-08-06'
- name: '2017-08-07'
- name: '2017-08-08'
- name: '2017-08-09'
- name: '2017-08-10'
- name: '2017-08-11'
- name: '2017-08-12'
- name: '2017-08-13'
- name: '2017-08-14'
- name: '2017-08-15'
- name: '2017-08-16'
- name: '2017-08-17'
- name: '2017-08-18'
- name: '2017-08-19'
- name: '2017-08-21'
- name: '2017-08-22'
- name: '2017-08-23'
- name: '2017-08-24'
- name: '2017-08-25'
- name: '2017-08-26'
- name: '2017-08-27'
- name: '2017-08-28'
- name: '2017-08-29'
- name: '2017-08-30'
- name: '2017-08-31'
- name: '2017-09-01'
- name: '2017-09-03'
- name: '2017-09-04'
- name: '2017-09-05'
- name: '2017-09-06'
- name: '2017-09-07'
- name: '2017-09-08'
- name: '2017-09-09'
- name: '2017-09-10'
- name: '2017-09-11'
- name: '2017-09-12'
- name: '2017-09-13'
- name: '2017-09-14'
- name: '2017-09-15'
- name: '2017-09-16'
- name: '2017-09-17'
- name: '2017-09-19'
- name: '2017-09-20'
- name: '2017-09-21'
- name: '2017-09-22'
- name: '2017-09-23'
- name: '2017-09-24'
- name: '2017-09-25'
- name: '2017-09-26'
- name: '2017-09-27'
- name: '2017-09-28'
- name: '2017-09-30'
- name: '2017-10-01'
- name: '2017-10-02'
- name: '2017-10-03'
- name: '2017-10-04'
- name: '2017-10-05'
- name: '2017-10-07'
- name: '2017-10-08'
- name: '2017-10-09'
- name: '2017-10-10'
- name: '2017-10-11'
- name: '2017-10-12'
- name: '2017-10-13'
- name: '2017-10-14'
- name: '2017-10-15'
- name: '2017-10-16'
geojson:
key: name
data: geojson.lowe2017real
key: name
projection:
name: orthographic
lat: 52
lon: 10
min: 0
columns:
- name: Tooltip
template: >-
<strong>{{ name | strftime('%e %b %Y') }}</strong><br />Distance:
<strong>{{ geojson.properties.day_km }}</strong> ({{
geojson.properties.day_miles }})<br />Total distance: <strong>{{
geojson.properties.total_km }}</strong> ({{ geojson.properties.total_miles
}})<br />Elevation gain: <strong>{{ geojson.properties.elevation_gain
}}</strong><br />Total elevation gain: <strong>{{
geojson.properties.elevation_total }}</strong>
- name: colour
template: '{{ geojson.properties.stroke }}'
tooltip: Tooltip
background:
geojson: geojson.europe
colour: '#dfdfdf'
bounds:
lat:
min: 34.5
max: 71
lon:
min: -10
max: 34
{
"data": [{
"name": "2017-06-17"
},{
"name": "2017-06-18"
},{
"name": "2017-06-19"
},{
"name": "2017-06-20"
},{
"name": "2017-06-21"
},{
"name": "2017-06-22"
},{
"name": "2017-06-23"
},{
"name": "2017-06-24"
},{
"name": "2017-06-25"
},{
"name": "2017-06-26"
},{
"name": "2017-06-27"
},{
"name": "2017-06-28"
},{
"name": "2017-06-29"
},{
"name": "2017-06-30"
},{
"name": "2017-07-01"
},{
"name": "2017-07-02"
},{
"name": "2017-07-03"
},{
"name": "2017-07-04"
},{
"name": "2017-07-05"
},{
"name": "2017-07-06"
},{
"name": "2017-07-07"
},{
"name": "2017-07-08"
},{
"name": "2017-07-09"
},{
"name": "2017-07-10"
},{
"name": "2017-07-11"
},{
"name": "2017-07-12"
},{
"name": "2017-07-13"
},{
"name": "2017-07-14"
},{
"name": "2017-07-15"
},{
"name": "2017-07-16"
},{
"name": "2017-07-17"
},{
"name": "2017-07-18"
},{
"name": "2017-07-19"
},{
"name": "2017-07-20"
},{
"name": "2017-07-21"
},{
"name": "2017-07-22"
},{
"name": "2017-07-23"
},{
"name": "2017-07-24"
},{
"name": "2017-07-25"
},{
"name": "2017-07-26"
},{
"name": "2017-07-27"
},{
"name": "2017-07-28"
},{
"name": "2017-07-29"
},{
"name": "2017-07-30"
},{
"name": "2017-07-31"
},{
"name": "2017-08-01"
},{
"name": "2017-08-02"
},{
"name": "2017-08-03"
},{
"name": "2017-08-04"
},{
"name": "2017-08-05"
},{
"name": "2017-08-06"
},{
"name": "2017-08-07"
},{
"name": "2017-08-08"
},{
"name": "2017-08-09"
},{
"name": "2017-08-10"
},{
"name": "2017-08-11"
},{
"name": "2017-08-12"
},{
"name": "2017-08-13"
},{
"name": "2017-08-14"
},{
"name": "2017-08-15"
},{
"name": "2017-08-16"
},{
"name": "2017-08-17"
},{
"name": "2017-08-18"
},{
"name": "2017-08-19"
},{
"name": "2017-08-21"
},{
"name": "2017-08-22"
},{
"name": "2017-08-23"
},{
"name": "2017-08-24"
},{
"name": "2017-08-25"
},{
"name": "2017-08-26"
},{
"name": "2017-08-27"
},{
"name": "2017-08-28"
},{
"name": "2017-08-29"
},{
"name": "2017-08-30"
},{
"name": "2017-08-31"
},{
"name": "2017-09-01"
},{
"name": "2017-09-03"
},{
"name": "2017-09-04"
},{
"name": "2017-09-05"
},{
"name": "2017-09-06"
},{
"name": "2017-09-07"
},{
"name": "2017-09-08"
},{
"name": "2017-09-09"
},{
"name": "2017-09-10"
},{
"name": "2017-09-11"
},{
"name": "2017-09-12"
},{
"name": "2017-09-13"
},{
"name": "2017-09-14"
},{
"name": "2017-09-15"
},{
"name": "2017-09-16"
},{
"name": "2017-09-17"
},{
"name": "2017-09-19"
},{
"name": "2017-09-20"
},{
"name": "2017-09-21"
},{
"name": "2017-09-22"
},{
"name": "2017-09-23"
},{
"name": "2017-09-24"
},{
"name": "2017-09-25"
},{
"name": "2017-09-26"
},{
"name": "2017-09-27"
},{
"name": "2017-09-28"
},{
"name": "2017-09-30"
},{
"name": "2017-10-01"
},{
"name": "2017-10-02"
},{
"name": "2017-10-03"
},{
"name": "2017-10-04"
},{
"name": "2017-10-05"
},{
"name": "2017-10-07"
},{
"name": "2017-10-08"
},{
"name": "2017-10-09"
},{
"name": "2017-10-10"
},{
"name": "2017-10-11"
},{
"name": "2017-10-12"
},{
"name": "2017-10-13"
},{
"name": "2017-10-14"
},{
"name": "2017-10-15"
},{
"name": "2017-10-16"
}],
"geojson": {
"key": "name",
"data": "geojson.lowe2017real"
},
"key": "name",
"projection": {
"name": "orthographic",
"lat": 52,
"lon": 10
},
"min": 0,
"columns": [{
"name": "Tooltip",
"template": "<strong>{{ name | strftime('%e %b %Y') }}</strong><br />Distance: <strong>{{ geojson.properties.day_km }}</strong> ({{ geojson.properties.day_miles }})<br />Total distance: <strong>{{ geojson.properties.total_km }}</strong> ({{ geojson.properties.total_miles }})<br />Elevation gain: <strong>{{ geojson.properties.elevation_gain }}</strong><br />Total elevation gain: <strong>{{ geojson.properties.elevation_total }}</strong>"
},{
"name": "colour",
"template": "{{ geojson.properties.stroke }}"
}],
"tooltip": "Tooltip",
"background": {
"geojson": "geojson.europe",
"colour": "#dfdfdf"
},
"bounds": {
"lat": {
"min": 34.5,
"max": 71
},
"lon": {
"min": -10,
"max": 34
}
}
}
15. Projection: Aitoff§
The default projection is "web-mercator" but we can change that to Aitoff by setting the projection➝name
value to aitoff
.
This example was made with config
:
geojson:
key: ISO_A3_EH
data: geojson.world
projection:
name: aitoff
key: code
{
"geojson": {
"key": "ISO_A3_EH",
"data": "geojson.world"
},
"projection": {
"name": "aitoff"
},
"key": "code"
}
16. Projection: Equirectangular§
The default projection is "web-mercator" but we can change that to equirectangular by setting the projection➝name
value to equirectangular
. As the map would automatically adjust the size to the GeoJSON data (which doesn't have land above ~85°), we'll explicitly set the bounds to the full range of latitude/longitude.
This example was made with config
:
geojson:
key: ISO_A3_EH
data: geojson.world
projection:
name: equirectangular
key: code
bounds:
lat:
min: -90
max: 90
lon:
min: -180
max: 180
{
"geojson": {
"key": "ISO_A3_EH",
"data": "geojson.world"
},
"projection": {
"name": "equirectangular"
},
"key": "code",
"bounds": {
"lat": {
"min": -90,
"max": 90
},
"lon": {
"min": -180,
"max": 180
}
}
}
17. Projection: Gall-Peters§
The default projection is "web-mercator" but we can change that to Gall-Peters by setting the projection➝name
value to gall-peters
.
This example was made with config
:
geojson:
key: ISO_A3_EH
data: geojson.world
projection:
name: gall-peters
key: code
{
"geojson": {
"key": "ISO_A3_EH",
"data": "geojson.world"
},
"projection": {
"name": "gall-peters"
},
"key": "code"
}
18. Projection: Orthographic§
The default projection is "web-mercator" but we can change that to Orthographic by setting the projection➝name
value to orthographic
. Orthographic projection behaves as if we are viewing the Earth from a distance. Let's make a choropleth map showing total populations by country in Africa. We can rotate the globe by setting projection➝lon
.
This example was made with config
:
data:
- code: TZA
- code: B28
- code: COD
- code: SOM
- code: KEN
- code: SDN
- code: TCD
- code: ZAF
- code: LSO
- code: ZWE
- code: BWA
- code: NAM
- code: SEN
- code: MLI
- code: MRT
- code: BEN
- code: NER
- code: NGA
- code: CMR
- code: TGO
- code: GHA
- code: CIV
- code: GIN
- code: GNB
- code: LBR
- code: SLE
- code: BFA
- code: CAF
- code: COG
- code: GAB
- code: GNQ
- code: ZMB
- code: MWI
- code: MOZ
- code: SWZ
- code: AGO
- code: BDI
- code: MDG
- code: GMB
- code: TUN
- code: DZA
- code: ERI
- code: MAR
- code: EGY
- code: LBY
- code: ETH
- code: DJI
- code: UGA
- code: RWA
- code: SDS
- code: SOL
geojson:
key: BRK_A3
data: geojson.world
key: code
projection:
name: orthographic
lon: 16
scale: Viridis
value: geojson.properties.POP_EST
min: 0
max: 200000000
legend:
position: top left
items:
- value: 200000000
label: '>200m'
- value: 150000000
label: 150m
- value: 100000000
label: 100m
- value: 50000000
label: 50m
- value: 0
label: '0'
columns:
- name: Tooltip
template: >-
{{ geojson.properties.NAME_LONG }} / {{ code }}
Population ({{ geojson.properties.POP_YEAR }}): {{
geojson.properties.POP_EST | toLocaleString() }}
- name: filterLabel
template: '{{ geojson.properties.NAME_LONG }} ({{ code }})'
tooltip: Tooltip
tools:
filter:
label: filterLabel
{
"data": [{
"code": "TZA"
},{
"code": "B28"
},{
"code": "COD"
},{
"code": "SOM"
},{
"code": "KEN"
},{
"code": "SDN"
},{
"code": "TCD"
},{
"code": "ZAF"
},{
"code": "LSO"
},{
"code": "ZWE"
},{
"code": "BWA"
},{
"code": "NAM"
},{
"code": "SEN"
},{
"code": "MLI"
},{
"code": "MRT"
},{
"code": "BEN"
},{
"code": "NER"
},{
"code": "NGA"
},{
"code": "CMR"
},{
"code": "TGO"
},{
"code": "GHA"
},{
"code": "CIV"
},{
"code": "GIN"
},{
"code": "GNB"
},{
"code": "LBR"
},{
"code": "SLE"
},{
"code": "BFA"
},{
"code": "CAF"
},{
"code": "COG"
},{
"code": "GAB"
},{
"code": "GNQ"
},{
"code": "ZMB"
},{
"code": "MWI"
},{
"code": "MOZ"
},{
"code": "SWZ"
},{
"code": "AGO"
},{
"code": "BDI"
},{
"code": "MDG"
},{
"code": "GMB"
},{
"code": "TUN"
},{
"code": "DZA"
},{
"code": "ERI"
},{
"code": "MAR"
},{
"code": "EGY"
},{
"code": "LBY"
},{
"code": "ETH"
},{
"code": "DJI"
},{
"code": "UGA"
},{
"code": "RWA"
},{
"code": "SDS"
},{
"code": "SOL"
}],
"geojson": {
"key": "BRK_A3",
"data": "geojson.world"
},
"key": "code",
"projection": {
"name": "orthographic",
"lon": 16
},
"scale": "Viridis",
"value": "geojson.properties.POP_EST",
"min": 0,
"max": 200000000,
"legend": {
"position": "top left",
"items": [{
"value": 200000000,
"label": ">200m"
},{
"value": 150000000,
"label": "150m"
},{
"value": 100000000,
"label": "100m"
},{
"value": 50000000,
"label": "50m"
},{
"value": 0,
"label": "0"
}]
},
"columns": [{
"name": "Tooltip",
"template": "{{ geojson.properties.NAME_LONG }} / {{ code }}\nPopulation ({{ geojson.properties.POP_YEAR }}): {{ geojson.properties.POP_EST | toLocaleString() }}"
},{
"name": "filterLabel",
"template": "{{ geojson.properties.NAME_LONG }} ({{ code }})"
}],
"tooltip": "Tooltip",
"tools": {
"filter": {
"label": "filterLabel"
}
}
}
19. Projection: Orthographic zoomed§
Let's create an Orthographic view centred on Europe and highlight a few countries. We set the projection➝name
value to orthographic
, set the projection➝lat
and projection➝lon
of the centre of the view, then use bounds
to set an approximate latitude/longitude bounding box. To create the tooltip
we create a virtual column that uses both the data
structure (e.g. {{ code }}
) and the properties
of the geojson
file (e.g. {{ geojson.properties.POP_EST }}
).
This example was made with config
:
data:
- code: AUT
- code: BEL
- code: CHE
- code: DEU
- code: ESP
- code: FRA
- code: GBR
- code: IRL
- code: ITA
- code: LUX
- code: NLD
- code: PRT
columns:
- name: Tooltip
template: >-
{{ geojson.properties.NAME_LONG }} / {{ code }}
Population ({{ geojson.properties.POP_YEAR }}): {{
geojson.properties.POP_EST | toLocaleString() }}
key: code
tooltip: Tooltip
geojson:
key: ISO_A3_EH
data: geojson.world
scale: Viridis
value: geojson.properties.POP_EST
min: 0
projection:
name: orthographic
lat: 48
lon: 10
bounds:
lat:
min: 33
max: 60
lon:
min: -12
max: 25
{
"data": [{
"code": "AUT"
},{
"code": "BEL"
},{
"code": "CHE"
},{
"code": "DEU"
},{
"code": "ESP"
},{
"code": "FRA"
},{
"code": "GBR"
},{
"code": "IRL"
},{
"code": "ITA"
},{
"code": "LUX"
},{
"code": "NLD"
},{
"code": "PRT"
}],
"columns": [{
"name": "Tooltip",
"template": "{{ geojson.properties.NAME_LONG }} / {{ code }}\nPopulation ({{ geojson.properties.POP_YEAR }}): {{ geojson.properties.POP_EST | toLocaleString() }}"
}],
"key": "code",
"tooltip": "Tooltip",
"geojson": {
"key": "ISO_A3_EH",
"data": "geojson.world"
},
"scale": "Viridis",
"value": "geojson.properties.POP_EST",
"min": 0,
"projection": {
"name": "orthographic",
"lat": 48,
"lon": 10
},
"bounds": {
"lat": {
"min": 33,
"max": 60
},
"lon": {
"min": -12,
"max": 25
}
}
}
20. Projection: Web-Mercator§
The default projection is "web-mercator". In this example we'll display countries of the world and explicitly set the bounds
to make sure we get the full planet (otherwise the North Pole area will be cropped).
This example was made with config
:
geojson:
key: SOV_A3
data: geojson.world
key: code
bounds:
lat:
min: -90
max: 90
lon:
min: -180
max: 180
{
"geojson": {
"key": "SOV_A3",
"data": "geojson.world"
},
"key": "code",
"bounds": {
"lat": {
"min": -90,
"max": 90
},
"lon": {
"min": -180,
"max": 180
}
}
}
21. Projection: Web-Mercator zoomed§
Let's show a map of UK local authorities 2023 (ONS) using the default projection
. We could optionally set the centre of the projection using projection➝lat
and projection➝lon
but not doing so will make sure the view resembles that used in Open Street Map/Google Maps etc. We can zoom in to a portion of the map by setting bounds
. We will add a graticule with 1° spacing under the data and background layers.
This example was made with config
:
data: test.data.uk_local_authorities_2023
columns:
- name: Tooltip
template: |-
{{ geojson.properties.LAD23NM }} / {{ geojson.properties.LAD23CD }}
{{ region }} / {{ region code }}
geojson:
key: LAD23CD
data: geojson.Local_Authority_Districts_(May_2023)_UK_BUC
bounds:
lat:
min: 49.8
max: 60.8
lon:
min: -8.4
max: 2
layers:
- type: graticule
step:
- 1
- 1
- type: background
geojson: geojson.IRL
colour: '#dfdfdf'
- type: data
key: code
tooltip: Tooltip
legend:
position: bottom
items:
- label: Scotland
colour: '#2254F4'
- label: Northern Ireland
colour: '#722EA5'
- label: North East
colour: '#D60303'
- label: North West
colour: '#1DD3A7'
- label: Yorks and the Humber
colour: '#F9BC26'
- label: Wales
colour: '#0DBC37'
- label: West Midlands
colour: '#E6007C'
- label: East Midlands
colour: '#00B6FF'
- label: East of England
colour: '#FF6700'
- label: London
colour: '#D73058'
- label: South East
colour: '#67E767'
- label: South West
colour: '#178CFF'
{
"data": "test.data.uk_local_authorities_2023",
"columns": [{
"name": "Tooltip",
"template": "{{ geojson.properties.LAD23NM }} / {{ geojson.properties.LAD23CD }}\n{{ region }} / {{ region code }}"
}],
"geojson": {
"key": "LAD23CD",
"data": "geojson.Local_Authority_Districts_(May_2023)_UK_BUC"
},
"bounds": {
"lat": {
"min": 49.8,
"max": 60.8
},
"lon": {
"min": -8.4,
"max": 2
}
},
"layers": [{
"type": "graticule",
"step": [
1,
1
]
},{
"type": "background",
"geojson": "geojson.IRL",
"colour": "#dfdfdf"
},{
"type": "data",
"key": "code",
"tooltip": "Tooltip"
}],
"legend": {
"position": "bottom",
"items": [{
"label": "Scotland",
"colour": "#2254F4"
},{
"label": "Northern Ireland",
"colour": "#722EA5"
},{
"label": "North East",
"colour": "#D60303"
},{
"label": "North West",
"colour": "#1DD3A7"
},{
"label": "Yorks and the Humber",
"colour": "#F9BC26"
},{
"label": "Wales",
"colour": "#0DBC37"
},{
"label": "West Midlands",
"colour": "#E6007C"
},{
"label": "East Midlands",
"colour": "#00B6FF"
},{
"label": "East of England",
"colour": "#FF6700"
},{
"label": "London",
"colour": "#D73058"
},{
"label": "South East",
"colour": "#67E767"
},{
"label": "South West",
"colour": "#178CFF"
}]
}
}
22. Projection: OS Grid§
We can set the projection
to "osgb" which is shorthand for applying a Transverse Mercator projection centred on 49°,-2°. This replicates the look of a map shown in Ordanance Survey's National Grid coordinates. We can also add a graticule
to see longitudes/latitudes lines with 1° spacing. Outside of the UK things will look increasingly distorted.
This example was made with config
:
data: test.data.uk_local_authorities_2023
columns:
- name: Tooltip
template: |-
{{ geojson.properties.LAD23NM }} / {{ geojson.properties.LAD23CD }}
{{ region }} / {{ region code }}
geojson:
key: LAD23CD
data: geojson.Local_Authority_Districts_(May_2023)_UK_BUC
projection:
name: osgb
layers:
- type: graticule
step:
- 1
- 1
- type: data
key: code
tooltip: Tooltip
bounds:
lat:
min: 49.75
max: 61.01
lon:
min: -8
max: 3
legend:
position: bottom
items:
- label: Scotland
colour: '#2254F4'
- label: Northern Ireland
colour: '#722EA5'
- label: North East
colour: '#D60303'
- label: North West
colour: '#1DD3A7'
- label: Yorks and the Humber
colour: '#F9BC26'
- label: Wales
colour: '#0DBC37'
- label: West Midlands
colour: '#E6007C'
- label: East Midlands
colour: '#00B6FF'
- label: East of England
colour: '#FF6700'
- label: London
colour: '#D73058'
- label: South East
colour: '#67E767'
- label: South West
colour: '#178CFF'
{
"data": "test.data.uk_local_authorities_2023",
"columns": [{
"name": "Tooltip",
"template": "{{ geojson.properties.LAD23NM }} / {{ geojson.properties.LAD23CD }}\n{{ region }} / {{ region code }}"
}],
"geojson": {
"key": "LAD23CD",
"data": "geojson.Local_Authority_Districts_(May_2023)_UK_BUC"
},
"projection": {
"name": "osgb"
},
"layers": [{
"type": "graticule",
"step": [
1,
1
]
},{
"type": "data",
"key": "code",
"tooltip": "Tooltip"
}],
"bounds": {
"lat": {
"min": 49.75,
"max": 61.01
},
"lon": {
"min": -8,
"max": 3
}
},
"legend": {
"position": "bottom",
"items": [{
"label": "Scotland",
"colour": "#2254F4"
},{
"label": "Northern Ireland",
"colour": "#722EA5"
},{
"label": "North East",
"colour": "#D60303"
},{
"label": "North West",
"colour": "#1DD3A7"
},{
"label": "Yorks and the Humber",
"colour": "#F9BC26"
},{
"label": "Wales",
"colour": "#0DBC37"
},{
"label": "West Midlands",
"colour": "#E6007C"
},{
"label": "East Midlands",
"colour": "#00B6FF"
},{
"label": "East of England",
"colour": "#FF6700"
},{
"label": "London",
"colour": "#D73058"
},{
"label": "South East",
"colour": "#67E767"
},{
"label": "South West",
"colour": "#178CFF"
}]
}
}