Public
Edited
Apr 23, 2023
Insert cell
Insert cell
Insert cell
progettidb = DuckDBClient.of({
progetti: FileAttachment("progetti_universo.parquet")
})
Insert cell
import { vl } from "@vega/vega-lite-api-v5"
Insert cell
import { printTable } from "@uwdata/data-utilities"
Insert cell
Insert cell
val_num = progettidb.query(query)
Insert cell
val_num.map((d) => d.valore.toLocaleString("it-IT"))
Insert cell
Insert cell
query_settori = `
select "CUP Descrizione Sottosettore" sottosettore, count(*) conteggio,sum("Finanziamento PNRR") valore from progetti group by "CUP Descrizione Sottosettore" order by valore desc limit 10
`
Insert cell
val_settori = progettidb.query(query_settori)
Insert cell
val_settori
Type Table, then Shift-Enter. Ctrl-space for more options.

Insert cell
val_settori
X
valore
Y
sottosettore
Color
Size
Facet X
Facet Y
Mark
bar
Type Chart, then Shift-Enter. Ctrl-space for more options.

Insert cell
viewof term = Inputs.select(
val_settori.map((d) => d.sottosettore),
{ value: "SOCIALI E SCOLASTICHE", label: "Sottosettore" }
)
Insert cell
query_componenti = `
select "Descrizione Componente" componente, count(*) conteggio,sum("Finanziamento PNRR") valore from progetti
where "CUP Descrizione Sottosettore" LIKE '${term.replace(/'/g, "''")}'
group by "Descrizione Componente"
order by valore desc
`
Insert cell
viewof table_componenti = Inputs.table(val_componenti)
Insert cell
val_componenti = progettidb.query(query_componenti)
Insert cell
term
Insert cell
viewof table = Inputs.table(val_settori)

Insert cell
(123456.256).toLocaleString("it-IT")
Insert cell
Insert cell
test = val_settori.map((d) => ({
...d,
valoree: d["valore"].toLocaleString("it-IT"),
conteggioo: d.conteggio.toLocaleString("it-IT")
}))
Insert cell
arqueroTable = aq.from(val_settori)
Insert cell
arqueroTable.derive({ v_ita: (d) => d["valore"] / 5 }).view()
Insert cell
import { aq, op } from "@uwdata/arquero"
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