To facilitate the usage of Mermaid diagrams in Neo.mjs applications, we should create a wrapper component Neo.component.wrapper.Mermaid.
Rationale:
- Simplified API: Developers can use a declarative component with a
value or code config instead of manually interacting with the Main thread addon.
- Lifecycle Management: The component will automatically handle mounting, updates, and destruction.
- Consistency: Aligns with existing wrappers like
AmChart.
Implementation Details:
- Class:
Neo.component.wrapper.Mermaid
- Extends:
Neo.component.Base
- Configs:
value (reactive) - the mermaid code.
- Logic:
- On mount, ensure the Mermaid addon is loaded.
- Render the diagram using the addon.
- React to
value changes by re-rendering.
- Handle windowId propagation.
To facilitate the usage of Mermaid diagrams in Neo.mjs applications, we should create a wrapper component
Neo.component.wrapper.Mermaid.Rationale:
valueorcodeconfig instead of manually interacting with the Main thread addon.AmChart.Implementation Details:
Neo.component.wrapper.MermaidNeo.component.Basevalue(reactive) - the mermaid code.valuechanges by re-rendering.