Gridviz
Gridviz is a JavaScript library to visualise gridded data (or any tabular dataset with x/y position) in the browser in a large variety of advanced cartographic styles. Unlike traditional raster-based web mapping tools, Gridviz renders everything client-side, on the fly.
Examples
- Europe - 1km resolution - GEOSTAT/GISCO
- France - 200m resolution - INSEE Filosofi
- Croatia - 1km resolution - DZS 2015 grid
- France population, dark style
- Europe population as a mosaic
Installation
Node.js
npm install gridviz
then
import * as gridviz from 'gridviz'
Or you can cherry-pick only the modules that you need, for example:
import { App, SquareColorWGLStyle } from 'gridviz'
Basic example
Hereβs a basic example that loads a CSV file of a European population grid (5km resolution):
let myApp = new gridviz.App(containerDiv)
//set position and zoom
.setGeoCenter({ x: 4500000, y: 2900000 })
.setZoomFactor(3000)
//add CSV layer
.addCSVGridLayer(
//data URL
'https://raw.githubusercontent.com/eurostat/gridviz/master/assets/csv/Europe/pop_2018_5km.csv',
//resolution, in CRS unit (m)
5000,
//the style
[
new gridviz.SquareColorWGLStyle({
//the CSV column to show
colorCol: 'Population',
//value to [0,1] mapping function
tFun: (value) => gridviz.sExp(Math.min(value / 100000, 1), -15),
}),
]
)
See the documentation page for more information.
standalone
<script src="https://unpkg.com/gridviz/dist/gridviz.min.js"></script>
Documentation
See the API reference.
About
contributors | |
version | See npm |
status | Since 2020 |
license | EUPL 1.2 |
Support and contribution
Feel free to ask support, fork the project or simply star it (it's always a pleasure).
Copyright
The Eurostat NUTS dataset is copyrighted. There are specific provisions for the usage of this dataset which must be respected. The usage of these data is subject to their acceptance. See the Eurostat-GISCO website for more information.
Disclaimer
The designations employed and the presentation of material on these maps do not imply the expression of any opinion whatsoever on the part of the European Union concerning the legal status of any country, territory, city or area or of its authorities, or concerning the delimitation of its frontiers or boundaries. Kosovo*: This designation is without prejudice to positions on status, and is in line with UNSCR 1244/1999 and the ICJ Opinion on the Kosovo declaration of independence. Palestine*: This designation shall not be construed as recognition of a State of Palestine and is without prejudice to the individual positions of the Member States on this issue.