import type { TreeNode } from "./tree"; function fmt(x: number): string { if (Number.isNaN(x)) return "NaN"; if (!Number.isFinite(x)) return x > 0 ? "Inf" : "-Inf"; return Number.isInteger(x) ? String(x) : Number(x.toPrecision(6)).toString(); } export function InfoPanel({ node }: { node: TreeNode | null }) { if (!node) { return (
Select an object in the tree to inspect it.
No properties.
) : (| {p.key} | {p.swatch && ( )} {p.value} |
| shape | {detail.shapeLabel} |
| count | {detail.count} |
| min | {fmt(detail.stats.min)} |
| max | {fmt(detail.stats.max)} |
| mean | {fmt(detail.stats.mean)} |
| NaN | {detail.stats.nan} |
{detail.preview}