Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build a renderer to sketch.systems #85

Open
silky opened this issue Apr 13, 2023 · 1 comment
Open

Build a renderer to sketch.systems #85

silky opened this issue Apr 13, 2023 · 1 comment

Comments

@silky
Copy link
Contributor

silky commented Apr 13, 2023

sketch.systems is a neat website where you can play around with state-machines.

It'd be cool if you could define a state-machine here and have it output to a format compatible with their playground; there's only two things:

The "Spec":

My Awesome Sketch
  First State
    some event -> Second State
  Second State

And the the rendering code:

function render(model){
  let current_state_name = model.active_states[0].name;
  return $("h1",
           {style: {color: "darkBlue"}},
           `The current state is: ${current_state_name}`);
}
@marcosh
Copy link
Owner

marcosh commented Apr 14, 2023

That would be cool!

Just some random thoughts:

  • we don't have names for transitions available, which could be an issue in generating a diagram
  • more generally, we have only the topology (i.e. allowed transitions), which is a bit less than what you expect in sketch.systems (i.e. there could be several ways to move between two states)
  • composed machines (built with constructors other than Basic) will get fairly big quite soon, since their state space is the product of the state spaces. Hence I think that a representation as the flow one I implemented is more effective

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants