Published
Edited
Mar 17, 2022
3 stars
Insert cell
Insert cell
Insert cell
scale = d3.scaleUtc([vizStart, vizEnd], [0, 1])
Insert cell
width = 930
Insert cell
vizStart = new Date(2022, 1, 17)
Insert cell
vizEnd = d3.timeDay.offset(vizStart, 49)
Insert cell
dataMapped = () =>
Generators.observe((notify) => {
const socket = new WebSocket("wss://dev.calyx.hr/gattaca");
socket.onmessage = (event) => {
let dataMapped = new Array();
JSON.parse(event.data).forEach((row) => {
const rowMapped = row.split("").map((d) => bases.indexOf(d));
dataMapped.push(rowMapped);
});
notify(dataMapped);
};
return () => socket.close();
})
Insert cell
framesize = 60
Insert cell
opacity = 0.85
Insert cell
//radius = Math.floor(width / framesize / 3) + 4
radius = 2
Insert cell
height = 960
Insert cell
side = 6
Insert cell
colors = ["#EF1A22", "#5C2983", "#DCD52A", "#02BDF5"]
//["#a6cee3", "#1f78b4", "#b2df8a", "#33a02c"]
Insert cell
bases = ['A','C','T','G']
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