Public
Edited
Feb 15, 2023
1 fork
1 star
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
title_search_subset
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
subset_db = {
if (title_search_subset == undefined) {
return DuckDBClient.of({
simple: [{x: '', y: '', topic: '', field: '', title: '', year: '', citationCount: ''}]
})
} else {
return DuckDBClient.of({
simple: await db.query(`SELECT * FROM umap WHERE ( contains(lower(title), lower('${title_search}')))`)
})
}
}
Insert cell
function getTitleCase(str) {
return str.split('-').map(d => d.charAt(0).toUpperCase() + d.slice(1).toLowerCase()).join('-')
}
Insert cell
reset, chart.reset()
Insert cell
umap_embedding2
Insert cell
grid = (g, x, y) => g
.attr("stroke", "currentColor")
.attr("stroke-opacity", 0.1)
.call(g => g
.selectAll(".x")
.data(x.ticks(12))
.join(
enter => enter.append("line").attr("class", "x").attr("y2", height),
update => update,
exit => exit.remove()
)
.attr("x1", d => 0.5 + x(d))
.attr("x2", d => 0.5 + x(d)))
.call(g => g
.selectAll(".y")
.data(y.ticks(12 * k))
.join(
enter => enter.append("line").attr("class", "y").attr("x2", width),
update => update,
exit => exit.remove()
)
.attr("y1", d => 0.5 + y(d))
.attr("y2", d => 0.5 + y(d)));
Insert cell
k = height / width
Insert cell
height = 600
Insert cell
db2 = DuckDBClient.of({
data: FileAttachment("broido_embedding_doc@2.parquet")
})
Insert cell
umap_embedding2 = db2.sql`
SELECT *
FROM data
`
Insert cell
extent_x = d3.extent(umap_embedding2, d => d.x)
Insert cell
extent_y = d3.extent(umap_embedding2, d => d.y)
Insert cell
import {debounce} from "@mbostock/debouncing-input"
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