/** * @internal */ export type FlameLayoutOptions = { layout: 'chart' | 'graph'; idAccessor: string; parentIdAccessor: string; /** `layout: 'chart'` — span start. */ startAccessor?: string; /** `layout: 'chart'` — span end. */ endAccessor?: string; /** `layout: 'graph'` — inclusive span value. */ valueAccessor?: string; /** `layout: 'graph'` — sibling sort key. */ sortAccessor?: string; /** `layout: 'chart'` — subtracted from every x when nothing is isolated. */ offset?: number; /** Id of the span that becomes the only visible root, when it exists. */ isolatedId?: unknown; /** * When a span with ancestors is isolated, also lays out every intermediate * ancestor. The original root is always laid out. */ showAllAncestors?: boolean; }; /** * Parent and children lookups over the whole input data, addressed by the * position of a span in it. Shares the arrays the layout is built from. * @internal */ export type FlameHierarchy = { parentIndex: readonly number[]; childStart: readonly number[]; childIndexes: readonly number[]; }; /** * Everything the flame strategy needs per span, indexed by the span's position * in the caller's `data`. Plain arrays indexed by position keep a million spans free of per-span objects. * @internal */ export type FlameLayout = { x0: number[]; x1: number[]; /** Row of the span: its depth, shifted below any ancestor rows. */ level: number[]; /** `1` for the original root and `2` for an intermediate ancestor shown above an isolated span; absent when none is shown. */ role: number[] | undefined; /** `1` when the span belongs to the visible tree. */ visible: number[]; /** * Position of the span among the visible spans in source order, which is * its index in the drawn data, or `-1` when it is not visible. */ drawnIndex: Int32Array; childrenCount: number[]; /** First row occupied by the visible tree, below the ancestor rows and their gap. */ minDepth: number; maxDepth: number; /** * Added to the `level` of a visible span to get its depth in the full tree, * which does not change when a span is isolated. */ depthOffset: number; /** Graph only: largest inclusive value among visible spans. */ rootValue: number; /** Sole root of the visible tree, `undefined` when several roots are visible. */ visibleRootId: unknown; xMin: number; xMax: number; /** Number of ancestors of the isolated span; `undefined` when no known span is isolated. */ ancestorCount: number | undefined; hierarchy: FlameHierarchy; }; /** * Lays out a whole span forest with two passes over `data` (index + one * iterative traversal from the visible roots) and no per-span objects. * * - `chart`: x comes from the data; siblings keep input order. * - `graph`: x is laid out from inclusive values with siblings sorted by * `sortAccessor`. * * Spans unreachable from a root (cycles) are left invisible. * @internal */ export declare function buildFlameLayout(data: readonly unknown[], options: FlameLayoutOptions): FlameLayout; //# sourceMappingURL=build-flame-layout.d.ts.map