sverweij / state-machine-cat

write beautiful state charts :scream_cat:
https://state-machine-cat.js.org
MIT License
795 stars 45 forks source link

support mermaid stateDiagram syntax #126

Open forivall opened 4 years ago

forivall commented 4 years ago

from a quick glance, it's unclear if state-machine-cat is a superset of mermaid-js. It would be nice, if so, if it could parse mermaidjs state diagrams as a language.

Context

it would just be neat, especially since i'm used to mermaid's syntax

Proposed Behavior

it would be a new input type

Current Behavior

supported input are smcat, json and scxml

Considered alternatives

well, just using mermaid, of course.

sverweij commented 4 years ago

Hi @forivall state-machine-cat is not a super set of mermaid, syntax wise.

I hadn't looked into mermaid for a few years and wasn't even aware they had state machine support right now, so thanks for the heads-up.

Feature wise state-machine-cat currently likely is a superset of mermaid; from a quick glance mermaid doesn't seem to support history states, terminations, junctions, activities, conditions, actions and events yet. It does seem to have some stuff that influence layout (right_of, left_of), though, and that's something smc does not have - and it might have a more flexible/ better render engine (not tried yet).

That said transforming mermaid syntax into state-machine-cat's internal format (json schema here) should be doable. PR welcome.

forivall commented 4 years ago

Yeah I definitely was thinking superset, feature-wise. Deffo not syntax. 👍

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.