Reputation: 1028
While using R graph(Javascript Infovis Toolkit) I found only mouse wheel can be used as zoom in and out. Can any one help me with how I may control the graph with two buttons instead of mouse wheel.
Upvotes: 0
Views: 961
Reputation: 11
This is an example for the Force directed variant for graph named
You can change the .zooming value as provided in the example, in this one I set it to 15 and it zooms fairly slowly. fd:
function zoom(delta)
{
if (fd)
{
var val = fd.controller.Navigation.zooming/1000;
var ans = 1 - (delta * val);
fd.canvas.scale(ans, ans);
}
}
Upvotes: 1