mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-08-15 06:19:24 +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];
|
||||
|
||||
interface LabelData {
|
||||
width: number;
|
||||
height: number;
|
||||
wrappingWidth?: number;
|
||||
labelNode?: SVGGElement | null;
|
||||
}
|
||||
|
||||
interface NodeWithVertex extends Omit<Node, 'domId'> {
|
||||
children?: unknown[];
|
||||
labelData?: any;
|
||||
labelData?: LabelData;
|
||||
domId?: Node['domId'] | SVGGroup | d3.Selection<SVGAElement, unknown, Element | null, unknown>;
|
||||
}
|
||||
|
||||
@@ -38,7 +45,7 @@ export const render = async (
|
||||
nodeArr: Node[],
|
||||
node: Node
|
||||
) => {
|
||||
const labelData: any = { width: 0, height: 0 };
|
||||
const labelData: LabelData = { width: 0, height: 0 };
|
||||
|
||||
const config = getConfig();
|
||||
|
||||
|
Reference in New Issue
Block a user