Notes
You can either read in an existing HexJSON file or start creating your own hex cartogram from a CSV file. The CSV should contain a column with the heading id
that uniquely identifies each hex. Other columns will be added as properties of each hex. You can specify the position of the hex using the column headings q
and r
. A column with the heading n
or name
will set the displayed name of the hex. You can optionally colour the hexagons by including a column headed colour
.
Colouring hexagons
If you have one or more hexagons selected you can choose to change their default colour by using the colour picker tool that appears in the top right of the screen.
Moving hexagons
To move one or more hexagons you must first select them then click in an empty hex in the grid. Pressing c
on your keyboard will select all hexagons of the same colour or you can use the Select by colour
in the colour picker at the top right. When you have everything where you want it, save the output. Note that this tool is for creating layouts rather than fully interactive visualisations.
Using existing layouts
We already know about defined hex layouts for UK local authorities, UK Parliamentary constituencies, UK NUTS3 regions, UK Upper Tier Local Authorities, MSOAs, NHS Integrated Care Boards, and US States. If you have a CSV that appears to have a column with codes for one of those, the Builder will try to load an existing hex map layout for you and add the data to that. That means you can use this tool as a simple visualisation tool for CSV files on the web too. For instance, there is a CSV of US State data on Github which has state 2-letter codes so we can load it straight into the Builder and show US States coloured by admission number. You can build your own links to this tool of the form:
https://open-innovations.org/projects/hexmaps/builder.html?https://raw.githubusercontent.com/odileeds/covid-19/main/vaccines/data/vaccinations-MSOA-latest.csv&attribute=admission_number&colourscale=Viridis&labels=false&keepmissing=false
where you can replace https://raw.githubusercontent.com/odileeds/covid-19/main/vaccines/data/vaccinations-MSOA-latest.csv
with the URL of a CSV file and you can add the following properties:
attribute=
is the column heading for the column to use for the colour scale - we can cope with numeric valus and ISO8601 dates
borders=
can be set to true
or false
to turn the hex borders on or off
colourscale=
is one of our named colour scales ()
labels=
can be set to true
or false
to turn the hex labels on or off - turning them off can speed up rendering time for big maps
keepmissing=
can be set to true
or false
to show or not show hexes that aren't referred to in the data
Using data in a Google Sheet
If you have data in a publicly-visible Google Sheet you can add the parameter gsheetid=1hqFqAyRp7JfHu7jmZK-tBtiU89B28rgfTKHofK16PMw
(replace 1hqFqAyRp7JfHu7jmZK-tBtiU89B28rgfTKHofK16PMw
with your Sheet ID) to the URL and the Builder will construct the CSV export URL for you e.g. load a simple Google Sheet, hide hex labels, and remove hex borders
https://open-innovations.org/projects/hexmaps/builder.html?gsheetid=1hqFqAyRp7JfHu7jmZK-tBtiU89B28rgfTKHofK16PMw&attribute=Date&labels=false&borders=false
Exporting the map
You can export the map in four ways:
- HexJSON. This is the prefered output as it can be loaded back in to this tool again.
- SVG. This will save the image created in the browser. If you output as SVG you won't be able to load it back into this tool.
- GeoJSON. A cartogram is not geographic but some people have requested "geographic formats" so they can use these hex cartograms with specific GIS software. To make it "geographic" we've done a very simple projection at Null Island (0°, 0°) keeping the result to approximately 0.1°×0.1° to try to reduce distortions. If you output as GeoJSON you won't be able to load it back into this tool.
- PNG. This will save the map (without the grid) as an image that you can use elsewhere. You won't be able to load it back into this tool but it is useful for screenshots.
Credits
© 2017-22
Open Innovations. Released under an MIT license.
Source on Github.