Skip to content

Commit

Permalink
refactor(elk): add LabelData type for layout-elk
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
aloisklink committed Oct 21, 2024
1 parent 4bc70b7 commit 6cc0132
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions packages/mermaid-layout-elk/src/render.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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>;
}

Expand Down Expand Up @@ -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();

Expand Down

0 comments on commit 6cc0132

Please sign in to comment.