ag-charts-enterprise
Version:
Advanced Charting / Charts supporting Javascript / Typescript / React / Angular / Vue
84 lines (83 loc) • 3.57 kB
TypeScript
import { type AgTreemapHighlightState, type AgTreemapSeriesOptions, type AgTreemapSeriesStyle, type FontStyle, type FontWeight, type TextAlign, type TextOrSegments, type VerticalAlign, _ModuleSupport } from 'ag-charts-community';
import { type DistantObject, type Point } from 'ag-charts-core';
import { TreemapSeriesProperties } from './treemapSeriesProperties';
declare class TreemapNode extends _ModuleSupport.HierarchyNode<TreemapNode> {
labelValue: string | undefined;
secondaryLabelValue: string | undefined;
label: LabelLayout | undefined;
secondaryLabel: LabelLayout | undefined;
bbox: _ModuleSupport.BBox | undefined;
padding: Padding | undefined;
}
interface Padding {
top: number;
right: number;
bottom: number;
left: number;
}
interface LabelLayout {
text: TextOrSegments;
fontSize: number;
lineHeight: number;
fontStyle: FontStyle;
fontFamily: string;
fontWeight: FontWeight;
color: string;
textAlign: TextAlign;
verticalAlign: VerticalAlign;
x: number;
y: number;
}
type ItemStyle = Pick<AgTreemapSeriesStyle, 'fill' | 'stroke'> & Omit<Required<AgTreemapSeriesStyle>, 'fill' | 'stroke'>;
declare class DistantGroup<D> extends _ModuleSupport.Group<D> implements DistantObject {
distanceSquared(x: number, y: number): number;
}
export declare class TreemapSeries extends _ModuleSupport.HierarchySeries<TreemapNode, DistantGroup<TreemapNode>, AgTreemapSeriesOptions, TreemapSeriesProperties> {
static readonly className = "TreemapSeries";
static readonly type: "treemap";
NodeClass: typeof TreemapNode;
properties: TreemapSeriesProperties;
private readonly rectGroup;
protected readonly datumSelection: _ModuleSupport.Selection<TreemapNode, _ModuleSupport.Rect<TreemapNode>>;
private readonly labelSelection;
private readonly highlightSelection;
private groupTitleHeight;
private getNodePadding;
private sortChildren;
/**
* Squarified Treemap algorithm
* https://www.win.tue.nl/~vanwijk/stm.pdf
*/
private squarify;
private applyGap;
createNodeData(): undefined;
protected getItemStyle(nodeDatum: Pick<TreemapNode, 'datumIndex' | 'datum' | 'depth' | 'colorValue'>, isLeaf: boolean, isHighlight: boolean): Required<AgTreemapSeriesStyle> & {
opacity: number;
} & Partial<ItemStyle> & {
opacity?: number | undefined;
} & Partial<AgTreemapSeriesOptions<any, unknown> & {
fill: import("ag-charts-community").AgColorType;
fillOpacity: number;
stroke: string;
strokeWidth: number;
strokeOpacity: number;
lineDash: number[];
lineDashOffset: number;
opacity: number;
}>;
private makeItemStylerParams;
updateSelections(): void;
protected getActiveHighlightNode(): TreemapNode | undefined;
updateNodes(): void;
private getGroupHighlightState;
private getTileHighlightStyle;
private getGroupHighlightStyle;
getHighlightStateString(_datum: _ModuleSupport.HighlightNodeDatum | undefined, isHighlight?: boolean, datumIndex?: number[]): AgTreemapHighlightState;
private isDescendantDatumIndex;
pickNodesExactShape(point: Point): TreemapNode[];
protected pickNodeClosestDatum(point: Point): _ModuleSupport.SeriesNodePickMatch | undefined;
getTooltipContent(datumIndex: number[]): _ModuleSupport.TooltipContent | undefined;
protected computeFocusBounds(node: _ModuleSupport.Group): _ModuleSupport.BBox | undefined;
protected hasItemStylers(): boolean;
}
export {};