bramp / js-sequence-diagrams

Draws simple SVG sequence diagrams from textual representation of the diagram
https://bramp.github.io/js-sequence-diagrams/
BSD 2-Clause "Simplified" License
7.8k stars 1.08k forks source link

Make diagrams collapsible #209

Open mcintyre321 opened 5 years ago

mcintyre321 commented 5 years ago

Thanks for such a cool project!

I was just thinking that it would be really neat to be able to expand/collapse parts of the chart, and raise an event, allowing an integrator to save the state to localstorage, and to load it again

e.g. given

Andrew->China.Ear: Says "How are you"
China.Ear ->China.Brain: Heard "How are you"
China.Brain->China.Brain.HealthStatus: Check healthiness
China.Brain.HealthStatus-> China.Brain: Everything OK
China.Brain->China.Mouth: Say "Fine thanks"
China.Mouth-->Andrew: Says "Fine Thanks"

You could have a +/- in the UI, which would collapse all the nodes under China into one (effectively giving)

Andrew ->China: Says "How are you"
China ->Andrew: Says "Fine Thanks"

This way you can produce really complex, large diagrams, then filter them down to demonstrate just the information relevant.

serapath commented 1 year ago

yeah, that would be super dope :-)