import { DonutParams } from './DonutParams.js'; import { DonutNode, DonutDimensions, TreeNode, DonutTooltip, SimpleNode } from './utils/DonutUtils.js'; import { ScaleLinear, ScalePower } from 'd3-scale'; import { Arc, DefaultArcObject } from 'd3-shape'; import { BaseType, Selection } from 'd3-selection'; export declare const NO_VALUE = "No value"; export declare abstract class AbstractDonut { donutParams: DonutParams; donutDimensions: DonutDimensions; protected donutContext: Selection; protected lastSelectedNode: DonutNode; protected arc: Arc; protected x: ScaleLinear; protected y: ScalePower; protected donutTooltip: DonutTooltip; /** * @description Plots the donut */ plot(): void; /** * @description Resizes donut on window resize event. */ resize(donutContainer: HTMLElement): void; abstract dataChange(newData: TreeNode): void; abstract onSelectionChange(selectedArcsList: Array>): void; /** * @description Creates donuts arcs */ protected createDonutArcs(): void; /** * @description Inialize donuts dimensions */ protected initializeDonutDimensions(): void; /** * @description Transforms input data to d3 nodes */ protected structureDataToNodes(): void; /** * @description Draws the donuts arcs */ protected plotDonut(): void; /** * @param clickedNode The selected node on the donut * @description Add the selected node to selectedArcsList */ protected addSelectedNode(clickedNode: DonutNode): void; /** * @param clickedNode The unselected node from the donut * @description Removes the selected node from selectedArcsList */ protected removeSelectedNode(clickedNode: DonutNode): void; /** * @param clickedNode The selected/unselected node of the donut * @description Removes from selectArcsList all the parent nodes of the clicked node that are selected */ protected removeHigherNodes(clickedNode: DonutNode): void; /** * @description Removes the unexisting nodes in the donut from the selectedArcsList */ protected removeUnExistingNodes(): void; /** * @param selectedArc Path from the selected arc to the ultimate parent (as an array) * @description REMOVES ALL THE NODES OF SAME RING HAVING THE SAME VALUE FROM THE SELECTEDARCSLIST, */ protected removeAllSimilarNodesOfSameRing(selectedArc: Array): void; /** * @description Set isSelected attribute to false for all the donut's nodes */ protected deselectAll(): void; /** * @description Set isSelected attribute to true giving the selectedArcsList */ protected reapplySelection(): void; /** * @description Styles the nodes according to their states */ protected styleNodes(): void; /** * @description Styles the 'No value' node */ private styleNoValueNode; /** * @param node Clicked on node * @param duration Duration of the animation * @description Apply animation after clicking on the node. */ protected tweenNode(node: DonutNode, duration: number): void; protected onMouseOver(event: MouseEvent, hoveredNode: DonutNode): void; protected onMouseOut(): void; protected onMouseLeavesContext(): void; protected showTooltip(node: DonutNode): void; protected setTooltipPosition(event: any): void; protected abstract hoverNode(hoveredNode: DonutNode): any; protected abstract unhoverNodesButNotSelected(): any; protected abstract onClick(event: PointerEvent, clickedNode: DonutNode): void; }