kglab icon indicating copy to clipboard operation
kglab copied to clipboard

Auto adjust window size when visualizing the graph #257

Open jli113 opened this issue 3 years ago • 1 comments

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

jli113 avatar Jul 05 '22 06:07 jli113

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.

Mec-iS avatar Jul 29 '22 08:07 Mec-iS

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.

ceteri avatar Aug 16 '22 04:08 ceteri