cytoscape.js: Allow for setting whether dragging from an element causes panning
Issue type
Feature request
Description of new feature
Allow for no panning to occur when dragging on an edge.
Proposed API:
ele.pannable(): Get whether panning happens when dragging on the elementeles.panify(): Make the elements pannable.eles.unpanify(): Make the elements unpannable.
This allows for per-element granularity, and it’s consistent with existing functions like node.grabbable().
Motivation for new feature
When a tapdown-tapdrag gesture happens on an edge, it causes panning. This is useful for dense graphs, where panning on an empty area may be difficult.
However, it may be desirable for some apps to have their own behaviour for dragging on an edge. For example, you may want to drag the connected nodes of an edge when the edge is dragged.
This would be useful in apps like Factoid.
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 4
- Comments: 17 (5 by maintainers)
@lambdalisue’s extension is great, but basic native API support would be useful for things like changing the
ele.grabbable()value automatically based onele.pannable(). Even with the native feature, the extension could have convenience functions for things like toggling the pan anywhere mode. Another useful extension feature would be to easily customise keyboard shortcuts for toggling pan anywhere mode (e.g. enable pan anywhere mode when shift is held).