AlexandreDecan / sismic

Sismic Interactive Statechart Model Interpreter and Checker http://sismic.readthedocs.io/
GNU Lesser General Public License v3.0
141 stars 25 forks source link

Support for visualising statecharts #12

Closed tommens closed 6 years ago

tommens commented 8 years ago

It would be great, some time in the future, to have support for statechart visualisation. This would/should include

AlexandreDecan commented 8 years ago

I plan to add a way to export YAML statecharts to a graphical representation (either static, or dynamic through a GUI). We should not expect the other items to be satisfied in short terms, given how hard it is (even for large communities of developers !) to make (or embed in) modeling tools.

evdokim commented 8 years ago

I agree with @tommens. I think that a visualisation feature will make Sismic a truly great tool, something like a swagger for lifecycle description. @AlexandreDecan I wish a success with your amazing tool!

AlexandreDecan commented 8 years ago

Thanks @evdokim!

tommens commented 8 years ago

A perhaps "simple" solution would be to use an external tool, like e.g. PlantUML http://plantuml.sourceforge.net to visualise diagrams. It does have the disadvantage of requiring to install a different tool for this purpose, and I do not know if all features of statecharts are already supported by that tool (for example, I does not seem to have history states). See http://plantuml.com/state.html PlantUML requires the installation of GraphViz as well, which is a general purpose graph-based visualisation tool.

evdokim commented 8 years ago

A similar solution would be generating dot files that can be used as an input for GraphViz.

AlexandreDecan commented 8 years ago

@tommens the problem is not to display the statechart, but to compute a layout. Exporting to PlantUML's file format (for example) should not be hard. But it does not solve the problem.

@evdokim I tried few weeks ago to export statecharts using DOT, because one can automatically compute a layout from such a file. The problem is that DOT does not properly support (multiple) nested graphs layouts. I did not manage to automatically calculate the position and size of nested sub-graphs in a satisfactory way.

To design a UI to display statecharts (or to provide a way to graphically export a statechart) is not difficult if the layout is provided by the user. What is really difficult is to automatically compute the position and size of elements in order to have a "human-friendly" representation of a statechart.

I will soon try to design a UI with GTK or QT. It will support (at least!) the same features than what is currently available in the "ui" branch of this repository (a tiny toy UI to execute statecharts, using tkinter). After that, I'll look to offer a statecharts display feature directly in the UI, with the ability to drag&drop elements and to save the resulting layout. This should not be so difficult to implement. I hope so;)

AlexandreDecan commented 7 years ago

As a first step, please consider https://radiogiorgio.github.io/statechart-visualizer/ (by @radiogiorgio)

AlexandreDecan commented 6 years ago

We are close to something usable:

We also plan to support EMF UML2 (used in Papyrus for instance).

AlexandreDecan commented 6 years ago

https://github.com/AlexandreDecan/sismic-extensions