UNPKG

@maxgraph/core

Version:

maxGraph is a fully client side JavaScript diagramming library that uses SVG and HTML for rendering.

41 lines (40 loc) 2.15 kB
import Cell from '../view/cell/Cell.js'; /** * Returns all opposite vertices terminal for the given edges, only returning sources and/or targets as specified. * The result is returned as an array of {@link Cell}. * * @param edges Array of {Cell} that contain the edges to be examined. * @param {Cell} terminal that specifies the known end of the edges. * @param includeSources Boolean that specifies if source terminals should be included in the result. Default is `true`. * @param includeTargets Boolean that specifies if target terminals should be included in the result. Default is `true`. */ export declare const getOpposites: (edges: Cell[], terminal: Cell, includeSources?: boolean, includeTargets?: boolean) => Cell[]; /** * Returns the topmost cells of the hierarchy in an array that contains no * descendants for each {@link Cell} that it contains. Duplicates should be * removed in the cells array to improve performance. */ export declare const getTopmostCells: (cells: Cell[]) => Cell[]; /** * Returns an array that represents the set (no duplicates) of all parents * for the given array of cells. */ export declare const getParents: (cells: Cell[]) => Cell[]; /** * Returns a deep clone of the given {@link Cell}` (including the children) which is created using {@link cloneCells}`. * * @param cell {@link Cell} to be cloned. Default is `null`. * @param includeChildren Boolean indicating if the cells should be cloned with all descendants. Default is `true`. */ export declare const cloneCell: (cell?: Cell | null, includeChildren?: boolean) => Cell | null; /** * Returns an array of clones for the given array of {@link Cell}`. * Depending on the value of includeChildren, a deep clone is created for * each cell. Connections are restored based if the corresponding * cell is contained in the provided in array. * * @param cells The cells to clone * @param includeChildren Boolean indicating if the cells should be cloned with all descendants. * @param mapping Optional mapping for existing clones. */ export declare const cloneCells: (cells: Cell[], includeChildren?: boolean, mapping?: any) => Cell[];