@maxgraph/core
Version:
maxGraph is a fully client side JavaScript diagramming library that uses SVG and HTML for rendering.
37 lines (36 loc) • 1.11 kB
TypeScript
import GraphLayout from './GraphLayout.js';
import type Cell from '../cell/Cell.js';
import type { AbstractGraph } from '../AbstractGraph.js';
import CellState from '../cell/CellState.js';
/**
* Extends {@link GraphLayout} to implement an edge label layout. This layout
* makes use of cell states, which means the graph must be validated in
* a graph view (so that the label bounds are available) before this layout
* can be executed.
*
* ```javascript
* const layout = new EdgeLabelLayout(graph);
* layout.execute(graph.getDefaultParent());
* ```
*
* @category Layout
*/
declare class EdgeLabelLayout extends GraphLayout {
constructor(graph: AbstractGraph, radius: number);
/**
* Implements {@link GraphLayout.execute}
*/
execute(parent: Cell): void;
/**
* Places the labels of the given edges.
*
* @param v vertexes
* @param e edges
*/
placeLabels(v: CellState[], e: CellState[]): void;
/**
* Places the labels of the given edges.
*/
avoid(edge: CellState, vertex: CellState): void;
}
export default EdgeLabelLayout;