Platform
Solutions
Resources
Pricing
Sign in
Sign up
jgaffuri
GIS and cartography at Eurostat
Workspace
Fork
Public
By
jgaffuri
Edited
May 4, 2024
MIT
Fork of
Hello gridviz
1 star
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
map
=
new
g
.
Map
(
container
,
{
x
:
4500000
,
y
:
2900000
,
z
:
3000
}
)
.
addZoomButtons
(
)
Insert cell
dataset
=
new
g
.
MultiResolutionDataset
(
[
1000
,
2000
,
5000
,
10000
,
20000
,
50000
,
100000
]
,
(
resolution
)
=>
new
g
.
TiledGrid
(
map
,
"https://raw.githubusercontent.com/jgaffuri/tiled-grid-lucas/main/out/"
+
resolution
+
"m/"
)
)
Insert cell
colorScale
=
d3
.
interpolatePuBuGn
//interpolateRdPu //interpolateYlGnBu //interpolateYlOrRd
Insert cell
style
=
new
g
.
ShapeColorSizeStyle
(
{
color
:
(
cell
,
resolution
,
z
,
[
min
,
max
]
)
=>
colorScale
(
cell
.
COUNT_POINT_ID
/
max
)
,
viewScale
:
(
cells
)
=>
d3
.
extent
(
cells
,
(
cell
)
=>
+
cell
.
COUNT_POINT_ID
)
}
)
Insert cell
layer
=
new
g
.
GridLayer
(
dataset
,
[
style
]
,
{
minPixelsPerCell
:
2
,
cellInfoHTML
:
(
c
,
resolution
)
=>
"Number of visits: "
+
c
.
COUNT_POINT_ID
+
"<br>(per "
+
d3
.
format
(
",.2r"
)
(
resolution
*
resolution
*
1e-6
)
+
" km²)"
}
)
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
{
map
.
layers
=
[
backgroundLayer1
,
backgroundLayer2
,
layer
,
boundariesLayer
,
labelLayer
]
;
}
Insert cell
{
backgroundLayer1
.
visible
=
(
z
)
=>
showBackground
&&
z
>=
50
;
backgroundLayer2
.
visible
=
(
z
)
=>
showBackground
&&
z
<
50
;
boundariesLayer
.
visible
=
(
)
=>
showBoundaries
;
labelLayer
.
visible
=
(
)
=>
showLabels
;
map
.
redraw
(
)
;
}
Insert cell
g
=
require
(
"gridviz@3.0.7"
)
Insert cell
ges
=
require
(
"gridviz-eurostat@2.0.0"
)
Insert cell
One platform
to build and deploy the best data apps
Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Try it for free
Learn more
Compare fork
Fork
View
Export
container
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
showBackground
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
showBoundaries
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
showLabels
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
map
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
dataset
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
colorScale
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
style
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
layer
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
backgroundLayer1
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
backgroundLayer2
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
boundariesLayer
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
labelLayer
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
g
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
ges
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML