Visualizer
Non-interactive (no initial state)
import StateChart from '../../../components/StateChart/StateChart.astro';
<StateChart start="off" states={['off', 'on']} transitions={[ { from: 'off', to: 'on', label: 'TOGGLE'}, { from: 'on', to: 'off', label: 'TOGGLE'} ]} />
<script> import '../../../components/StateChart/YmChart'; import '../../../components/StateChart/YmState'; import '../../../components/StateChart/YmTransition';</script>
<ym-chart start="off"> <ym-state name="off"/> <ym-state name="on"/> <ym-transition from="off" to="on" label="TOGGLE"/> <ym-transition from="on" to="off" label="TOGGLE"/></ym-chart>
Renders
Interactive (with initial state)
import StateChart from '../../../components/StateChart/StateChart.astro';
<StateChart start="off" initial="off" states={['off', 'on']} transitions={[ { from: 'off', to: 'on', label: 'TOGGLE'}, { from: 'on', to: 'off', label: 'TOGGLE'} ]} />
<script> import '../../../components/StateChart/YmChart'; import '../../../components/StateChart/YmState'; import '../../../components/StateChart/YmTransition';</script>
<ym-chart start="off" current="off"> <ym-state name="off"/> <ym-state name="on"/> <ym-transition from="off" to="on" label="TOGGLE"/> <ym-transition from="on" to="off" label="TOGGLE"/></ym-chart>