Published
Edited
Apr 26, 2022
1 star
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
width = 600
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
cws = FileAttachment("horde.ppmi.tsv").tsv({typed: true})
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
import {Table} from "@observablehq/input-table"
Insert cell
Insert cell
searchByCw = (cw) => {
mutable selected = model.filter((token) => {
return token["_cws"].split(";").indexOf(cw) !== -1
})
}
Insert cell
cw_filtered = cws.filter((d) => Object.keys(cws_count).indexOf(d.cw) !== -1).map((d) => {
d['tokens'] = cws_count[d.cw];
return d;
})
Insert cell
cws_count = Object.fromEntries([... new Set(cws_list)].map((d) => [d, cws_list.filter((x) => x == d).length]))
Insert cell
cws_list = selected.map((d) => d["_cws"]).join(";").split(";")
Insert cell
mutable selected = []
Insert cell
mutable hovering = "Hover a token to read its context"
Insert cell
mutable target_color = "black"
Insert cell
color_values = [...new Set(model.map((d) => d[colorcoding]))]
Insert cell
colorlist = color_values.map((d) => {return `<li style="color:${color(d)};">${d}</li>`}).join("")
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