Public
Edited
Dec 19, 2023
Importers
Insert cell
Insert cell
institusjoner.view()
Insert cell
Insert cell
ntnuemner[0]
Insert cell
ntnuemner = fetch("https://grades.no/api/v2/courses/?limit=5").then((d) =>
d.json()
)
Insert cell
Insert cell
emner.objects()[900]
Insert cell
emner.view()
Insert cell
emner = getData({
tabell_id: 208,
api_versjon: 1,
statuslinje: "N",
begrensning: "10000",
kodetekst: "J",
desimal_separator: ".",
variabler: ["*"],
sortBy: ["Institusjonskode"],
filter: [
{
variabel: "Institusjonskode",
selection: {
filter: "all",
values: ["*"],
exclude: [""]
}
}
]
})
Insert cell
Insert cell
campus = getData({
tabell_id: 662,
api_versjon: 1,
statuslinje: "N",
begrensning: "10000",
kodetekst: "J",
desimal_separator: ".",
variabler: ["*"],
sortBy: ["Institusjonskode"],
filter: [
{
variabel: "Institusjonskode",
selection: {
filter: "all",
values: ["*"],
exclude: [""]
}
},
{
variabel: "Årstall",
selection: {
filter: "top",
values: ["0"],
exclude: [""]
}
}
]
})
Insert cell
campus.view()
Insert cell
institusjoner = getData({
tabell_id: 211,
api_versjon: 1,
statuslinje: "N",
begrensning: "10000",
kodetekst: "J",
desimal_separator: ".",
variabler: ["*"],
sortBy: ["Institusjonskode"],
filter: [
{
variabel: "Institusjonskode",
selection: {
filter: "all",
values: ["*"],
exclude: [""]
}
}
]
})
Insert cell
inst.view({ rows: 100 })
Insert cell
inst = tilsatte
.rename({ "Antall totalt": "Ansatte" })
.select("Institusjonskode", "Institusjonsnavn", "Årstall", "Ansatte")
.join_full(
studenter
.rename({ "Antall totalt": "Studenter" })
.select("Institusjonskode", "Institusjonsnavn", "Årstall", "Studenter")
)
.filter((d) => d.Studenter > 0)
.filter((d) => d.Ansatte > 0)
Insert cell
tilsatte.view()
Insert cell
studenter.view()
Insert cell
studenter = getData({
tabell_id: 123,
api_versjon: 1,
statuslinje: "N",
begrensning: "10000",
kodetekst: "J",
desimal_separator: ".",
groupBy: ["Institusjonskode", "Årstall"],
sortBy: ["Institusjonskode"],
filter: [
{
variabel: "Institusjonskode",
selection: {
filter: "all",
values: ["*"],
exclude: [""]
}
},
{
variabel: "Årstall",
selection: {
filter: "top",
values: ["1"],
exclude: [""]
}
}
]
})
Insert cell
tilsatte = getData({
tabell_id: 222,
api_versjon: 1,
statuslinje: "N",
begrensning: "10000",
kodetekst: "J",
desimal_separator: ".",
groupBy: ["Institusjonskode", "Årstall"],
sortBy: ["Institusjonskode"],
filter: [
{
variabel: "Institusjonskode",
selection: {
filter: "all",
values: ["*"],
exclude: [""]
}
},
{
variabel: "Årstall",
selection: {
filter: "top",
values: ["1"],
exclude: [""]
}
}
]
})
Insert cell
getData = (query) => {
const api_base = "https://dbh.hkdir.no/api/Tabeller/";
return fetch(api_base + "hentJSONTabellData", {
method: "POST",
body: JSON.stringify(query, undefined, 2),
headers: {
Accept: "application/json",
"Content-Type": "application/json"
}
})
.then((res) => res.json())
.then((data) => {
return aq.from(data);
});
}
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