Agreed with everyone here that the option to resize would be incredible. Also a big shout out to @Salamander23 for your snippets here.
Question - would it be possible to:
- Create a setting under themes that enables users to force fit all mermaid diagrams into their notes? This could be made more sophisticated later if there is a strong preference for different kinds of behaviours depending on the type of diagram.
- Add a mini menu when you hover over the rendered SVG with 2 options:
a. Download diagram as SVG
b. “Full size” this SVG - essentially popping it out into a resizable, floating window within Obsidian. The window would be centred on the starting node in the diagram by default. Having the diagram in a pop up window means that Obsidian could (in theory) render the SVG as a vector (zooming in / out as needed) without affecting the rest of the note. Users could then close the vector when they are done viewing it.
There may be better ways of doing it, but as I understand it, there appear to be two conflicting needs:
- Ability to live-edit and fit diagrams within the regular flow of their notes no matter what size the diagram
- Ability to view and read the diagram as and when needed, e.g. for sharing purposes
Enabling a 2nd layer of navigation for these objects (either via pop up / fixed size in line rendering engine) might go some way towards resolving the central conflict, as there is no way to control how large / wide a person’s Mermaid diagram might get.