dondi / GRNsight

Web app and service for modeling and visualizing gene regulatory networks.
http://dondi.github.io/GRNsight
BSD 3-Clause "New" or "Revised" License
17 stars 8 forks source link

Fit to window causes the graph to shrink to one node #945

Closed ahmad00m closed 1 year ago

ahmad00m commented 2 years ago

When fit to window option from the setting is chosen, the graph shrinks down to one node but it appears that reselecting another view size causes the graph to go back to normal.

Screenshot 2021-12-09 at 4 36 16 pm 2
dondi commented 2 years ago

This one will need some prior reading on the D3 library. The classic starter is the “Three Circles” article. It also appears that D3 has updated its introductory page in the interim

Sarronnn commented 2 years ago

Could not get the graph to show up: do I need to upload a gene sequence?

kdahlquist commented 2 years ago

You should be able to reproduce this just by loading the demo files under the demo menu.

Sarronnn commented 2 years ago

I tried the files under demo:

Sarronnn commented 2 years ago

And what is a D3 scale=> A function; calling it returns the visual value (such as an x-position) corresponding to the given abstract value (such as a count). Screenshot (48) Under graph.js: Am I looking at the correct function? If so:

From Thre Little Circles :

Questions:

dondi commented 2 years ago

@Sarronnn if you have any updates on this since last time, please post when you can, thanks!

Sarronnn commented 2 years ago

Currently: Trying to understand what code is saying. // Subtract 1 from SVG height if we are fitting to window so as to prevent scrollbars from showing up // Is inconsistent, but I'm tired of fighting with it... d3.select("svg").attr("width", newWidth) .attr("height", $(".grnsight-container").hasClass(VIEWPORT_FIT) ? newHeight : newHeight); d3.select("rect").attr("width", width).attr("height", height); d3.select(".boundingBox").attr("width", width).attr("height", height);

Question: Am I looking in the correct place? Searched the key word "fit to window" and this line of code showed up. But I'm not sure if this part of the code deals with fitting the graph to the window because the comment above it says something about scrollbars.

Sarronnn commented 1 year ago

This seems to no longer be an issue. When the "fit to window" setting is selected, the graph shrinks to fit the window, i.e it no longer shrinks to just one node.

Screen Shot 2022-11-30 at 8 59 19 AM
dondi commented 1 year ago

Interesting—we can verify this upon the next deployment to beta

dondi commented 1 year ago

Unfortunately, on beta v6.0.3, I was still able to replicate this behavior 😔

kdahlquist commented 1 year ago

@Sarronnn will check to see if this is replicable as part of #1012

Sarronnn commented 1 year ago

Here is beta v6.0.3:

Screen Shot 2023-01-21 at 3 44 03 PM
dondi commented 1 year ago

This may need more triage—vary various conditions, log/journal specific sequences of actions (so you know not to repeat yourself)…discrepancy is confirmed by @Onariaginosa

dondi commented 1 year ago

At a minimum, let’s try to document any conditions that either make the bug reliably replicable or reliably not replicable—maybe by having those summarized in writing, we can draw some insight on what is making the difference

Sarronnn commented 1 year ago

On my machine On Beta
Reload → pick demo → fit to window--- (Bug isn’t replicable) Reload → pick demo → fit to window--- (Bug is replicable)
Reload → fit to window → pick demo--- (Bug isn’t replicable) Reload → fit to window → pick demo--- (Bug isn’t replicable)
Reload → pick demo → large view → fit to window--- (Bug isn’t replicable) Reload → pick demo → large view → fit to window--- (Bug is replicable)
Reload → pick demo → small view → fit to window--- (Bug isn’t replicable) Reload → pick demo → small view → fit to window--- (Bug is replicable)
Change demos as fit to window is checked--- (Bug isn’t replicable) Change demos as fit to window is checked--- (The now loaded graph is not shrinking)


  • Conclusions => 

    • The bug is replicable on beta only. Could not replicate bug on my branch; at least not in the possible checks that I have tried. 

    • Looks like if we check “fit to window” first, before loading a demo, then proceed to load demo, the bug is not replicable on beta. 

kdahlquist commented 1 year ago

Hypothesis:

kdahlquist commented 1 year ago

Could also investigate whether being embedded in the website has an effect.

dondi commented 1 year ago

Total size: 321M, compressed is ~80M

GitHub issues will only accept a 25M maximum, so this has been placed in the Box GRNsight folder: https://lmu.app.box.com/folder/100940731183 (_node_modulesbeta.zip)

@Sarronnn ☝🏽 (or anyone else who is interested in trying, for that matter)

Sarronnn commented 1 year ago
Screenshot 2023-02-21 at 9 49 46 PM
kdahlquist commented 1 year ago

To clear the undefined bug, pull from @Onariaginosa 's branch.

@Sarronnn and @dondi will meet to work on the npm run start-dev issue in office hours.

Sarronnn commented 1 year ago

Possible reasons branch is not replicable: 1) Configuration differences: My branch may have a different configuration or environment setup compared to the main branch, which may affect the behavior of the application.

2) Dependencies: My branch may have different dependencies compared to the main branch, which could affect the behavior of the application. For example, if a library or module used in my branch is different from the one used in the main branch, this could cause the issue to occur or not occur.

Comparison with my branch and beta:

Screenshot 2023-03-14 at 6 41 23 PM
Sarronnn commented 1 year ago

Theory about the error:

 - Coordinates? => Issue with the coordinates that are used to define the path

         - No, because both beta & my branch have the same d3 network

- Discussed with Dondi:

         - Issue could be because of Node version difference

               - Our server is on Node 10, and I am on Node 14 (Can't go lower) 
dondi commented 1 year ago

It turns out that @Onariaginosa can run Node 10, so she will see if the bug replicates locally for her

Update: Bug does not replicate for @Onariaginosa locally on Node 10

@dondi will seek to escalate the lambda work to see if this bug takes place under that configuration

dondi commented 1 year ago

@Sarronnn see if the bug can be reproduced on the Lambda installation: https://2dz4kdk52j37d7xhm6cwi4u4wq0ydwdv.lambda-url.us-east-1.on.aws

Sarronnn commented 1 year ago

Bug cannot be produced on the Lambda Installation. Although, the whole window seemed to be buggy..

Screenshot 2023-03-22 at 10 39 45 AM
dondi commented 1 year ago

Based on these findings, it looks like the root cause is the specific dependency versions that are installed when running a version of Node that is too old

This will be a non-factor going forward due to our ability to use newer versions of Node via the Lambda approach