Replies: 1 comment
-
One way you can do this for any graph visualization tool is by converting it to a directed graph first, using That returns an object of this structure: {
id: '...',
stateNode: /* StateNode */,
children: [
{ id: '...', children: [/* ... */], edges: [/* ... */] },
{ id: '...', /* ... */ },
// ...
],
edges: [
{ source: /* ... */, target: /* ... */, transition: /* ... */ }
// ...
]
} Which makes it easier to convert it to e.g., PlantUML or GraphViz (DOT) formats. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I was looking for a way to generate visualisations for my state machines so I can embed them in some documentation pages.
I was wondering if it was possible to export the state machines in scxml, so that I can potentially use tools like state-machine-cat (or any tool that takes scxml as input) to generate this visualisations from it.
I see there is a package here with that purpose:
@xstate/scxml
. However it does not seem to be available as a package on npm since it is ignored in the .changeset/config.json file.Please note that while the main question here is on how to export state machines to scxml, I would also be happy to be able to use the
@xstate/viz
package to generate documentation in an automated way.Thank you so much for the hard work you have put into Xstate!
Beta Was this translation helpful? Give feedback.
All reactions