netcreateorg / netcreate-2018

Please report bugs, problems, ideas in the project Issues page: https://github.com/netcreateorg/netcreate-2018/issues
Other
11 stars 2 forks source link

Login causes graph to shift #171

Closed benloh closed 2 years ago

benloh commented 2 years ago

From #169:

an old issue that when you login, the graph gets shifted up and two the left for some reason

benloh commented 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.

jdanish commented 2 years ago

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.

benloh commented 2 years ago

Ah! I see now, thanks.

benloh commented 2 years ago

The Problem

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.

The Solution

Using CSS visibility: hidden fixes the problem -- it allows the browser to create objects and properly calculate heights.

Should be fixed with : 2bb2ac51fd159e6d4af0ff5b082eca2068297238

jdanish commented 2 years ago

Looks fixed. Awesome. Thanks!