ofrohn / d3-celestial

A star map with d3.js
BSD 3-Clause "New" or "Revised" License
631 stars 179 forks source link

Projection going outside the container #105

Closed donjajo closed 3 years ago

donjajo commented 3 years ago

I realised this issue on Windows browsers, which is weird. I have been developing within Linux environment and did not find this issue. The projection on load gets so big and goes outside the container, but on any slight resize on the browser window, it fits in the correct way.

I have tried triggering the window resize event on load, it doesn't work. Is there a solution for this please?

donjajo commented 3 years ago

Fixed issue with still triggering resize event onload or componentDidMount in React. jQuery(window).trigger("resize") do not seem to be working. window.dispatchEvent(new Event('resize')); did it.