Public
Edited
Jan 9, 2024
1 fork
Importers
Insert cell
Insert cell
Insert cell
getNuclides()
Insert cell
getSampleTypes()
Insert cell
getBiogroups()
Insert cell
Insert cell
// seawater example
// params = ({
// sampleTypeId: 1,
// nuclideId: "1",
// samplingDepthFrom: 0.5,
// samplingDepthTo: 0.8,
// samplingDateFrom: "2000-01-01",
// samplingDateTo: "2015-01-01"
// })
Insert cell
// Seawater example
params = ({
sampleTypeId: 1,
nuclideId: "33", // 137Cs
samplingDateFrom: "2000-01-01",
samplingDateTo: "2015-01-01"
})
Insert cell
getMeasurementData(params)
Insert cell
Insert cell
// luts = ({ nuclides: lutNuclides() })
Insert cell
// luts.nuclides
Insert cell
// {
// let countries = (
// await d3Fetch.tsv("https://unpkg.com/world-atlas@1/world/110m.tsv")
// )
// .sort((a, b) => b.pop_est - a.pop_est) // Sort by descending estimated population.
// .slice(0, 10); // Take the top ten.
// return countries;
// }
Insert cell
lutArray = d3.json(`${lookupEndPoint}/NuclideLookup/getAll`)
Insert cell
// lutNuclides = lutArray.reduce((acc, obj) => {
// acc[obj.nuclide_Id] = obj.nusymbol;
// return acc;
// }, {})
Insert cell
async function fetchLut(endpoint, id, name) {
const data = await d3.json(endpoint);
return data.reduce((acc, obj) => {
acc[obj[id]] = obj[name];
return acc;
}, {});
}
Insert cell
luts = ({
nuclides: fetchLut(
`${lookupEndPoint}/NuclideLookup/getAll`,
"nuclide_Id",
"nusymbol"
)
})
Insert cell
luts.nuclides
Insert cell
// function fetchLut() {
// return d3.json(`${lookupEndPoint}/NuclideLookup/getAll`);
// }
Insert cell
function getSampleTypes() {
return d3.json(`${lookupEndPoint}/SampTypeLookup/getAll`);
}
Insert cell
function getBiogroups() {
return d3.json(`${lookupEndPoint}/BioGroupLookup/getAll`);
}
Insert cell
function getMeasurementData(params) {
return d3.json(`${measurementEndPoint}?${paramsToQueryString(params)}`);
}
Insert cell
measurementEndPoint = "https://maris-uat.iaea.org/api/Search/getMeasurementData"
Insert cell
lookupEndPoint = "https://maris.iaea.org/api"
Insert cell
function paramsToQueryString(obj) {
return Object.entries(obj)
.map(([key, value]) => {
return `${encodeURIComponent(key)}=${encodeURIComponent(value)}`;
})
.join("&");
}
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