Public
Edited
Apr 3, 2022
1 star
Insert cell
Insert cell
<svg width=1000 height=750>
<style>
.mapGrid {stroke: #ccc;}
.mapGridLabel {fill: white; font-size: 8px; font-family: Arial,Helvetica,sans-serif; dominant-baseline: central;}
</style>
</svg>
Insert cell
gridWorldD3 = d3.select(gridWorldMapContainer)
Insert cell
worldGridData = FileAttachment("worldGridMapData.json").json()
Insert cell
import {gridMap} from "@emfielduva/dvlib_maps"
Insert cell
wgoptions = ({
rowField: "y",
colField: "x",
labelField: "alpha3",
boxSize: 30
})
Insert cell
worldGridMap = gridMap(gridWorldD3,"worldgrid",worldGridData,wgoptions)
Insert cell
Insert cell
happinessData = FileAttachment("Happiness compare.csv").csv()
Insert cell
colorScale = d3.scaleLinear().domain([0,10]).range(["red","green"])
Insert cell
import {colorByID} from "@emfielduva/dvlib"
Insert cell
colorByID
Insert cell
colorByID(worldGridMap,happinessData,"alpha3","ISO","happiness",'',colorScale)
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.
Learn more