Public
Edited
Jul 10, 2021
1 fork
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
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
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
mappingTable
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
jsonThunks = {
var {model, diffs} = patches;
const thunks = [];
var current = () => model;
thunks.push(current);
diffs.forEach((diff) => {
var prev = current;
{
let clone;
current = () => {
if (clone === undefined) {
clone = _.cloneDeep(prev());
rfc6902.applyPatch(clone, diff);
}
return clone;
}
}
thunks.push(current);
});
return thunks;
}
Insert cell
function groupThunk(jsonThunk) {
{
let group;
return () => {
if (group === undefined) {
const json = jsonThunk();
const model = new Model(json);
const hierarchy = postorderSort(d3.hierarchy(model).count(), compare);
const plotHeight = height - (margin.top + margin.bottom);
const percentFilled = json.X.length / patches.maxRows;
const root = d3
.treemap()
.tile(treemapCrosscat)
.size([width, plotHeight * d3.easePolyIn.exponent(0.5)(percentFilled)])
.paddingInner((d) => (d.data instanceof Model ? padding : 0))
.paddingLeft((d) => (d.data instanceof Model ? margin.left : 0))
.paddingRight((d) => (d.data instanceof Model ? margin.right : 0))
.round(true)
(hierarchy);
group = _.groupBy(root.descendants(), (node) => node.data.constructor.name);
}
return group;
}
}
}
Insert cell
groups = jsonThunks.map(groupThunk);
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