By default cytoscape lets the user drag nodes around. The drag
detector kicks in if the pointer moves more than a few pixels
between mousedown and mouseup, and when that happens cytoscape
suppresses the corresponding 'tap' event — which is what our
hand-rolled double-click handler listens to. So a slightly-jittery
double-click on a class node looked like the node was being dragged
without ever drilling into the instance view.
Set autoungrabify: true at init. Dagre re-runs the layout every time
loadGraph is invoked, so user repositioning of individual nodes was
already throwaway — disabling grabbing is a clean improvement on
both axes.
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
container: document.getElementById('cy'),
elements: [],
style: cyStyles(),
+ // Disable per-node grabbing. Without this, cytoscape interprets a
+ // click that moves even a couple of pixels between mousedown and
+ // mouseup as a drag — and `tap` never fires, so our double-click
+ // detector misses it (the user sees the node "drift" instead of
+ // drilling in). dagre re-runs the layout after every loadGraph
+ // anyway, so dragging individual nodes only ever produced
+ // throwaway repositioning.
+ autoungrabify: true,
});
// ---------------------------------------------------------------------------