Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add many to many connections #2

Merged
merged 2 commits into from
Jul 5, 2024
Merged

Conversation

pepperoni505
Copy link

This ports this PR from the original egui_node_graph to work with this fork. As mentioned in the original PR, the functionality looks good. I tested briefly and no issues were found

kamirr and others added 2 commits May 17, 2023 16:54
This change enables many-to-manny graphs by extending input ports with a
capability to optionally accept multiple connections, via a
max_connections parameter. If this parameter is set to anything other
than Some(NonZeroU32(1)) the port will be referred to as `wide`.

* Adjust Graph::connections to map from InputId to Vec<OutputId> instead
  of just OutputId.
* Adjust UI to render wide ports as segments extending in length
  proportionally to the number of connections.
* Allow creating a new connection by dragging from an extra slot in a
  wide port.
* If a wide port is not full, an in-progress connection will move
  existing ones out of the way to allow intuitive ordering. Otherwise,
  the new connection will override the one it's hovering over within the
  port.
* Extend NodeResponse::ConnectEventEnded with an additional field
  containing the index under which the new connection resides within
  the input port.
* Add Graph::add_wide_input_param for creating wide ports.
@trevyn trevyn merged commit b8be6ae into trevyn:main Jul 5, 2024
1 of 2 checks passed
@trevyn
Copy link
Owner

trevyn commented Jul 5, 2024

Thanks!

@pepperoni505 pepperoni505 deleted the many-to-many branch July 5, 2024 03:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants