Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Selecting a particular sequence of view options causes graph to shrink to the size of one node #1082

Open
kdahlquist opened this issue Jan 23, 2024 · 7 comments

Comments

@kdahlquist
Copy link
Collaborator

kdahlquist commented Jan 23, 2024

Do this on either production or beta 7.0.8:

  • Load Demo number 2
  • From the View menu, select small
  • select medium
  • select large
  • select fit to viewport and the graph will shrink to the size of one node.

It may not have to be this exact sequence to make this happen.

@dondi
Copy link
Owner

dondi commented Apr 2, 2024

Starting (actual) window size will determine the initial View setting, so @ceciliazaragoza will retry this with a smaller initial window

@ceciliazaragoza
Copy link
Collaborator

ceciliazaragoza commented Apr 4, 2024

I tried starting with a small viewport size and then increasing, but I am still not receiving the issue on local. However, I notice that whenever I choose Fit to Viewport on beta, the graph size always decreases to one node, even without choosing other view sizes first. If I change to another view size and then back to Fit to Viewport, I do not receive the issue, though. I am receiving these error messages in the console:
image

@ntran18
Copy link
Collaborator

ntran18 commented Oct 17, 2024

Verified that I have the same issue with @ceciliazaragoza. This issue is hard to debug on local machine.

@ceciliazaragoza
Copy link
Collaborator

Because this issue is only happening on the deployed beta, it must be an issue with communication between the client laptop and the server. However, this is hard to test without deploying my code. The issue probably has something to do with this code below because there is no issue when switching between other viewport sizes, and the functions synchronizeViewportSizeFit() and requestWindowDimensions() are only called with Fit to Viewport.
image

@dondi
Copy link
Owner

dondi commented Nov 6, 2024

After looking at this, it was [re-]discovered that the deployment observation is due to how the deployed site is running a static web page with an iframe containing the actual GRNsight app. When we are working locally, we don’t have the iframe and we are running the app directly in a window (this can be simulated on the deployed version by looking at the iframe src and opening a browser window directly with that as the URL)

To address this bug without constant redeploys, we can set up this environment locally:

  • Prepare a dummy web page/site that references the local GRNsight copy inside of an iframe (see beta.html for specifics)

  • Edit the HOST_SITE constant to be the site hosting the dummy web page (e.g., http://localhost:3000 if the dummy web page is a React app)

  • With this setup, the message communication between update-app.js and iframe-coordination.js should now be entirely local. console.log statements can be used to follow the interaction

After this is done, next steps will then depend on what @ceciliazaragoza discovers

@ceciliazaragoza
Copy link
Collaborator

I was able to simulate this issue locally by creating a dummy-website and displaying GRNsight inside of an iframe like this:

<body>
    <p id="pageTitle">Testing 🤩 </p>
    <div id="graphPageContent">
        <iframe class="embedded-demo" src="http://localhost:5001"></iframe>
    </div>
</body>

Currently, my dummy-website looks like this.
Screenshot 2024-11-12 at 7 47 11 PM

However, I am getting some issues with loading the iframe correctly. My iframe element looks like this:

<iframe class="embedded-demo" src="http://localhost:5001"></iframe>

while the iframe in beta looks like this:

<iframe class="embedded-demo" src="https://grnsight.lmucs.org/beta/client" id="iFrameResizer0" scrolling="no" style="overflow: hidden; min-width: 1081px; height: 1317.45px; width: 1736.01px;"></iframe>

I am able to force the load so that the graph svg displays correctly by changing the viewport size of the graph.

@dondi
Copy link
Owner

dondi commented Nov 13, 2024

For the issue with the local iframe, you might need to temporarily revise instances of grnsight.lmucs.org into localhost:5001 (or similar)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants