Public
Edited
May 2, 2024
Insert cell
Insert cell
Insert cell
arrayData = {const arrayData = [];

for (const key in json) {
arrayData.push({ key, value: json[key] });
}

return arrayData};
Insert cell
geneArray = {
let geneArray = json.Genes
return geneArray
};
Insert cell
chart = [
{geneId:'a', start:1 , annotation:true},
{geneId:'a', start:2 , annotation:false},
{geneId:'a', start:3 , annotation:false},
]
Insert cell
Plot.plot({
marks: [
Plot.cell(chart, {
x: d => d.start,
y: d => d.geneID,
fill: d => d.annotation
})
]
})
Insert cell
viewof range = Inputs.range([0, 100], {label: "Amount", step: 1})
Insert cell
Plot.plot({
marks: [
Plot.cell(geneArray.slice(-20), {
x: d => [d.Start, d.AvailableStarts],
y: d => d.GeneID,
fill: d => d.Start === d.Start ? "green" : "yellow",
})
],
x: {label: "Start Position"},
y: {label: "GeneID"},
});
Insert cell
color ={
{Start: "green"}
{AvailableStart: "yellow"}
}
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