vstirbu / fsm-viewer Goto Github PK
View Code? Open in Web Editor NEWView finite state machines using fsm-as-promised library as UML diagrams in VSCode
License: MIT License
View finite state machines using fsm-as-promised library as UML diagrams in VSCode
License: MIT License
Extension 'vstirbu.fsm-viewer' uses the 'vscode.previewHtml' command which is deprecated and will be removed soon. Please file an issue against this extension to update to use VS Code's webview API.
Use bundling to decrease the number of files.
Render this situation:
...
{ name: 'event', from: ['a', 'b'], to: 'c' }
...
Run digram rendering when switching to a new window.
The size of the SVG is determined by the original window size. Adjust SVG size when preview window size changes.
This is not working
var StateMachine = require('fsm-as-promised');
var protocol = {
state: 'unpublished',
data: {
omg: 'trafalet'
}
}
var fsm = StateMachine({
initial: "unpublished",
events: [
{ name: 'publish', from: 'unpublished', to: 'published' }
],
callbacks: {
//quoted
"onpublish": function (options) {
console.log('whatever');
}
}
}, protocol);
fsm.publish();
This is working
var StateMachine = require('fsm-as-promised');
var protocol = {
state: 'unpublished',
data: {
omg: 'trafalet'
}
}
var fsm = StateMachine({
initial: "unpublished",
events: [
{ name: 'publish', from: 'unpublished', to: 'published' }
],
callbacks: {
//unquoted
onpublish: function (options) {
console.log('whatever');
}
}
}, protocol);
fsm.publish();
Currently you have to click or select a text to trigger the diagram draw.
The plugin does not render state machines defined like this:
import fsm from 'fsm-as-promised';
const instance = fsm({...});
The fsm-as-promised library allows defining activities and guards. The extension should be able to render them:
const fsm = require('fsm-as-promised');
const extension = fsm({
initial: 'first',
events: [
{ name: 'event', from: 'first', to: 'second' },
{ name: 'activity', from: 'second' },
],
callbacks: {
onleavefirst: function exitguard() {},
onentersecond: function entryguard1() {},
onenteredsecond: function entryguard2() {},
}
});
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.