Merge commit 'f8746bee0454b01378726d04f9c65bbc3974eb3a' into merge-refactor/improving-rendering-shape-types

See https://github.com/mermaid-js/mermaid/pull/5974

Conflicts:
	docs/config/setup/interfaces/mermaid.RenderResult.md
	packages/mermaid/src/rendering-util/rendering-elements/shapes/util.ts
This commit is contained in:
Alois Klink
2024-10-28 21:03:19 +09:00
6 changed files with 27 additions and 20 deletions

View File

@@ -10,11 +10,18 @@ import { curveLinear } from 'd3';
import ELK from 'elkjs/lib/elk.bundled.js';
import { type TreeData, findCommonAncestor } from './find-common-ancestor.js';
type Node = LayoutData['nodes'][0];
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>;
}
@@ -45,7 +52,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();