Need help in having a zoom in and zoom out button in visjs network graph using angularjs, I could not find any relevant options for this. Please help, I am also providing a plunker link as an example
Code
<vis-network data="data" options="options" height="100%"></vis-network>
$scope.options = {
autoResize: true,
height: '800',
width: '100%'
};
I've never worked with plunker, so I can not integrated my solution into your example, but I've created a JSFiddle for it which is based on a simple network example from the visjs.org website.
Unfortunately there is no
setScale(scale)method available right now, but you could extend thenetworkuntil someone implements it.The
vis.Network.setScalecode was taken from the Network.js and View.js source code, based on whatgetScale()did. I had to redo some things which the methodsView.fit,View._getRangeandView._findCenterdid but it's working good so far.