d3.stackOrderInsideOut is a D3 stack ordering constant. It places series with the earliest peak near the chart’s center and series with later peaks toward the outside, producing a visually balanced arrangement. section 5.2.4
Use this order when:
- Building a streamgraph whose shapes should distribute around a central baseline. section 5.2.4
- Combining order() with an offset() such as d3.stackOffsetSilhouette to control both stacking sequence and baseline position. section 5.2.4
Configure a centered streamgraph
const stackGenerator = d3.stack() .keys(formatsInfo.map(f => f.id)) .order(d3.stackOrderInsideOut) .offset(d3.stackOffsetSilhouette); section 5.2.4
Figure 5.19 D3 allows controlling the order in which the shapes are stacked with the order() accessor function. Here we see examples with stacked areas, but the same principles apply to stacked bar charts.
Compare how different order() choices change the arrangement of stacked areas; the same ordering principles apply to stacked bars. section 5.2.4
