mermaid
Version:
Markdown-ish syntax for generating flowcharts, mindmaps, sequence diagrams, class diagrams, gantt charts, git graphs and more.
32 lines (31 loc) • 1.34 kB
TypeScript
import { isAxisTaggedRoute, type RoutePoint } from './routeGeometry.js';
export { isAxisTaggedRoute };
export type { RoutePoint };
/** How the line between two route points is drawn, from the v12 `curve` name. */
export type CurveKind = 'curved' | 'linear' | 'step' | 'stepBefore' | 'stepAfter' | 'rounded';
export declare function curveKind(curve: string | undefined): CurveKind;
/**
* How far the line stops short of its end for a mermaid marker of this type, so the marker
* (drawn by `<marker>` with its own refX) meets the node outline. Same offsets the other edge
* curves use; unknown or absent markers trim nothing.
*/
export declare function markerTrim(type: string | undefined): number;
export interface EdgePath {
d: string;
/** Start tip and the way a start marker points. */
sx: number;
sy: number;
sdx: number;
sdy: number;
/** End tip and the way an end marker points. */
ex: number;
ey: number;
edx: number;
edy: number;
}
/**
* The path for a route, trimmed at both ends to leave room for markers. Between two points
* not in line the route is one S along the flow (or a step in a stepped route); where the
* route turns a corner it is rounded.
*/
export declare function routePath(route: readonly RoutePoint[], kind: CurveKind, startTrim: number, endTrim: number): EdgePath;