How to add background image with zoom in / zoom out to sigma.js

I am using sigma.js and trying to add a background image instead of a background color. This works, but it is not possible to zoom in / out. Someone is already adding a question here , but there is no answer yet. So who has a solution to this problem?

+5
source share
1 answer

After a simple successful search, I found the following solution:

var c = s.camera; // Zoom out - single frame : c.goTo({ ratio: c.ratio * c.settings('zoomingRatio') }); // Zoom in - single frame : c.goTo({ ratio: c.ratio / c.settings('zoomingRatio') }); // Zoom out - animation : sigma.misc.animation.camera(c, { ratio: c.ratio * c.settings('zoomingRatio') }, { duration: 200 }); // Zoom in - animation : sigma.misc.animation.camera(c, { ratio: c.ratio / c.settings('zoomingRatio') }, { duration: 200 }); 
+1
source

Source: https://habr.com/ru/post/1237910/


All Articles