-
Notifications
You must be signed in to change notification settings - Fork 251
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
Bug in igraph.plot() in jupyter #243
Comments
To note, the labels on the 2nd plot are changed automatically as soon as I evaluate the first one. I.e. commenting the line |
I'll have to look into it further, but at first sight it seems related to issue #222. |
I agree that seems to be the thing.Good ol' HTML/JS not having namespaces makes everything global and prone to these kinds of corruptions. One suggestion was we reparse the svg file coming out of Cairo and make the node ids unique. Doable if a bit dirty. |
It might also be an option to simply default to PNG for displaying in Jupyter notebooks, see also #36. I'm not sure how |
Apparently IPython (and most likely Jupyter) can wrap SVGs inside an iframe to avoid these kinds of corruptions, see this PR. I haven't had time to deal with it, most likely we should read the PR and see how we can give hints to IPython that our graphs should be placed in iframes. |
Actually, here's the solution. Anyone willing to pick this up? :) |
It seems that is already merged in PR #148? |
Btw, it seems that |
Well, it's been a long time ;) It could be the case that the fix is already merged. In that case, we only need to wait until 0.8.0 is released; in the meanwhile, @Benfeitas can use PR #148 as a workaround. |
I think #36 has a different goal, allowing the user to switch between PNG / SVG / PDF representations on-the-fly. It also seems to contain some hackery to change the size of the plot after it was constructed; we could probably do better than this if we changed igraph’s Plot class as necessary.
I probably won’t have time to deal with #36 in the near future to figure out which parts of it are still relevant, but I would definitely leave it open in case someone has the time to pick it up.
…
|
I'm running python igraph in jupyter, and found a weird bug:
When I include the 2nd cell (the one after package importing), running the 3rd cell renders weird labels.
![Screenshot 2019-08-22 at 16 53 42](https://user-images.githubusercontent.com/25486866/63525475-0cfaa180-c4fe-11e9-8164-3165375f51e6.png)
However, deleting the 2nd cell renders everything normally. I have tried copying all these cells to a new notebook but to no avail.
Untitled2.ipynb.zip
I'm attaching a
.ipynb
with all cells, hopefully you can reproduce this issue.The text was updated successfully, but these errors were encountered: