yWorks / yfiles-jupyter-graphs

The home of the Jupyter notebook graph visualization widget powered by yFiles for HTML
https://www.yworks.com/products/yfiles-graphs-for-jupyter
Other
173 stars 18 forks source link

Graph is invisible #45

Open pwrose opened 10 months ago

pwrose commented 10 months ago

Describe the bug The graph is invisible unless I zoom in on a small section of the graph.

To Reproduce Steps to reproduce the behavior: Run the following notebook

Expected behavior Always show the whole graph.

Screenshots Screen Shot 2024-01-02 at 11 45 26 PM

Desktop (please complete the following information):

Additional context Add any other context about the problem here.

fskpf commented 10 months ago

I'm not able to reproduce this. Running your notebook shows this widget for me: image

What usually happens is that the data is loaded from the given source, then a force-directed layout is applied, and then the diagram is fitted to the available screen space. It may happen that the graph is very large and the available screen space is very small. In this case, the diagram is zoomed out quite far such that the visualizations become rather small initially due to the diagram fitting. However, I don't see that this is the case here.

With your screenshot, I'm also not sure about the size of the widget in the Colab Notebook. Can you post a screenshot that shows the surrounding notebook as well?

What happens if you click the "Fit Diagram" button in the toolbar (the button just below the zoom-in/-out buttons)?

Can you zoom in such that the elements become visible (although the overview indicates that it should already fit)?

Does it happen for you in our example notebooks as well? E.g. this one.

pwrose commented 10 months ago

It turns out I cannot reproduce it either. I'm not sure what happened.

Regarding your example notebook, the graph is displayed. From cell [8] downwards I only see the same grid of nodes with no edges. The different set_sidebar options seem to have no effect. Is that intentional?

[image: Screen Shot 2024-01-04 at 12.33.08 PM.png]

On Wed, Jan 3, 2024 at 7:17 AM Fabian Schwarzkopf @.***> wrote:

I'm not able to reproduce this. Running your notebook shows this widget for me: image.png (view on web) https://urldefense.com/v3/__https://github.com/yWorks/yfiles-jupyter-graphs/assets/17721806/3bdf6892-2b88-482d-9081-f9a5462ecba5__;!!Mih3wA!HhYluDfj2Q_n25bPYET1QpAac7j8N2jtFugd_KzhsWSklpkPPEB_cMr3Wr5Uk1aqMsSM03qqCzmZo5_QgVrJy30$

What usually happens is that the data is loaded from the given source, then a force-directed layout is applied, and then the diagram is fitted to the available screen space. It may happen that the graph is very large and the available screen space is very small. In this case, the diagram is zoomed out quite far such that the visualizations become rather small initially due to the diagram fitting. However, I don't see that this is the case here.

With your screenshot, I'm also not sure about the size of the widget in the Colab Notebook. Can you post a screenshot that shows the surrounding notebook as well?

What happens if you click the "Fit Diagram" button in the toolbar (the button just below the zoom-in/-out buttons)?

Can you zoom in such that the elements become visible (although the overview indicates that it should already fit)?

Does it happen for you in our example notebooks as well? E.g. this one https://urldefense.com/v3/__https://colab.research.google.com/github/yWorks/yfiles-jupyter-graphs/blob/main/examples/sidebar.ipynb__;!!Mih3wA!HhYluDfj2Q_n25bPYET1QpAac7j8N2jtFugd_KzhsWSklpkPPEB_cMr3Wr5Uk1aqMsSM03qqCzmZo5_Q0xQdtl0$ .

— Reply to this email directly, view it on GitHub https://urldefense.com/v3/__https://github.com/yWorks/yfiles-jupyter-graphs/issues/45*issuecomment-1875534591__;Iw!!Mih3wA!HhYluDfj2Q_n25bPYET1QpAac7j8N2jtFugd_KzhsWSklpkPPEB_cMr3Wr5Uk1aqMsSM03qqCzmZo5_QMK7dy1A$, or unsubscribe https://urldefense.com/v3/__https://github.com/notifications/unsubscribe-auth/AA53AEES63N3S42FKTX7FMDYMVZAFAVCNFSM6AAAAABBLBMNISVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNZVGUZTINJZGE__;!!Mih3wA!HhYluDfj2Q_n25bPYET1QpAac7j8N2jtFugd_KzhsWSklpkPPEB_cMr3Wr5Uk1aqMsSM03qqCzmZo5_QzVy4KeE$ . You are receiving this because you authored the thread.Message ID: @.***>

yGuy commented 10 months ago

The original issue of the invisible graph might be due to #46 where the WebGL2 driver/browsersupport crashed. Zooming in will switch from WebGL to SVG mode. I think we should be more careful with too many graph displays on the same page as this will cause some browsers and graphics card drivers to simply "give up".

I also saw the disappearing edges in the same context when this happened to me. The console showed that the Python kernel did not properly communicate with the widget and just didn't send the edges. This could be due to a the above error leaving the page in an inconsistent state.

I can reproduce this with some of our examples on a weaker PC when I load all of the examples at the same time. There are lots of errors in the console in that case, showing both the WebGL2 browser issue (context lost) as well as the communication problem for the IPyWidget not receiving the edges.