Modifiers
Modifiers are functions of the options of a mark: they return new options, for drawing only, in pixels. Pass the result to flow.add, such as .add(cm.rect, cm.insetX(0.5, {fill: "steelblue"})).
const data = await d3.csv("/data/seattle-weather.csv", d3.autoType);
const renderer = cm.svg({width: 640});
const root = cm.flow().renderer(renderer);
root
.data(data)
.transform(cm.encode, {x: (d) => d.date.getUTCDate(), y: (d) => d.date.getUTCMonth() + 1, fill: "temp_max"})
.transform(cm.group, {fill: "max"})
.transform(cm.spreadX, {padding: 0})
.transform(cm.spreadY, {padding: 0})
.transform(cm.plane, {x: {label: "Day"}, y: {label: "Month"}, fill: {scheme: "magma", legend: true}})
.add(cm.rect, cm.inset(1));
root.render();
document.body.append(renderer.node());cm.inset(k, [options])
Returns the options of a mark with its box, from x to x1 and y to y1, shrunk by k on each side, like Plot's inset, such as the gaps between the cells of a heatmap with cm.rect, or the dots of a unit chart with cm.circle, which fits its box. k is pixels, or a percentage of the box, such as "10%". The positions given in options apply first; the other options pass through. A box thinner than the inset collapses to its middle.
cm.insetX(k, [options])
Like cm.inset, on the left and right only, such as the bars of a histogram.
cm.insetY(k, [options])
Like cm.inset, on the top and bottom only, such as the bars of a horizontal histogram.