UNPKG

@kieler/klighd-core

Version:

Core KLighD diagram visualization with Sprotty

57 lines 2.54 kB
import { VNode } from 'snabbdom'; import { Transformation } from '../views-common'; /** * Storage of data related to title renderings with the 'klighd.isNodeTitle' property. * Requires the framework to call {@link decendToChild()} when starting the rendering of a child graph element and {@link ascendToParent()} * after finishing that and returning to the parent handling. */ export declare class TitleStorage { /** * The offset transformations required to reach the usual title position within a graph element. Outer array is * used as a stack for each graph element the rendering is going through, inner array are the current * transformations required to get to the position of the current rendering from the origin of the parent graph * element. */ private transformations; /** * The rendering of any graph element that is to be placed on top of this graph element's rendering. Array is * used as a stack for each graph element the rendering is going through. */ private titles; /** * Clears the title storage for a new rendering run. */ clear(): void; /** * Returns the stored rendering of the current title. If there is no title for the current hierarchy, returns undefined. */ getTitle(): VNode | undefined; /** * Store this as the current title, to be rendered later on top. * @param title The new title. */ setTitle(title: VNode): void; /** * Returns the stored transformation data for the current rendering relative to its parent graph element. */ getTransformations(): Transformation[]; /** * Adds the transformations for the current rendering, remembering the offset of any possible title rendering within. * @param transformations The new transformation(s) of the current rendering. */ addTransformations(transformations: Transformation[]): void; /** * Removes the last transformations from the current rendering, reverting back to the offset of the parent rendering. * @param amount The amount of transformations added for the current rendering that now need to be removed again. */ removeTransformations(amount: number): void; /** * Decend to the next child graph element, adjusting the title storage accordingly. */ decendToChild(): void; /** * Ascend to the previous parent graph element, adjusting the title storage accordingly. */ ascendToParent(): void; } //# sourceMappingURL=title-storage.d.ts.map