diff --git a/packages/mermaid/src/diagrams/block/blockDB.ts b/packages/mermaid/src/diagrams/block/blockDB.ts index e63c4fce6..30f7e1574 100644 --- a/packages/mermaid/src/diagrams/block/blockDB.ts +++ b/packages/mermaid/src/diagrams/block/blockDB.ts @@ -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 => { diff --git a/packages/mermaid/src/diagrams/block/blockRenderer.ts b/packages/mermaid/src/diagrams/block/blockRenderer.ts index cadae89f2..da7e56e54 100644 --- a/packages/mermaid/src/diagrams/block/blockRenderer.ts +++ b/packages/mermaid/src/diagrams/block/blockRenderer.ts @@ -42,11 +42,13 @@ export const draw = async function ( } const root = securityLevel === 'sandbox' - ? d3select(sandboxElement.nodes()[0].contentDocument.body) - : d3select('body'); + ? d3select(sandboxElement.nodes()[0].contentDocument.body) + : d3select('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(`[id="${id}"]`) + : d3select(`[id="${id}"]`); // Define the supported markers for the diagram const markers = ['point', 'circle', 'cross'];