Closed benloh closed 2 years ago
@jdanish Logging in actually causes a complete page reload. The redraw is probably what is causing the graph to look like it's shifted (I think)? Any chance you can show me a dataset or a movie cliip of this happening? It might be next to impossible to fix unless we can figure out how to do the login without a reload, which might be a big rewrite.
Sorry, it is apparently only for the graphs where you cannot display it without a login. Once you login it displays as if the center is up and to the left of the screen rather than the actual center. I can take a pic later if that doesn't make it easy to reproduce.
Ah! I see now, thanks.
We were using React's "hidden" attribute to hide the graph if the user was not logged in. The problem is that if the graph is hidden, its size is never correctly calculated -- it ends up with a width and height of 0. So when the graph is eventually loaded and zoomed, it does so assuming the graph is 0x0.
Using CSS visibility: hidden
fixes the problem -- it allows the browser to create objects and properly calculate heights.
Should be fixed with : 2bb2ac51fd159e6d4af0ff5b082eca2068297238
Looks fixed. Awesome. Thanks!
From #169: