The SVG element containing all panels.
Panel selector, chart type + per-type config, and options.
A D3MultiPanelResult with the multi-subplot MAIDR data.
Timing — call after D3 has rendered, exactly like the single-chart
binders: panel elements and their marks must exist with __data__ bound.
// One <g class="panel"> per cylinder count, each holding rect.bar marks
const result = bindD3Facets(svgElement, {
panelSelector: 'g.panel',
chartType: 'bar',
config: {
selector: 'rect.bar',
title: 'MPG by Origin, faceted by Cylinders',
axes: { x: 'Origin', y: 'MPG' },
x: 'origin',
y: 'mpg',
},
panelTitle: d => `cyl = ${d[0]}`, // d3.groups tuple
});
Binds a faceted D3 chart (homogeneous small multiples) to MAIDR.
Every element matched by
panelSelectorinside the SVG becomes one MAIDR subplot; the per-type binder selected bychartTyperuns with that panel element as its extraction root, soconfig.selector(e.g.'rect.bar') only needs to match marks within a panel.Panel display titles come from
panelTitle, resolved against each panel element's D3-bound__data__. When panels were joined withd3.groupsoutput ([key, values]tuples) or nest-style{ key, values }objects, the group key is used automatically; otherwise the fallback isPanel <n>.The grid shape follows
layoutwhen given, else panel geometry (bounding boxes, thentransform="translate(x,y)"), else a single row in DOM order. Panels are emitted in visual reading order (top-left first).