Public
Edited
May 28, 2024
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
Object.assign(
Plot.plot({
height: 15000,
width: 500,
caption: "",
marginTop: 40,
marginRight: 20,
marginLeft: 100,
marginBottom: 30,
padding: 0,
color: { scheme: "YlGnBu" },
style: { "font-size": 10, fontstroke: "#91bfdb", maxWidth: "20000px" },
x: {
type: "band",
label: "Imaging at timepoint available",
paddingInner: 0.1,
domain: [
"ses-clinical",
"ses-study-MR",
"18-mon-follow-up",
"36-mon-follow-up"
]
},
y: {
type: "band",
padding: 0.15,

label: "All NorCOAST subjects"
},
marks: [
Plot.cell(timepoinst_data, {
x: "timepoint",
y: "subject-id",
fill: "count"
}),
Plot.text(timepoinst_data, {
x: "timepoint",
y: "subject-id",
text: "timepoint"
}),
Plot.gridX({ stroke: "#0868a3" }),
Plot.gridY({ stroke: "#0868a3" })
]
}),
{
style: `max-width: ${width}px; overflow: scroll; max-height: 700px; overflow-y: scroll`
}
)
Insert cell
Insert cell
Insert cell
Object.assign(
Plot.plot({
height: 15000,
caption: "",
width: 2000,
marginTop: 40,
marginRight: 20,
marginLeft: 100,
marginBottom: 30,
padding: 0,
color: { scheme: "YlGnBu" },
style: { "font-size": 10, fontstroke: "#91bfdb", maxWidth: "20000px" },
x: {
type: "band",
label: "Available Imaging Data",
paddingInner: 0.1,
domain: [
"CT-1",
"CT-2",
"CTA",
"DWI",
"ADC",
"3D-T1",
"3D-FLAIR",
"T1",
"T2",
"T2-FLAIR"
]
},
fx: {
domain: [
"ses-clinical",
"ses-study-MR",
"18-mon-follow-up",
"36-mon-follow-up"
]
},
facet: { data: summary, x: "timepoint" },
y: {
type: "band",
padding: 0.15,

label: "All NorCOAST subjects"
},
marks: [
Plot.cell(summary, {
x: "modality",
y: "subject-id",
fill: "count"
}),
Plot.text(summary, { x: "modality", y: "subject-id", text: "modality" }),
Plot.gridX({ stroke: "#0868a3" }),
Plot.gridY({ stroke: "#0868a3" })
]
}),
{
style: `max-width: ${width}px; overflow: scroll; max-height: 700px; overflow-y: scroll`
}
)
Insert cell
Insert cell
Insert cell
timepoinst_data = aq_bas.groupby("subject-id", "timepoint").rollup({
count: op.count("timepoint")
})
Insert cell
timepoinst_data1 = aq_bas
.groupby("subject-id", "timepoint")
.rollup({
count: op.count("timepoint")
})
.view()
Insert cell
Object.assign(
Plot.plot({
height: 15000,
width: 200,
caption: "",
marginTop: 40,
marginRight: 20,
marginLeft: 100,
marginBottom: 30,
padding: 0,
color: { scheme: "YlGnBu" },
style: { "font-size": 10, fontstroke: "#91bfdb", maxWidth: "20000px" },
marks: [
Plot.dot(unique_timepoints_per_subject, {
x: "timepoint",
y: "subject-id"
})
]
}),
{
style: `max-width: ${width}px; overflow: scroll; max-height: 700px; overflow-y: scroll`
}
)
Insert cell
unique_timepoints_per_subject = lodash.uniqWith(unique_input, lodash.isEqual)
Insert cell
unique_input = data.map((d) => ({
"subject-id": d["subject-id"],
timepoint: d.timepoint
}))
Insert cell
lodash = require("lodash")
Insert cell
sub_time = data.map((d) => ({
subject_id: d["subject-id"],
timepoint: d.timepoint
}))
Insert cell
aq_bas = aq.from(data)
Insert cell
import { aq, op } from "@uwdata/arquero"
Insert cell
Insert cell
Insert cell
Insert cell
bianca_filtered = aq_bianca.filter((d) =>
op.startswith(d["subject-id"], "sub-")
)
Insert cell
aq_bianca = aq.from(bianca)
Insert cell
bianca = d3.csv(
"https://raw.githubusercontent.com/landge/NorCOAST_Imaging_Dataset/master/code/freesurfer_and_bianca_results.csv?token=GHSAT0AAAAAACS4BQ5SZX6M5GMFUGIA45DKZSVUZHQ"
)
Insert cell
Type HTML, then Shift-Enter. Arrow ↑/↓ to switch modes.

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