DerwenAI / kglab

Graph Data Science: an abstraction layer in Python for building knowledge graphs, integrated with popular graph libraries – atop Pandas, NetworkX, RAPIDS, RDFlib, pySHACL, PyVis, morph-kgc, pslpython, pyarrow, etc.
https://derwen.ai/docs/kgl/
MIT License
574 stars 65 forks source link

Auto adjust window size when visualizing the graph #257 #258

Closed jli113 closed 2 years ago

jli113 commented 2 years ago

Current behaviour

Original codes use default height and width in pyvis.network.Network

New expected behaviour

The new codes use window width and height when notebook is False

Change logs

added the following lines after line 438 if notebook == False: import pyautogui wid, hei= pyautogui.size() pyvis_graph = pyvis.network.Network(width='{}px'.format(wid), height='{}px'.format(hei), notebook=notebook) added pyautogui in requirements

257

Mec-iS commented 2 years ago

Hi, thanks for your contribution.

Can you specify which use-case this change covers and how I can test that the change works? Also, if applies, a testcase should be provided in the form of a unit test.

ceteri commented 2 years ago

It's quite specific, so this seems more like an example at the application layer, instead of being part of the library itself.

In that case, it would be better to show as extending one of the tutorial notebooks, or adding another notebook.