aiidateam / aiida-workgraph

Efficiently design and manage flexible workflows with AiiDA, featuring an interactive GUI, checkpoints, provenance tracking, and remote execution capabilities.
https://aiida-workgraph.readthedocs.io/en/latest/
MIT License
9 stars 5 forks source link

Handling Grouping of Node Sockets #246

Open superstar54 opened 3 weeks ago

superstar54 commented 3 weeks ago

Background:

In early 2022, when the node-graph package was developed, Blender did not support grouping of node sockets. As a result, socket inherency was not considered in the implementation of node-graph. This has implications for how we handle AiiDA namespace ports, which represents a nested structure. In the current implementation, the workgraph creates a separate socket for each item within the namespace. All these sockets, including the namespace socket itself, are placed on the same hierarchical level. This results in the following structure for the metadata namespace of a calcfunction:

metadata                 
metadata.store_provenance
metadata.description     
metadata.label           
metadata.call_link_label 
metadata.disable_cache   

Recent Developments:

In 2023, Blender introduced support for grouping node sockets (see Blender PR #111348). This new feature is extremely useful for organizing complex node setups and could enhance the usability.

However, the JavaScript library we are using for the web GUI, Rete.js, currently does not support grouping of node sockets. This limitation prevents us from fully leveraging the grouping capabilities introduced in Blender.

Proposed Solutions:

  1. Partial Support via Python API:

    • We could introduce support for grouping node sockets within our Python API. This would allow developers to define grouped sockets programmatically. However, in the web GUI, these groups would still be displayed as separate items, maintaining the current flat structure.
  2. Wait for Rete.js to Support Grouping:

    • We can wait for Rete.js to add support for grouping node sockets. However, there is no clear timeline for when or if this feature will be implemented.
  3. Create custom node and socket

    • Still using retejs, but try to create a custom node and socket to include this feature. However, it needs people who are good at Javascript.