Published
Edited
Oct 25, 2021
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
raw_2017 = d3.csv("https://s3.eu-west-1.amazonaws.com/data.ixmaps.com/Crime/Italy/INT00062_Delitti_denunciati__-_dati_anno_2017_-_dati_Provinciali.csv")
Insert cell
Inputs.Table(raw_2017)
Insert cell
Insert cell
Insert cell
Insert cell
delitti_2017 = Data.import({"source":raw_2017,"type":"json"
}).pivot({
"lead":"Provincia",
"columns": "REATO",
"value": "TOT DELITTI COMMESSI",
"keep": ["ANNO"]
})

Insert cell
Inputs.Table(delitti_2017.json())
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
merger = new Data.Merger();
Insert cell
final = merger
.addSource(delitti_2017, {
lookup: "Provincia",
columns: ["Provincia","TOTALE DELITTI"],
label: ["Provincia","TOTALE_DELITTI_2017"]
})
.addSource(delitti_2018, {
lookup: "Provincia",
columns: ["Provincia","TOTALE DELITTI"],
label: ["Provincia","TOTALE_DELITTI_2018"]
})
.addSource(delitti_2019, {
lookup: "Provincia",
columns: ["Provincia","TOTALE DELITTI"],
label: ["Provincia","TOTALE_DELITTI_2019"]
})
.realize();
Insert cell
Inputs.Table(final.json())
Insert cell
Insert cell
Insert cell
Insert cell
province = d3.json("https://s3.eu-central-1.amazonaws.com/maps.ixmaps.com/Istat/province_2019/Province_s.geojson.gz")
Insert cell
georef = () => {
return {
"layer": "Prov2019_name",
"field": "$item$",
"field100": "",
"style": {
"type": "FEATURES|NOLEGEND|LOCKED",
"colorscheme": [
"none"],
"linecolor":"#eeeeee",
"dbtable": "PROVINCE",
"itemfield": "DEN_UTS",
"lookupfield": "geometry",
"title": "Italy Province 2019"
}
}
};
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
ixmaps = require('https://gjrichter.github.io/ixmaps/ui/js/htmlgui_api.js')
Insert cell
Inputs = require("@observablehq/inputs@0.7.21/dist/inputs.umd.min.js")
Insert cell
Data = require('https://gjrichter.github.io/data.js/data.js')
Insert cell
$ = require('https://code.jquery.com/jquery-3.3.1.min.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