Published
Edited
Aug 11, 2020
2 stars
Insert cell
Insert cell
text = FileAttachment("donor_10.15_tissues.200_genes.txt").text()
Insert cell
Insert cell
Insert cell
data = d3.tsvParse(text, d3.autoType)
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
DOM.download(() => serialize(chart), 'donor_10', "Save as SVG")
Insert cell
chart = {
const svg = d3.select(DOM.svg(width, 350 * grids.length + margin.top + margin.bottom))
.style("font", "20px sans-serif")

const block = svg.append("g")
.selectAll("g")
.data(grids)
.enter().append("g")
.classed("block", true)
.attr("transform", (d, i) => `translate(0,${i * 350 + margin.top})`)
block.append("text")
.text(d => d.name)
.classed("label", true)
.attr("x", margin.left)
.attr("y", -6)
const row = block.append("g")
.selectAll("g")
.data(d => d.values)
.enter().append("g")
.classed("row", true)
.attr("transform", (d, i) => `translate(0,${i * gridSize + i})`)
.each(multiple)

return svg.node()
}
Insert cell
Insert cell
Insert cell
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