3.0.7 • Published 1 month ago

gridviz v3.0.7

Weekly downloads
4
License
EUPL-1.2
Repository
github
Last release
1 month ago

Gridviz

npm bundle size npm license

Gridviz is a JavaScript library for visualizing gridded data (or any tabular dataset with x/y coordinates for that matter) in the browser using a large variety of cartographic styles and techniques. Unlike traditional raster-based web mapping tools, Gridviz renders everything client-side, on the fly.

Styles

Visit the style gallery to see the different customisable styles available for visualizing gridded data with gridviz.

Live Demos

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 { Map, SquareColorWebGLStyle } from 'gridviz'

Basic example

Here’s a basic example that loads a CSV file of a European population grid (5km resolution):

//define map with initial view
const map = new gridviz.Map(document.getElementById('map'), { x: 4500000, y: 2900000, z: 3000 })

//define dataset
const dataset = new gridviz.CSVGrid(map, "https://raw.githubusercontent.com/eurostat/gridviz/master/assets/csv/Europe/pop_2018_10km.csv", 10000)

//define color for each cell
const colorFunction = (cell) => {
    if (cell.population > 150000) return "#993404"
    else if (cell.population > 60000) return "#d95f0e"
    else if (cell.population > 20000) return "#fe9929"
    else if (cell.population > 6000) return "#fec44f"
    else if (cell.population > 1500) return "#fee391"
    else return "#ffffd4"
}

//define style
const style = new gridviz.ShapeColorSizeStyle({ color: colorFunction })

//add layer to map
map.layers = [new gridviz.GridLayer(dataset, [style])]

See the documentation page for more information.

standalone

<script src="https://unpkg.com/gridviz/dist/gridviz.min.js"></script>

Documentation

See the gridviz documentation page.

The document of the previous version 2.

Grid tiling

In order to visualize large grids efficiently, you can produce tiled grids in a tiled grid format with GridTiler.

About

contributors
versionSee npm
statusSince 2020
licenseEUPL 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.

3.0.7

1 month ago

3.0.6

1 month ago

3.0.4

2 months ago

3.0.5

2 months ago

3.0.3

3 months ago

3.0.2

4 months ago

3.0.1

5 months ago

3.0.0

5 months ago

2.1.9

6 months ago

2.1.16

5 months ago

2.1.17

5 months ago

2.1.14

6 months ago

2.1.15

5 months ago

2.1.12

6 months ago

2.1.13

6 months ago

2.1.10

6 months ago

2.1.11

6 months ago

2.1.2

6 months ago

2.1.1

6 months ago

2.1.4

6 months ago

2.1.3

6 months ago

2.1.6

6 months ago

2.1.5

6 months ago

2.1.8

6 months ago

2.1.7

6 months ago

2.0.52

8 months ago

2.1.0

7 months ago

2.0.48

9 months ago

2.0.49

8 months ago

2.0.47

9 months ago

2.0.51

8 months ago

2.0.50

8 months ago

2.0.28

10 months ago

2.0.29

10 months ago

2.0.37

10 months ago

2.0.38

10 months ago

2.0.35

10 months ago

2.0.36

10 months ago

2.0.33

10 months ago

2.0.34

10 months ago

2.0.31

10 months ago

2.0.32

10 months ago

2.0.39

10 months ago

2.0.46

9 months ago

2.0.44

10 months ago

2.0.45

10 months ago

2.0.42

10 months ago

2.0.43

10 months ago

2.0.40

10 months ago

2.0.41

10 months ago

2.0.26

10 months ago

2.0.27

10 months ago

2.0.24

10 months ago

2.0.25

10 months ago

2.0.22

11 months ago

2.0.23

10 months ago

2.0.20

12 months ago

2.0.21

11 months ago

2.0.19

12 months ago

2.0.17

12 months ago

2.0.18

12 months ago

2.0.15

1 year ago

2.0.16

1 year ago

2.0.13

1 year ago

2.0.14

1 year ago

2.0.12

1 year ago

2.0.11

1 year ago

2.0.9

1 year ago

2.0.10

1 year ago

2.0.8

2 years ago

2.0.3

2 years ago

2.0.2

2 years ago

2.0.5

2 years ago

2.0.4

2 years ago

2.0.7

2 years ago

2.0.6

2 years ago

2.0.1

2 years ago

2.0.0

2 years ago

1.2.4

3 years ago

1.2.3

3 years ago

1.2.2

3 years ago

1.2.1

3 years ago

1.2.0

3 years ago

1.1.15

3 years ago

1.0.15

3 years ago

1.0.14

3 years ago

1.0.12

3 years ago

1.0.11

3 years ago

1.0.10

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago