import { HoistModel, PlainObject, Theme } from '@xh/hoist/core'; import { StoreRecord, StoreRecordId } from '@xh/hoist/data'; import { ReactNode } from 'react'; import { TreeMapAlgorithm, TreeMapColorMode, TreeMapModel, TreeMapConfig } from './TreeMapModel'; export interface SplitTreeMapConfig extends TreeMapConfig { /** * Filter used to allocate records between the primary and secondary maps. * Defaults to: `record[valueField] >= 0`. */ mapFilter?: SplitTreeMapFilterFn; /** Function to render region titles. */ mapTitleFn?: SplitTreeMapTitleFn; /** True to insert a four pixel buffer between the two maps. */ showSplitter?: boolean; /** Layout orientation to use. */ orientation?: SplitTreeMapOrientation; } /** * Core Model for a SplitTreeMap. * * Binds to a Store (or GridModel) and splits the data into two managed child TreeMaps. * Users should specify a `mapFilter` function to control how records are divided * across the two TreeMaps. * * Additionally, accepts and passes along all settings for TreeMapModel. * @see TreeMapModel */ export declare class SplitTreeMapModel extends HoistModel { mapFilter: SplitTreeMapFilterFn; mapTitleFn: SplitTreeMapTitleFn; showSplitter: boolean; primaryMapModel: TreeMapModel; secondaryMapModel: TreeMapModel; orientation: SplitTreeMapOrientation; constructor(config: SplitTreeMapConfig); get total(): number; get selectedIds(): StoreRecordId[]; get isMasking(): boolean; get empty(): boolean; get expandState(): PlainObject; get error(): string; get emptyText(): ReactNode; get highchartsConfig(): any; get labelField(): string; get heatField(): string; get maxDepth(): number; get maxHeat(): number; get algorithm(): TreeMapAlgorithm; get colorMode(): TreeMapColorMode; get theme(): Theme; setOrientation(orientation: SplitTreeMapOrientation): void; setHighchartsConfig(highchartsConfig: any): void; setLabelField(labelField: string): void; setHeatField(heatField: string): void; setMaxDepth(maxDepth: number): void; setMaxHeat(maxHeat: number): void; setAlgorithm(algorithm: TreeMapAlgorithm): void; setColorMode(colorMode: TreeMapColorMode): void; setTheme(theme: Theme): void; defaultMapFilter: (record: any) => boolean; } /** * Return true if record belongs to / should appear within the primary map, falsy to * have it allocated to the secondary map. */ type SplitTreeMapFilterFn = (record: PlainObject | StoreRecord) => boolean; /** * Function to generate the region title to display. * `isPrimary` is true if the region is the primary (top/left) map in the pair. */ type SplitTreeMapTitleFn = (treeMapModel: TreeMapModel, isPrimary: boolean) => ReactNode; /** * Layout orientation: * - 'vertical' (default) to display primary and secondary maps one above the other. * - 'horizontal' to show them side-by-side. */ type SplitTreeMapOrientation = 'vertical' | 'horizontal'; export {};