This is true. I had to append a g to svg and alter that with zoomed, while the zoom is called on svg. This is the only way I've found to avoid problems with weirdness and bad panning when zoomed in. When I switch back to only using svg in both the .call and the callback, the zoom button instantly works. But the rest of the zoom is half broken.
When I use svg in both the zoomed() callback and I selection.call(zoom) on it, like so:
function zoomed() {
svg.attr("transform", d3.event.transform);
}
svg = d3.select(".chart")
.append("svg")
.attr("width", w)
.attr("height", h)
.append("g")
.call(zoom)
;
// I cause choppy zoom, slow pan: http://dev.relato.io/gene
Whereas if I use group1 in the zoomed() callback and I selection.call(zoom) on svg, like so:
function zoomed() {
group1.attr("transform", d3.event.transform);
}
svg = d3.select(".chart")
.append("svg")
.attr("width", w)
.attr("height", h)
.append("g")
.call(zoom)
;
var group1 = svg.append("g");
// I work well, the zoom is usable: http://staging.relato.io/gene
I have found reference to other people having this problem, do you have any ideas how to address it? I would prefer to use the top way to do zoom, because it makes the zoom button very easy. I think I'm probably doing this all wrong :)
Thanks!
Russ