Public
Edited
Feb 17, 2024
Insert cell
Insert cell
Insert cell
Insert cell
Plot.plot({
color: {legend:true, scheme: 'Turbo'},
marginLeft:100,
marginBottom:50,
marginRight:50,
marginTop:50,
height: 600,
width: 1200,
// x: {axis: null},
// y: {axis: null},
marks: [
Plot.dot(
fixed, {
x: d=>d[0], y: d=>d[1],
fill: (d,i) => i > data.length ? 'red' : 'grey',
r: 3,
title: (d,i) => i > data.length ?
`Title:${test_meta.concat(test_meta_lhd)[i][0]}\nField of Study:${test_meta.concat(test_meta_lhd)[i][1]}` :
null,
fillOpacity: 0.3,
strokeOpacity: 0.3,
tip: true
}),
Plot.density(fixed, { x: d=>d[0], y: d=>d[1], bandwidth, thresholds, strokeWidth: 0.1})
]
})
Insert cell
cat2id = {
let out = {};
let uniq_fos = _.uniqBy(test_meta.map(d=>d[1]));
for (let i = 0; i < uniq_fos.length; i++) {
out[uniq_fos[i]] = i
}
return out
}
Insert cell
test_meta = FileAttachment("test_meta@4.json").json()
Insert cell
test_meta_lhd = FileAttachment("test_meta_lhd.json").json()
Insert cell
Insert cell
UMAP = import("https://cdn.skypack.dev/umap-js@1.3.3").then((d) => d.UMAP)
Insert cell
fixed = new UMAP({
nComponents: 2,
minDist: 0.1,
nNeighbors: 15
})
Insert cell
// fixed_lhd = new UMAP({
// nComponents: 2,
// minDist: 0.1,
// nNeighbors: 15
// }).fit(data_lhd)
Insert cell
data = FileAttachment("test@4.json").json()
Insert cell
data_lhd = FileAttachment("test_lhd.json").json()
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell

One platform to build and deploy the best data apps

Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Learn more