@kieler/klighd-core
Version:
Core KLighD diagram visualization with Sprotty
34 lines • 1.94 kB
TypeScript
import { SKGraphElement } from '@kieler/klighd-interactive/lib/constraint-classes';
import { SModelRootImpl } from 'sprotty';
import { KRendering } from './skgraph-models';
/**
* Returns the SVG element in the DOM that represents the topmost KRendering in the hierarchy.
* If an action should be triggered on the element, bubble up through the rendering hierarchy until the first actionable rendering..
* @param target The graph element the event is triggered on.
* @param element The topmost SVG element clicked.
* @param actionable Optional parameter to search for actionable renderings only. Defaults to false.
*/
export declare function getSemanticElement(target: SKGraphElement, element: EventTarget | null, actionable?: boolean): SVGElement | undefined;
/**
* Returns if there is a KLighD action defined on the given rendering that needs to be handled.
*
* @param rendering the rendering that may define an action to be executed.
* @param includeChildren if this should also search for actions in any of the rendering's children.
* Defaults to false.
* @returns if there is at least one action for this rendering.
*/
export declare function hasAction(rendering: KRendering, includeChildren?: boolean): boolean;
/**
* Finds the KRendering in the data of the SKGraphElement that matches the given ID.
* @param graphElement The graph element to look in.
* @param svgElement The SVG element that represents the rendering.
*/
export declare function findRendering(graphElement: SKGraphElement, svgElement: SVGElement): KRendering | undefined;
/**
* Finds the SKGraphElement that matches the given ID.
* @param root The root.
* @param id The ID to search for.
* @returns The element matching the given id or `undefined` if there is none.
*/
export declare function getElementByID(root: SModelRootImpl, id: string, suppressErrors?: boolean): SKGraphElement | undefined;
//# sourceMappingURL=skgraph-utils.d.ts.map