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