question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Nested states that transition to themselves look weird

See original GitHub issue

Thanks for this great project and sorry for the strange title. When nested states reference themself the rendered outpout looks weird and it’s hard to see what is happening in the statechart:

bildschirmfoto 2018-10-18 um 19 17 40

Expected Behavior

I would expect that a transition from a nested state to itself looks the same as a non nested-state to itself.

Current Behavior

The transition of a nested state to itself is drawn inside of the nested state which is easy to miss when looking at the diagram.

Possible Solution

Not sure

Steps to Reproduce (for bugs)

This is the diagram I am drawing:

initial,
"media player off",

"media player on" {
  stopped, playing, paused;

  stopped => playing : play;
  playing => stopped : stop;
  playing => paused  : pause;
  paused  => playing : pause;
  paused  => stopped : stop;
};

initial            => "media player off";
"media player off" => stopped           : power;
"media player on"  => "media player off" : power;
"media player off" => "media player off";
"media player on" => "media player on";

Context

I’m trying to build a visualizer for an ember-addon https://github.com/LevelbossMike/ember-statecharts that I am working on and would like to use state-machine-cat as the project that creates the visual output.

Your Environment

I’m using the web-editor.

Thanks again for this great project! I’m using your diagramming tool nearly every day and it makes my dev-life much easier 🍻

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:10 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
sverweijcommented, Oct 22, 2018

@LevelbossMike I haven’t released it yet - have to do some juggling in the dot reporter to get to the result. I’ll let you know in this thread when I have something testable ready.

0reactions
sverweijcommented, Oct 27, 2018

@LevelbossMike I’ve merged the PR, released to npm as 4.1.5 and to the main branch on state-machine-cat.js.org.

Thanks again for raising the issue and for the prompt feedback!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Best Practice for Transitioning From Nested State to Nested ...
I'll try to simplify the problem before suggesting a possible approach. The transitions seem related to the views, and not the model.
Read more >
Nested State - an overview | ScienceDirect Topics
The rules are that: (1) the nested state targeted by transitions exiting the fork must be in different AND-states, (2) any AND-state region...
Read more >
Guidelines: Statechart Diagram
Unless otherwise specified, when a transition enters a composite state, the action of the nested state machine starts over again at the initial...
Read more >
Transition - Glossary - Statecharts
A self transition is a transition that goes from and to the same state. ... A transition can have multiple targets, in case...
Read more >
State Machines and Statecharts: What are they?
There are multiple transitions between states. A transition is a function that determines the next state based on the current state and an ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found