Hi,
Let me start by saying that this is a great feature! That said, I do not know if it should be a part of PlantUML itself. For me these features seem to be a "layer on top" of PlantUML.
What I fear is that the numberof use-cases these features will enable, is so large, that it will be almost impossible to maintain. When I think about interaction I ask myself questions along the following lines:
- are interactions just time-sliced picture? Meaning, regenerate the image after each interaction? Or dynamically manipulate the SVG?
- Is the interaction fully client side? What if the interaction changed the "shape" or "layout" of the rendered graph? I don't think you'll want to end up having to have Graphvis and PantUML ported to JavaScript which might be a requirement of going full on interactive...
- static vs dynamic interaction:
- Ids (static)
- classes (static + dynamic)
- interactions (mouseover, etc) (dynamic)
Is interactive SVG useful at all? (just to be clear)
Yes! Very much so!
Is someone really depend on the old SVG file format? (to find out the default behavior of the SVG exporter)
Probably, but because the current version is "just an image in SVG" this might not be a problem. Still, I'd personally keep the SVG output the way it is and add another mode/behavior.
What fundamental differences can interactive modes have? (to find out the need to make several of them - if yes, how should we implement switching between them)
The fundamental differences lie in the use-cases. This feature has the potential of someone building a complete GUI application in PlantUML+SVG I would not be surprised to eventually see mario cart ported to PlantUML...
What it boils down to is that you'll need to maintain state. State can be maintained in two placed, as part of the SVG though the use of classes, nodes, CDATA etc. Or within the client application rendering the SVG by creating hooks.
State can trigger two types of manipulation:
- Graph functions (like nearest neighbors)
- Full re-rendering
- State manipulation
- classes
- ids
- hide, show, animate (which may or may not trigger re-rendering of the graph)
- Manipulate the image
- Draw an extra edge between vertices
- Move nodes
- Create borders around sets of nodes (sub graphs)
- Create a sequence of class changes over time (example: to see how data flows through a component diagram)
final thoughts, I really think that adding interaction is an awesome way to enrich the otherwise static functionality. I would advice to start by generating Ids and classes and add a simple JS library with the basic graph functionality.
I hope this helps and keep up the super product I use and love it every day!