mermaid-js / zenuml-core

The ZenUML renderer
https://embed.zenuml.com
MIT License
31 stars 8 forks source link

feat: introduce render mode #118

Closed dontry closed 8 months ago

dontry commented 8 months ago

ZenUML diagrams do not render properly in Mermaid due to differences in rendering mechanisms between the two frameworks. Mermaid only displays the initial render result of ZenUML and ignores subsequent renders. It incurs a few issues including the footer icons being invisible, sticky top participants not functional.

To tackle this problem, the render mode is introduced. By default, ZenUML uses the dynamic mode, which keeps all existing features intact. In the static mode, some changes are made to resolve the issues occurring in Mermaid.

Changes

  1. Add mode field to Config and Store. Set mode to dynamic by default.
  2. Add an additional property renderLifeLine to control the display of life line elements.
  3. Render participants and life lines in one life-life-layer in static mode.
  4. Hide footer in static mode.
  5. Lazy initialize intersection detectors when useIntersectionTop function is called; in this case, the detectors will not get created in static mode.

Rendered in Mermaid

Before: image

After: image