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

conditional transitions break the visualisation #200

Open
bonduell opened this issue Jul 24, 2020 · 0 comments
Open

conditional transitions break the visualisation #200

bonduell opened this issue Jul 24, 2020 · 0 comments

Comments

@bonduell
Copy link

bonduell commented Jul 24, 2020

if i try to use transitions like { name : 'goto', from: 'A' to: newState => newState) - visualisation doesn't work as expected.

a little fix can improve this ->

dotcfg.transitions = function(config, options) {
let init = config.init,
transitions = config.options.transitions || [], // easier to visualize using the ORIGINAL transition declarations rather than our run-time mapping
output = [];

if (options.init && init.active) {
    dotcfg.transition(init.name, init.from, init.to, init.dot, config, options, output)
}

transitions.forEach(transition => {
    let to = typeof (transition.to) === 'function' ? transition.to() : transition.to;
    to && dotcfg.transition(transition.name, transition.from, to, transition.dot, config, options, output);
})

return output;

}

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

1 participant