You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is not an artifact of me cleaning up the layout utils code from yesterday - this problem persists even on the old redundant-ccs branch.
When I write out the causal DOT code and lay it out using dot on the CLI, the edge appears fine. Need to figure out where the weird control points are coming from.
using shape=rect (instead of the house / invhouse things) fixes the issue for cc2, but makes the problem worse for cc1 lol
upgrading the graphviz version installed to 14.x still suffers from the problem, albeit the problem now impacts different edges in the same graph (???????)
laying out the graph outside of pgv does not produce this problem, and even using the pygraphviz .draw() method to a PDF or something works fine. maybe there is some sort of overflow happening?
for testing an xdot, you can run neato -n2 test.xdot > test.svg in order to at least visualize the positions (running dot instead of neato will cause problems since it doesn't respect -n2 -- https://stackoverflow.com/a/19435272)
the xdot coordinates seem right. if you open up the SVGs from above in inkscape or something the weird edges in question seem perfectly fine, and even if you compare their pos attributes to other edges there are not any obvious problems
using subprocess.run("dot -Txdot lay.dot > lay.xdot", shell=True) to lay out the graph outside of graphviz, then loading the xdot back into pygraphviz, does not fix things
the cpd / cpw control points we are producing for Cytoscape.js also seem right. below, the 139-target edge (-utig4-69) is the one with the goofy routing, and yet its control points seem very similar to its surroundings.
It seems like this might be a Cytoscape.js thing, for some obscure reason?
If there is a way to detect these kinds of problems then I can try to flatten these edges... but I am not aware yet of a way to do this after passing data to Cytoscape.js.
the _private.bbCache and _private.bodyBounds are much higher for the goofy edge. Maybe we can compute the histogram of all of these values for each edge, detect outliers, and flatten them?
the _private.rstyle.bezierpts are also clearly crazy, see below
So maybe we can implement something similar to the bad-edge rescuing that - given a bounding box computed from the nodes in the graph (cy.nodes().boundingBox()), plus some generous tolerance - detects edges with control points that leave this bounding box and flattens them.
Activity
fedarko commentedon Mar 27, 2026
using
shape=rect(instead of the house / invhouse things) fixes the issue for cc2, but makes the problem worse for cc1 lolupgrading the graphviz version installed to 14.x still suffers from the problem, albeit the problem now impacts different edges in the same graph (???????)
laying out the graph outside of pgv does not produce this problem, and even using the pygraphviz
.draw()method to a PDF or something works fine. maybe there is some sort of overflow happening?for testing an xdot, you can run
neato -n2 test.xdot > test.svgin order to at least visualize the positions (runningdotinstead ofneatowill cause problems since it doesn't respect-n2-- https://stackoverflow.com/a/19435272)the xdot coordinates seem right. if you open up the SVGs from above in inkscape or something the weird edges in question seem perfectly fine, and even if you compare their
posattributes to other edges there are not any obvious problemsusing
subprocess.run("dot -Txdot lay.dot > lay.xdot", shell=True)to lay out the graph outside of graphviz, then loading the xdot back into pygraphviz, does not fix thingsthe cpd / cpw control points we are producing for Cytoscape.js also seem right. below, the
139-target edge (-utig4-69) is the one with the goofy routing, and yet its control points seem very similar to its surroundings.It seems like this might be a Cytoscape.js thing, for some obscure reason?
If there is a way to detect these kinds of problems then I can try to flatten these edges... but I am not aware yet of a way to do this after passing data to Cytoscape.js.
_private.bbCacheand_private.bodyBoundsare much higher for the goofy edge. Maybe we can compute the histogram of all of these values for each edge, detect outliers, and flatten them?_private.rstyle.bezierptsare also clearly crazy, see belowSo maybe we can implement something similar to the bad-edge rescuing that - given a bounding box computed from the nodes in the graph (
cy.nodes().boundingBox()), plus some generous tolerance - detects edges with control points that leave this bounding box and flattens them.ok, how about
Should ideally also report this as a Cytoscape.js issue, so confused by why this is even happening
mention #406 in README
tidy up changelog re #406