Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mermaid: make zoom configurable #144

Closed
McShelby opened this issue Nov 9, 2021 · 5 comments
Closed

mermaid: make zoom configurable #144

McShelby opened this issue Nov 9, 2021 · 5 comments
Assignees
Labels
change Introduces changes with existing installations feature New feature or request
Milestone

Comments

@McShelby
Copy link
Owner

McShelby commented Nov 9, 2021

It may be preferable to turn the mermaid zoom on/off thru configuration.

If we are implementing this we have to provide multiple configuration settings to set the zoom behaviour:

  • global (default: true)
  • per page (overrides global if set)
  • per graph (overrides global and page if set; only available for shortcode usage; not available for codefences)
@McShelby McShelby added the feature New feature or request label Nov 9, 2021
@McShelby McShelby assigned McShelby and unassigned McShelby Nov 9, 2021
@The-going
Copy link

If the option is to remove the zoom, is it possible to put the final image in a separate window with scrolling (horizontal/vertical)? If this happens, it will be a very good option.

@McShelby
Copy link
Owner Author

McShelby commented Nov 9, 2021

Having the option to open the graph in another window may result in further configuration parameters. Every additional parameter complicates configuration, so I am a bit reluctant to go this way.

Display in a separate window is technically difficult because the rendered graph SVG is generated and embedded in the site by client site JS code. Maybe a scrollable lightbox is more "theme-like" (because a lightbox is already in use with normal images) but also results in non trival (as in: just display an URL) code.

Nevertheless I don't plan to work on this issue in the foreseeable future. It's just a reminder to consider the scope if this is really implemented.

Also: Since Hugo 0.89 the default Markdown generator Goldmark comes with a built-in mermaid extension. This doesn't seem to be active in the Hugo shipment at the moment, but this may change soon.

If it will be activated and be supported by this theme, handling for Mermaid graphs will change dramatically. That's the reason I don't want to invest to much time in Mermaid features at the moment, as they are expected to change anyways.

@The-going
Copy link

Thanks for the clarification.

@McShelby McShelby added the helpwanted Great idea, send in a PR label Nov 13, 2021
@thenktor
Copy link

I've noticed, that on a mobile device (iPhone) I cannot scroll anymore when I'm looking at a mermaid chart. Furthermore zoom is also not possible.
On desktop browsers it's also quite annoying when scrolling a page and you get stuck on a big mermaid flow chart.

Disabling mermaid zoom should fix both and therefore is a good idea 😉

@McShelby McShelby added idea A valuable idea that's currently not worked on and removed helpwanted Great idea, send in a PR labels Jan 25, 2023
@McShelby McShelby self-assigned this Feb 4, 2023
@McShelby McShelby removed the idea A valuable idea that's currently not worked on label Feb 4, 2023
@McShelby McShelby added this to the 5.11.0 milestone Feb 4, 2023
@McShelby
Copy link
Owner Author

McShelby commented Feb 4, 2023

After removing jQuery and replacing the jQuery dependend zoom implementation by something different (here d3), the new zoom libaray now interferes with interactive Mermaid graphs (like the variant generator in the exampleSite).

So now, we are in the need to make the behavior configurable.

Although the idea of a lightbox isn't off the table, at the moment it is sufficient just turn off by configuration.

McShelby added a commit that referenced this issue Feb 5, 2023
McShelby added a commit that referenced this issue Feb 5, 2023
@McShelby McShelby closed this as completed Feb 5, 2023
@McShelby McShelby added the change Introduces changes with existing installations label Feb 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
change Introduces changes with existing installations feature New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants