gregzuro / obsidian-kroki

MIT License
45 stars 27 forks source link

Scaling #7

Open netthier opened 2 years ago

netthier commented 2 years ago

In some cases Kroki generates diagrams wider than the page, which leads to display issues when switching to the reading mode or exporting to PDF. There should be a way to manually scale down generated diagrams without adding DSL-specific styling. An option to automatically scale the image to fit would also be useful.

gregzuro commented 2 years ago

Is there any precedent for this sort of thing with code fencing / rendering?
How have other addressed it?

netthier commented 2 years ago

I have no clue, I just opened this issue because Mermaid generated a pretty large flowchart which got cut off.

chintal commented 1 year ago

I need to be able to scale the diagrams as well. As it stands, generated diagrams (BPMN) are very often too wide for the screen, and there is no scrollbar in the preview either.

Perhaps you could use Obsidian's own image resize feature? See https://help.obsidian.md/How+to/Embed+files#Resize+images

Ideally, It would be best if images wider than the allowed width would auto-scale to fit width, and when clicked could open up a larger window. The first part should be doable, I think, with what you already have.

julianmueller commented 1 year ago

I kindof solved this by making the mermaid field scollable from left to right (as it did not do it for me on default) with a css snippet:

.mermaid  {
    white-space: pre;
    overflow-x:auto;
}