burr icon indicating copy to clipboard operation
burr copied to clipboard

Add mermaid support

Open skrawcz opened this issue 1 year ago • 1 comments

Is your feature request related to a problem? Please describe. Graphviz requires system dependencies. This could prevent users getting a good experience with Burr.

Describe the solution you'd like Mermaid diagrams I believe require less to get working.

Jupyter support.

Thing to figure out:

  • you still need something to render the mermaid markdown programmatically if someone wants to create a png.
  • github can natively render the mermaid markdown -> so png might not be required (for this initial implementation).
  • I believe npm has a CLI that would be installed to work here - and would require someone to install it for things to work..

Describe alternatives you've considered N/A

Additional context Feedback from a user.

skrawcz avatar Nov 03 '24 01:11 skrawcz

Other notes:

  • Mermaid in a markdown block (```mermaid) will render on GitHub, but not in other markdown engine (e.g., requires a VSCode extension)
  • AFAIK, there's no way to render Mermaid from Python. You need to have access to Javascript, which seems like a more burdensome dependency (random example found on Medium)
  • While Graphviz has Python bindings, Mermaid doesn't and would require manually handling strings (see Haystack's code)
  • From my experience (with Haystack at least), rendering Mermaid is significantly slower than rendering graphviz in a notebook

(IMHO, this might not be a good first issue. It is well-scoped, but expect significant amount of work to complete the task)

zilto avatar Nov 06 '24 15:11 zilto