mermaid icon indicating copy to clipboard operation
mermaid copied to clipboard

Left align output? (pie chart specifically)

Open luckman212 opened this issue 3 years ago • 3 comments

I am starting to work with Mermaidjs inside of Obsidian. One issue I am hitting is there does not seem to be any way to left-align the Pie charts. This causes problems with portions of the output being obscured, especially the labels. See below some related threads:

I found some mention of using Directives to control the output but the documentation seems limited and I could not find anything related to alignment.

Is this or will this be possible? Thank you

example from the live editor: pie chart

image

luckman212 avatar Apr 13 '21 14:04 luckman212

I would also like to see this changed, or an option of how to do it.

guategeek avatar Sep 17 '21 20:09 guategeek

In Chrome I'm seeing the Pie Chart renders with a width that is too large. Not sure how the width of the Pie Chart compares to the other types of diagrams.

mcdon-ron avatar Nov 05 '21 22:11 mcdon-ron

The location of the problem seems to be the following lines:

https://github.com/mermaid-js/mermaid/blob/8dd82839cb8ef660fbe3295c820b57e2a7f9e763/packages/mermaid/src/diagrams/pie/pieRenderer.js#L43

https://github.com/mermaid-js/mermaid/blob/8dd82839cb8ef660fbe3295c820b57e2a7f9e763/packages/mermaid/src/diagrams/pie/pieRenderer.js#L69

Also, the current height is set to be constant, causing bottom whitespace:

https://github.com/mermaid-js/mermaid/blob/8dd82839cb8ef660fbe3295c820b57e2a7f9e763/packages/mermaid/src/diagrams/pie/pieRenderer.js#L17

Yash-Singh1 avatar Oct 15 '22 18:10 Yash-Singh1