I have a problem since a few days. I have a graph and when I use Zoom Behavior it works, but I need to know when I reach maximum zoom to load new given
// Specifies the zoom scale's allowed range, [min, max]
d3.behavior.zoom().x(x).scaleExtent([1,10]).on("zoom", draw)
See my code http://jsfiddle.net/albanlopez/D4MRP/
In the draw function the current event will have the zoom level (d3.event.scale as you mentioned). Also if you keep the behaviour around like:
var zm = d3.behavior.zoom().x(x).scaleExtent([1,10]).on("zoom", draw);
Then you can find the current zoom level by calling:
zm.scale();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With