Published
Edited
Nov 1, 2021
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
data_incidenza = d3.json("https://covid-reports-api.herokuapp.com/incidenza")
Insert cell
Inputs.Table(data_incidenza)
Insert cell
data_vaccini = d3.json("https://covid-reports-api.herokuapp.com/vaccini")
Insert cell
Inputs.Table(data_vaccini)
Insert cell
Insert cell
d1 = Data.import({"source":data_incidenza,"type":"json"})
Insert cell
d2 = Data.import({"source":data_vaccini,"type":"json"})
Insert cell
merger = new Data.Merger();
Insert cell
final = merger
.addSource(d1, {
lookup: "pro_com_t",
columns: ["comune","incidenza","casi"],
label: ["comune","incidenza","casi"]
})
.addSource(d2, {
lookup: "pro_com_t",
columns: ["%vaccinati","%immunizzati"],
label: ["%vaccinati","%immunizzati"]
})
.realize();
Insert cell
Inputs.Table(final.json())
Insert cell
final.column("%immunizzati").map(value => {return (value<=100?value:100)})
Insert cell
Insert cell
merger_2 = new Data.Merger();
Insert cell
final_geo = merger_2
.addSource(d1, {
lookup: "pro_com_t",
columns: ["comune","pro_com_t","incidenza","casi"],
label: ["comune","pro_com_t","incidenza","casi"]
})
.addSource(d2, {
lookup: "pro_com_t",
columns: ["%vaccinati","%immunizzati"],
label: ["%vaccinati","%immunizzati"]
})
.realize();
Insert cell
Inputs.Table(final_geo.json())
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
comuni = d3.json("https://gjrichter.github.io/viz/Amministratori//comuni_2019_U.geojson")
Insert cell
Insert cell
comuni_show = Data.import({"source":comuni,"type":"geojson"})
Insert cell
Inputs.Table(comuni_show.json())
Insert cell
Insert cell
Insert cell
Inputs = require("@observablehq/inputs@0.7.21/dist/inputs.umd.min.js")
Insert cell
ixmaps = require('https://gjrichter.github.io/ixmaps/ui/js/htmlgui_api.js')
Insert cell
Data = require('https://gjrichter.github.io/data.js/data.js')
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more