{#snippet defaultHeader( lane: Lane, row: StackRow | undefined )} {@const value = totalOf(row)} {@const sofar = row?.key === partial} {@const ratio = row && lane.typical && !sofar ? versus(value, lane.typical) : null} {@const dot = row ? lane.dots?.[row.key] : undefined} {lane.label} {#if row} {title(row)} {lane.format(value)} {#if sofar} so far {:else if ratio !== null} {versusText(ratio)} {/if} {/if} {#if lane.typical} typical {lane.format(lane.typical)} {/if} {#if dot} {dotLabel} {lane.format(dot)} {/if} {/snippet}
{#if legend && sharedKeys.length > 1} ({ ...k, shape: "rect" as const }))} /> {/if} {#each lanes as lane, i (lane.key)} {@const last = i === lanes.length - 1}
{@render (header ?? defaultHeader)(lane, rowOf(lane))}
onselect(row.key, lane, segment) : undefined} {partial} reference={lane.typical} rows={lane.rows} selected={cursor} tilt={false} bind:active={hover} />
{/each}