gitcpy / diagram-zoom-drag

In obsidian, when you have a md file which contains large charts or diagrams, maybe something of mermaid, you will see those things are too large to show in mermaid window. So i think it is a good way to take the obsidian plugin here. It could easily zoom in or zoom-out or drag the charts or diagrams of mermaid. Enjoy it!
MIT License
17 stars 4 forks source link

Demo for PC:

View demo for PC

Demo for Mobile:

View demo for Mobile

About the problem

In Obsidian, when you have a Markdown file with large charts, diagrams, or Mermaid content, these elements may be too large to display fully within the Mermaid window. This plugin is designed to address that issue by allowing you to zoom in, zoom out, and drag the diagrams for better visibility and interaction. Enjoy!

How to get it

There are three options to install the plugin:

  1. Manual Installation:

    • Visit the GitHub page of the plugin and go to the releases page.
    • Download the latest release files (main.js, manifest.json, styles.css).
    • Create a Mermaid Zoom Drag directory in the ./obsidian/plugins/ folder.
    • Move the downloaded files into this directory.
    • Enable the plugin in Obsidian by going to Settings -> Community plugins.
  2. Using BRAT:

    • If you have BRAT, copy the link of this plugin.
    • Open BRAT settings, click on Add Beta Plugin, paste the link, and press Add Plugin.
    • Enable the plugin in Settings -> Community settings.
  3. From Obsidian Community Plugin Browser:

    • Open Settings, go to Community plugins, click Browse and search for Diagram Zoom Drag. Click Install

What this plugin can do

Example

graph TD
    A[Start] --> B[Process 1]
    B --> C{Decision}
    C -->|Yes| D[Process 2]
    C -->|No| E[Process 3]
    D --> F[End]
    E --> F

Click the copy button at the top right of the Mermaid diagrams to copy the code and paste it into your Markdown file in Obsidian to see it in action.

Notes

For those developing their own plugins for various types of content (such as diagrams): If you want this plugin to automatically enhance your content, please follow these steps.

  1. Ensure that this plugin truly supports your content.
  2. After that, add the class diagram-zoom-drag to the <div> that contains your content.

This will allow the plugin to interact correctly with your content by default.

Thanks