Published
Edited
Jul 23, 2020
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
keys = data.columns.slice(1)
Insert cell
x = new Map(
Array.from(
keys,
key => [key, d3.scaleLinear(d3.extent(data, d => d[key]), [params.margin.left, params.svg.width - params.margin.right])]
)
)
Insert cell
y = d3.scalePoint(keys, [params.margin.top, params.svg.height - params.margin.bottom])
Insert cell
z = d3.scaleSequential(x.get(keyz).domain().reverse(), d3.interpolateRdYlBu)
Insert cell
mutable params = {
let output = {};
output["svg"] = {
"width": 954,
"height": 600
};
output["margin"] = {
"top": 72,
"right": 24,
"bottom": 72,
"left": 24
};
output["plot"] = {
"x": output["margin"]["left"],
"y": output["margin"]["top"],
"width": output["svg"]["width"] - output["margin"]["left"] - output["margin"]["right"],
"height": output["svg"]["height"] - output["margin"]["top"] - output["margin"]["bottom"]
};

return output;
}
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