Public
Edited
Feb 17, 2024
Also listed in…
Embeddings
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

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