-
Notifications
You must be signed in to change notification settings - Fork 31
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
Usability problems #135
Comments
Yes, so to create edges I'm doing this: let ei1 = gc.g.add_edge(creating_node_id, NodeIndex::from(payload.id as u32), Edge::new(edge_data));
gc.g.edge_weight_mut(ei1).unwrap().bind(ei1, 0);
if EdgeData::Equivalence == edge_data {
let ei2 = gc.g.add_edge(NodeIndex::from(payload.id as u32), creating_node_id, Edge::new(edge_data));
gc.g.edge_weight_mut(ei2).unwrap().bind(ei2, 0);
} |
Thanks for raising this issue, such common workflow should be simple. I will prioritize this. |
Having worked with this nice lib the last couple of weeks, I have some thoughts I wanted to share 🙂. 1I think the new setup with the 2Related to this is that
1 Seems fairly easy to implement, but I think 2 makes more sense as it's a typical "view" thing (but then again, so is a property like location, so the distinction between model and view is not that strictly defined). Also, 2 removes the need to have the NodeDisplay and EdgeDisplay be generic parameters of the graph. The downside for 2 is that you either need to allocate an associated datastructure, or you have to recreate the display nodes each time you call one of its methods (or just make them functions that don't take 3It's a bit convoluted to reference other state in the custom draws, to the point where you basically need to add data to each and every node to get access to some other datastructure in your program. I'd suggest adding some custom context to the 4There has been an explosion in generic parameters that keep needing to be repeated everywhere. Have you considered using a trait that encapsulates all the current generic parameters as type aliases, and then have a single generic parameter that implements this trait? 5It would be nice if I'll be happy to take on some or all of these points if we can reach a consensus on some spec 🙂 |
Hey @oisyn, thanks for the feedback!
Most of these are maturity issues caused by the new I am really grateful that you spent time thinking of the ways to make this lib better. Feel free to create issues and PRs on any of the points for further discussion and fixes or we can continue here on some of them. |
In reference to this, how can I access the |
You can get access to |
Now users are facing very verbose generic definitions and multiple steps to perform simple task on elements/graph updates.
I will keep this ticket here and definitely think of some optimizations of the process or introducing macros before coming to stable releases.
The text was updated successfully, but these errors were encountered: