import type { DataItem } from "../../core/render/Component"; import type { IPoint } from "../../core/util/IPoint"; import type { IHierarchyDataObject, IHierarchyDataItem } from "./Hierarchy"; import { LinkedHierarchy, ILinkedHierarchyPrivate, ILinkedHierarchySettings, ILinkedHierarchyDataItem, ILinkedHierarchyEvents } from "./LinkedHierarchy"; import * as d3hierarchy from "d3-hierarchy"; export interface ITreeDataObject { name?: string; value?: number; children?: ITreeDataObject[]; dataItem?: DataItem; } export interface ITreeDataItem extends ILinkedHierarchyDataItem { /** * Data items of the child nodes. */ children: Array>; /** * Parent data item. * @type {DataItem} */ parent: DataItem; } export interface ITreeSettings extends ILinkedHierarchySettings { /** * Direction the tree grows in: `"vertical"` from top to bottom, * `"horizontal"` from left to right. * * @default "vertical" */ orientation?: "horizontal" | "vertical"; /** * Flips the tree, so it grows from bottom to top, or from right to left * when horizontal. * * @default false * @since 5.2.4 */ inversed?: boolean; /** * Uses a cluster layout (dendrogram), which lines up all leaf nodes at * the same depth. * * @default false * @since 5.16.2 */ clustered?: boolean; /** * Function that returns the spacing between two neighboring nodes, given * their data items. Without it, siblings get `1` and other neighbors `2`. * * @since 5.16.2 */ nodeSeparation?: (a: DataItem, b: DataItem) => number; /** * Lays out only the visible nodes, so they spread out to fill the chart * while other nodes are hidden or collapsed. * * @default false * @since 5.18.0 */ fitNodes?: boolean; } export interface ITreePrivate extends ILinkedHierarchyPrivate { /** * Current horizontal scale. */ scaleX?: number; /** * Current vertical scale. */ scaleY?: number; } export interface ITreeEvents extends ILinkedHierarchyEvents { } /** * A tree diagram: node circles joined by links, each level a row (or a * column, when horizontal). * * @see {@link https://www.amcharts.com/docs/v5/charts/hierarchy/tree/} for more info * @important */ export declare class Tree extends LinkedHierarchy { _settings: ITreeSettings; _privateSettings: ITreePrivate; _dataItemSettings: ITreeDataItem; protected _tag: string; static className: string; static classNames: Array; _hierarchyLayout: d3hierarchy.TreeLayout; _rootNode: d3hierarchy.HierarchyCircularNode | undefined; _packData: ITreeDataObject | undefined; _prepareChildren(): void; protected _makeHierarchyData(data: IHierarchyDataObject, dataItem: DataItem): void; hideDataItem(dataItem: DataItem, duration?: number): Promise; showDataItem(dataItem: DataItem, duration?: number): Promise; disableDataItem(dataItem: DataItem, duration?: number): void; enableDataItem(dataItem: DataItem, maxDepth?: number, depth?: number, duration?: number): void; protected _updateVisuals(): void; protected _getPoint(hierarchyNode: this["_dataItemSettings"]["d3HierarchyNode"]): IPoint; } //# sourceMappingURL=Tree.d.ts.map