mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-08-21 17:26:45 +02:00
refactor(elk): add LabelData
type for layout-elk
I don't know what exactly the type does or is for, but I've tried to type it to what it seems to be.
This commit is contained in:
@@ -5,9 +5,16 @@ import { type TreeData, findCommonAncestor } from './find-common-ancestor.js';
|
|||||||
|
|
||||||
type Node = LayoutData['nodes'][number];
|
type Node = LayoutData['nodes'][number];
|
||||||
|
|
||||||
|
interface LabelData {
|
||||||
|
width: number;
|
||||||
|
height: number;
|
||||||
|
wrappingWidth?: number;
|
||||||
|
labelNode?: SVGGElement | null;
|
||||||
|
}
|
||||||
|
|
||||||
interface NodeWithVertex extends Omit<Node, 'domId'> {
|
interface NodeWithVertex extends Omit<Node, 'domId'> {
|
||||||
children?: unknown[];
|
children?: unknown[];
|
||||||
labelData?: any;
|
labelData?: LabelData;
|
||||||
domId?: Node['domId'] | SVGGroup | d3.Selection<SVGAElement, unknown, Element | null, unknown>;
|
domId?: Node['domId'] | SVGGroup | d3.Selection<SVGAElement, unknown, Element | null, unknown>;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -38,7 +45,7 @@ export const render = async (
|
|||||||
nodeArr: Node[],
|
nodeArr: Node[],
|
||||||
node: Node
|
node: Node
|
||||||
) => {
|
) => {
|
||||||
const labelData: any = { width: 0, height: 0 };
|
const labelData: LabelData = { width: 0, height: 0 };
|
||||||
|
|
||||||
const config = getConfig();
|
const config = getConfig();
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user