Nomnoml Diagrams overflow on the page
Opened this issue · 1 comments
I have the same issue described on the obsidian forum here and also here.
I’m trying to export a diagram I made with the Nomnoml Plugin (GitHub - Daeik/obsidian-nomnoml-diagram: Obsidian Plugin for nomnoml diagram 9), which I chose over Mermaid because I couldn’t figure out how to make the arrows shorter in Mermaid.
I’d like to export the diagram but it keeps overflowing (in the note and pdf), and you can’t see all of it, which is also a problem in the regular note view in Obsidian itself. Is this possible in some way, similar to how in the snippet in the discussion on the Mermaid export?
He doesn't seem to have recieved a reply. Is there an easy fix for this that I am unaware of?
I've managed to fix this issue somewhat (need to sort the invidual setting out instead of defaulting to the global), once its all sorted I'll push up a PR shortly.
Essentially nomnoml gives us the #zoom function, which I've added into the codebase. All it does is change the viewBox parameters based on the zoom parameter.
So if the zoom param was 2 and the viewBox was (0 0 500 500) we just divide the width and height by that value.
If you do want to do it yourself here's the main.ts file. Clone this repo and then just replace it and then compile the typescript file with NPM run build and then add the main.js to the normnol plugin in the plugins folder.
If you don't want to compile it yourself I've also added my compiled js file.
Lemme know if this helped! :)