statelyai / xstate-viz

Visualizer for XState machines
https://stately.ai/viz
MIT License
434 stars 102 forks source link

Add "Context" to Visualiser #358

Open cgibson-swyftx opened 2 years ago

cgibson-swyftx commented 2 years ago

It would be good if the visualiser took into consideration the context variables and the guards good make use of these. For example, if we created a loop with a counter. If the visualiser could store the counter in the context and the guards could read it and evaluation the condition, an outcome could be automatically determined.

That way we can more accurately test that the context variables in the visualiser before implementing the diagram in XState.

mattpocock commented 2 years ago

AFAIK it does already! Are you noticing something different?

mattpocock commented 2 years ago

Or are you using it from within vscode?

cgibson-swyftx commented 2 years ago

This is with stately.ai. I've hooked up my xstate machine to https://statecharts.io/ which I can visualise a real machine, but stately.ai I was hoping to use as a full demonstration before implementation.

shawninder commented 1 year ago

I can see the context on stately.ai/viz but not in the vs code extension. Is this expected?