AlgebraicJulia / Semagrams.jl

A graphical editor for graph-like structures
https://algebraicjulia.github.io/Semagrams.jl/
MIT License
95 stars 10 forks source link

Semagrams <> AlgebraicDynamics #32

Open slibkind opened 3 years ago

slibkind commented 3 years ago

Summary: Allow users to build compositions of dynamical systems (both the diagram of systems and the elementary models) in Semagrams.

To design the diagram of systems, the user would draw boxes and wires between the boxes. Ports would be inferred from wires or added by the user. Designing the diagram of systems could also be hierarchical. So I can click on a box to draw a semagram inside of it and then zoom out. In the zoomed out version I can either hide the internal semagrams or expose them.

To design the elementary models, the user would do one of three things

Once all of the boxes have been filled you should be able to click a button that runs the system with some chosen parameters and initial conditions.

olynch commented 3 years ago

I think that the most direct path towards this is via #21, where users can select from a palette of pre-defined dynamical systems and then compose them together. Therefore, I'm going to focus my energy on #21, and I think once that is done, a good chunk of this should work (though, not the recursive bit). Any ideas you have w.r.t. what is a natural UI for selecting from a palette of boxes (i.e. drag and drop? type-ahead text box? etc.) are very welcome.

jpfairbanks commented 3 years ago

Having a V1 where users write out the smc signature using @present in code and then using that to populate a box palatte would work for DWDs with Machines. For UWDs you would need to have a data structure for the boxes with the number of legs and the type on that leg to populate the palette.

V2 of the integration could have a palette composer interface based on the operations of add_box(), add_port(b::Box) and attaching expressions to the boxes and ports.