import { HierarchyRectangularNode } from '@visx/hierarchy/lib/types'; import type { ClusterNode, LeafNode } from './guards/node-guards.js'; import { type InternalTreeMapNode, type LegendColorMap } from './internal.js'; import { LegendItem } from '../../core/components/legend/categorical/types/legend.js'; import type { Point } from '../../core/types/point.js'; export interface TreeMapTooltipState { /** Whether the tooltip is currently visible. */ visible: boolean; /** Is tooltip pinned - stays in place, does not change content on hovering over other items. */ pinned: boolean; content?: HierarchyRectangularNode; position?: Point; } export interface TreeMapState { /** List of categories (nodes of depth 1) which are shown in the treemap. */ groupsSelected: LegendItem[]; /** Id of highlighted nodes (category node - depth 1). */ highlightedItems?: LegendItem[]; /** The current tooltip state. */ tooltip: TreeMapTooltipState; overlay: { mouseInBounds: boolean; }; toolbar: { isHovered: boolean; }; /** An array containing all visible nodes. */ hierarchyLeafNodes: HierarchyRectangularNode[]; hierarchyClusterNodes: HierarchyRectangularNode[]; colorMap: LegendColorMap; }