Public
Edited
Sep 23, 2024
Importers
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
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
// viewof subjectsTable = {
// function link(item, field) {
// if (item.img) {
// return html`<a href="${item.img}" target="subject:img">${item[field]}</a>`;
// }

// return item[field];
// }

// const selectedSubjects = subjects.filter((s) => selectedSids.includes(s.sid));
// return Inputs.table(selectedSubjects, {
// columns: ["sid", "year", "t", "workflow"],
// format: {
// sid: (v, i, d) => link(d[i], "sid"),
// t: (v, i, d) => link(d[i], "t")
// },
// header: {
// sid: "Subject ID",
// year: "Year",
// t: "Snippet",
// workflow: "Workflow"
// },
// multiple: false,
// rows: 5.5,
// sort: "sid",
// value: selectedSubjects.length === 1 ? selectedSubjects[0] : [],
// width: {
// sid: "10%",
// year: "10%"
// }
// });
// }
// annotationsTable = {
// const subject = subjectsTable;

// if (!subject) {
// return [];
// }

// const selectedAnnotations = _.sortBy(
// annotations
// .filter(
// (a) => a.sid === subject.sid && a.workflow_id === subject.workflow_id
// )
// .flatMap((a) => Object.entries(a.T0))
// .map(([k, v]) => ({
// sid: subject.sid,
// workflow: subject.workflow,
// annotation: k,
// annotation_n: v
// }))
// );

// return Inputs.table(selectedAnnotations, {
// columns: ["annotation", "annotation_n"],
// header: {
// sid: "Subject ID",
// workflow: "Workflow",
// annotation: `Annotations for subject ${subject.sid}`,
// annotation_n: "Count"
// },
// multiple: false,
// rows: 5.5,
// sort: "sid",
// width: {
// sid: "10%"
// }
// });
// }
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
import { darken, swatches } from "@d3/working-with-color"
Insert cell
import { set } from "@observablehq/synchronized-inputs"
Insert cell
import { addTooltips } from "@mkfreeman/plot-tooltip"
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