eisman / neo4jd3

Neo4j graph visualization using D3.js
https://eisman.github.io/neo4jd3/
MIT License
1.38k stars 424 forks source link

zoomFit not working on Chrome #3

Open newdev2017 opened 7 years ago

newdev2017 commented 7 years ago

zoomFit() is not working with Chrome browser. Tested on version 55.0.2883.87 m (64-bit). While it is working fine with FireFox, Tested version 51.0.1 (32-bit).

Replaced: svg.attr('transform', 'translate(' + svgTranslate[0] + ', ' + svgTranslate[1] + ') scale(' + svgScale + ')');

with: g.attr('transform', 'translate(' + svgTranslate[0] + ', ' + svgTranslate[1] + ') scale(' + svgScale + ')');

where var g = svg.append("g");

and it worked !

eisman commented 7 years ago

Thank you very much for your comment and your code, but I am using Chrome v57.0.2987.133 and I cannot reproduce the problem. I tried with both Windows and Linux. Maybe the problem has been fixed. Is it still happening to you with the latest version of Chrome?