Alois Klink
2024-10-21 22:06:30 +09:00
parent 606ecf8990
commit 4bc70b7325
2 changed files with 4 additions and 8 deletions

View File

@@ -3,7 +3,7 @@ import ELK from 'elkjs/lib/elk.bundled.js';
import type { InternalHelpers, LayoutData, RenderOptions, SVG, SVGGroup } from 'mermaid';
import { type TreeData, findCommonAncestor } from './find-common-ancestor.js';
type Node = LayoutData['nodes'][0];
type Node = LayoutData['nodes'][number];
interface NodeWithVertex extends Omit<Node, 'domId'> {
children?: unknown[];

View File

@@ -1,7 +1,7 @@
import { log } from '../../logger.js';
import { shapes } from './shapes.js';
import type { Node } from '../types.js';
import type { MermaidConfig, SVGGroup } from '../../mermaid.js';
import type { Node, ShapeRenderOptions } from '../types.js';
import type { SVGGroup } from '../../mermaid.js';
import type { D3Selection } from '../../types.js';
import type { graphlib } from 'dagre-d3-es';
@@ -10,11 +10,7 @@ type NodeElement = D3Selection<SVGAElement> | Awaited<ReturnType<ShapeHandler>>;
const nodeElems = new Map<string, NodeElement>();
export async function insertNode(
elem: SVGGroup,
node: Node,
renderOptions: { config: MermaidConfig; dir: Node['dir'] }
) {
export async function insertNode(elem: SVGGroup, node: Node, renderOptions: ShapeRenderOptions) {
let newEl: NodeElement | undefined;
let el;