Skip to content

Commit

Permalink
Type nodes as elements
Browse files Browse the repository at this point in the history
  • Loading branch information
yari-dewalt committed Jun 24, 2024
1 parent a501a88 commit 010a93a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/mermaid/src/diagrams/pie/pieRenderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,8 @@ export const draw: DrawDefinition = (text, id, _version, diagObj) => {
});

const titleTextElement = group.select('.pieTitleText');
const titleTextLeft = titleTextElement.node().getBoundingClientRect().left;
const titleTextWidth = titleTextElement.node().getBoundingClientRect().width;
const titleTextLeft = (titleTextElement.node() as Element).getBoundingClientRect().left;
const titleTextWidth = (titleTextElement.node() as Element).getBoundingClientRect().width;

// Adjust chart placement.
if (titleTextLeft < MARGIN && titleTextElement.text()) {
Expand All @@ -178,7 +178,7 @@ export const draw: DrawDefinition = (text, id, _version, diagObj) => {
);
}

const circleOffset = group.select('circle').node().getBoundingClientRect().left;
const circleOffset = (group.select('circle').node() as Element).getBoundingClientRect().left;

const furthestTextPos = Math.max(
...legend
Expand Down

0 comments on commit 010a93a

Please sign in to comment.