Open MatthewEppelsheimer opened 2 years ago
This is a very useful feature to have. But the problem is that the required metadata isn't there in the diagram. After a preliminary analysis, It would require extensive changes in the core rendering of all diagrams to properly expose the metadata. If someone comes up with a workaround, it'll be a huge help.
Context
My team is evaluating Mermaid for use documenting many complex flows and sequences in application architecture. This will make for many quite lengthy source documents. The greatest value of Mermaid for us is the ability to version diagrams right along with our source code. We'll be able to incorporate visual documentation additions and updates right into our code workflow (code review, PRs, CI/CD pipelines, etc.), fight doc rot, and more easily see how our architecture has changed over time, or will change with refactors and new features.
The Problem
Initial feedback from our evaluation (aside from "what a great tool!") is concern that when updating a diagram that hasn't changed in months or years, it will be conceptually simple to see what rendered visual elements need to change, but there will be a lot of cognitive friction in actually making the change, because we'll have to read through a lot of Mermaid source syntax to find the right line(s) corresponding to the visual elements to change.
Existing cognitive process for editing a diagram
Proposed Solution
Clicking an element in the live editor's preview window should focus the associated line(s) responsible for generating that element within the editor.
By "focus", I mean:
rect
orloop
in a sequence diagram, the block of all relevant lines in the editor should be highlighted.This would give the live editor a lot of the ease-of-use of traditional drag-and-drop diagramming tools, while retaining all of the advantage of rendering diagrams from source code.
Resulting cognitive process for editing a diagram