Open lichengzhang1 opened 1 year ago
I'm happy to see that people enjoy using @kubaPod's graph editor!
My take on this is the following:
The primary intention of the graph editor is to be able to quickly create small graphs with the desired structure. Detailed visual customization is not a major goal. If that is needed, diagramming software, such as yEd, will be a better choice that we couldn't possibly compete with anyway.
Regarding changing the curvature of each edges individually, by dragging: This is problematic, and I do not think it should be implemented at the moment. The reason is that there is no clean way for users to alter the routing of edges in a Graph
. Graph
does support edge routing, as evidenced by the LayeredDigraphEmbedding
graph layout, which routes edges to avoid collisions with vertices. The EdgeShapeFunction
can also take not just two endpoints, but an entire list of points that define where the edge runs. But this appears to be an internal feature. I was unable to find a way to access it, even through undocumented means. We can set vertex coordinates, but there seems to be no way to set a list of routing coordinates for each edge. In fact, I've requested this feature already years ago, but it hasn't been implemented yet.
The only way for a user to customize edge routing is to set a different EdgeShapeFunction
for each and every edge. That is a very problematic thing to do as the edge routing won't be able to adapt when the graph is changed. I do not think we should go down that route.
A practical solution would be for the graph editor to respect the EdgeShapeFunction
setting, and just set a curved edge shape. I.e., it would not be possible to shape each edge separately by interactive dragging, but it would be possible to make all edges appear curved. Something like this: CompleteGraph[{2, 2, 2, 2}, EdgeShapeFunction -> "CurvedEdge"]
. I do not know if this is feasible for IGGraphEditor[]
in practice. Performance might be a problem. It's up to @kubaPod to decide how to proceed here, as he understand much better what is possible and how much work this would take. My suggestion is not to sacrifice interactive editing performance for custom edge shapes.
Cross-posted at Mathematica stack.
In
IGGraphEditor
, we can easily move vertices of the above graph $K_{2,2,2,2}$, but drawn edges are always straight lines and cannot be altered to be curved.For example, I prefer the following layout of $K_{2,2,2,2}.$
I don't know what is difficult about that? Because many dynamic drawing systems, such as houseofgraphs and
layout = interactive
in maple also only provide the ability to draw straight lines.