Skip to content

Commit

Permalink
Include default pieWidth in totalWidth
Browse files Browse the repository at this point in the history
  • Loading branch information
yari-dewalt committed Jul 5, 2024
1 parent 2ed3263 commit d9cb515
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/mermaid/src/diagrams/pie/pieRenderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,11 @@ export const draw: DrawDefinition = (text, id, _version, diagObj) => {
.map((node) => (node as Element)?.getBoundingClientRect().right ?? 0)
);

const totalWidth = Math.max(circleOffset + furthestTextPos, MARGIN * 2 + titleTextWidth);
const totalWidth = Math.max(
pieWidth,
circleOffset + furthestTextPos,
MARGIN * 2 + titleTextWidth
);

// Set viewBox
svg.attr('viewBox', `0 0 ${totalWidth} ${height}`);
Expand Down

0 comments on commit d9cb515

Please sign in to comment.