Skip to content

Commit 23eeb04

Browse files
authored
Merge pull request #229 from saksham-gera/dev
Zoom Component Will now update zoom level on zooming through mouse scroll
2 parents 55f77a9 + df0215d commit 23eeb04

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/GraphArea.jsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ function Graph({
2727
}
2828
if (graphML) myGraph.setGraphML(graphML);
2929
myGraph.setCurStatus();
30+
myGraph.cy.on('zoom', () => {
31+
dispatcher({ type: T.SET_ZOOM_LEVEL, payload: (myGraph.cy.zoom() * 100).toFixed(0) });
32+
});
3033
return myGraph;
3134
};
3235
// Remote server implementation - Not being used.

0 commit comments

Comments
 (0)