Allow the same state name in different parallel machines
See original GitHub issueWhen creating parallel machines, every state must have a unique name.
For example:
parallel {
bold{
first.on -> first.off;
first.off -> first.on;
},
underline{
second.on -> second.off;
second.off -> second.on;
};
};
I’d like to be able to have the states just be named on
and off
.
Expected Behavior/Possible Solution
I wonder if when using the json
representation of the state machine we could have the idea of states having something like a displayName
that when provided is used for rendering the state name.
This would allow me to use the current name
field as a unique id, with displayName
giving a nice compact output.
Context
I’m working on a library to convert xstate
state chart descriptions in svg diagrams using state-machine-cat
.
With xstate
you can re-use the same state name across each part of a parallel or nested state machine. I’d like to be able to preserve these state names in the diagram output from state-machine-cat
.
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (3 by maintainers)
Top GitHub Comments
Thanks @karl both for requesting this feature and for trying the beta
The PR is merged and released a new major version of state-machine-cat. No worries; the version bump is major because I had to make a small breaking change in the syntax to introduce the label attribute - see the release notes for details).
Just had a chance to have a quick play around and this looks great!