retejs / rete

JavaScript framework for visual programming
https://retejs.org
MIT License
10.17k stars 653 forks source link

[feat] Grouping Sockets #452

Closed NeverBehave closed 1 year ago

NeverBehave commented 4 years ago

When a component have lots of sockets (e.g. > 15), exposing the sockets directly on UI looks awkward and hard to make changes between nodes.

Examples:

+------------+
|        a1  |
|  A     a2  |
|        a3  |          +------------+
|        ... +-------+  | a1|c1      |
+------------+       |  | b1|c2  C   |
                     |  | a2|c3      |
                     +--> ...        |
+------------+       |  +------------+
|        b1  |       |
|  B     b2  |       |
|        b3  |       |
|        ... +-------+
+------------+

ideas

I have tried creating a special socket to handle such situation but the circumstance above required connections to store additional data (each connection/line has its own map to store the socket relationship), while I found https://github.com/retejs/rete/blob/e21bb0a6abbf926903a33acaa6d3405e57907f31/src/connection.ts#L13 constructor does not expose the data field.

Another way to define the relationship maybe to alter the UI for not showing the exact connections but leave the editor data structure unchanged, but it looks like the connection plugins also need to be altered when rendering, etc.

I am wondering if there is another way to implement such behavior, and the connection class behavior here: is it served for some special purposes? Thanks!

rete-js[bot] commented 1 year ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 10 days.