Merge branch '3358-blocks-diagram' of github.com:mermaid-js/mermaid into 3358-blocks-diagram

This commit is contained in:
Knut Sveidqvist 2024-01-30 14:37:53 +01:00
commit 8f8ce2f142
2 changed files with 6 additions and 5 deletions

View File

@ -154,7 +154,6 @@ const populateBlockDatabase = (_blockList: Block[] | Block[][], parent: Block):
};
let blocks: Block[] = [];
const links: Link[] = [];
let rootBlock = { id: 'root', type: 'composite', children: [], columns: -1 } as Block;
const clear = (): void => {

View File

@ -42,11 +42,13 @@ export const draw = async function (
}
const root =
securityLevel === 'sandbox'
? d3select(sandboxElement.nodes()[0].contentDocument.body)
: d3select('body');
? d3select<HTMLBodyElement, unknown>(sandboxElement.nodes()[0].contentDocument.body)
: d3select<HTMLBodyElement, unknown>('body');
// @ts-ignore TODO root.select is not callable
const svg = securityLevel === 'sandbox' ? root.select(`[id="${id}"]`) : d3select(`[id="${id}"]`);
const svg =
securityLevel === 'sandbox'
? root.select<SVGSVGElement>(`[id="${id}"]`)
: d3select<SVGSVGElement, unknown>(`[id="${id}"]`);
// Define the supported markers for the diagram
const markers = ['point', 'circle', 'cross'];