huterguier / obsidian-mehrmaid

MIT License
12 stars 0 forks source link

Cropped text inside flowgraph rectangles #3

Open yassirnajmaoui opened 3 months ago

yassirnajmaoui commented 3 months ago

It seems like every text I put inside quotes is cropped by one character (more or less).

Example: Code:

---
title: Test chart
---
flowchart
    A["Some text"]
    B["Some text with an equation $Ax+b=y^{2n}$"]

    A -- "This $2x$ cropped too" ---> B

Output image: image

It seems like it affects equations more than regular text.

yassirnajmaoui commented 3 months ago

It seems like the problem occurs vertically aswell

huterguier commented 3 months ago

Okay, that's weird. The example you sent seems to work for me: Screenshot from 2024-04-16 15-26-14 Did you install the plugin from the Obsidian plugin store?

Vertical cropping should not occur either, except for edge labels. But this is a problem of the Mermaid rendering/layout engine and i can't really do anything about it inside the scope of this plugin. If you encounter any other example where things get cropped just let me know.

yassirnajmaoui commented 3 months ago

Yes I did download it from the Obsidian plugin store directly from the Obsidian UI. Note that I am running on Linux in Ubuntu and Gnome, nothing fancy.

I also have the following problems:

I don't have any of these problems with "vanilla" mermaid.

Other than that I really enjoy the plugin. I just want to be able to write math formulas inside mermaid diagrams. I wish I had the Javascript skills to help you on this.

vsiisv commented 2 months ago

I have the same problem.

image

I installed the plugin from GitHub.

huterguier commented 2 months ago

There should be no more issues when switching between reading and edit mode now. The reason was that both views render their own graphs, which lead to non-unique graph ids. If you still encounter any sort of cropping, let me know and maybe give me some more detailed information on when this occurs.

yassirnajmaoui commented 2 months ago

Indeed, the Edit and Read mode bug seems to be fixed for me. But I still see the some cropping issue, but it did get better for the nodes at least (I still see it a lot for the text between the nodes, eg: A -- "The text here" --> B).

pirasleandro commented 1 month ago

For me it's still broken. I have tried both the obsidian plugin store version and vanilla one. I tried to render the example from the store page, but it never looks like the screenshot from the store page. (ignoring the broken image links)

Writing Mode: image

Reading Mode: image

Screenshot from store page: image