jgraph / mxgraph

mxGraph is a fully client side JavaScript diagramming library
Other
6.82k stars 2.06k forks source link

Draggable graph using mxgraph #481

Closed govinda18 closed 4 years ago

govinda18 commented 4 years ago

I am new to mxgraph and want to create a behaviour to drag the entire graph. The behaviour is expected to be similar to this(from cytoscape):

enter image description here

Any way to achieve this in mxgraph?

tbouffard commented 4 years ago

@govinda18 mxGraph calls this feature panning, see https://jgraph.github.io/mxgraph/docs/js-api/files/view/mxGraph-js.html#mxGraph.setPanning and information about panning in this documentation

You can see it in action in https://jgraph.github.io/mxgraph/javascript/examples/autolayout.html (you can hold the left or right mouse button to use panning)

tbouffard commented 4 years ago

Same question on stackoverflow: https://stackoverflow.com/questions/63486608/panning-event-for-mxgraph