From b9cbcc8ed64cb8a609f61f0e45159e34fcc9f17d Mon Sep 17 00:00:00 2001 From: Adam Callison Date: Fri, 8 Mar 2024 22:00:25 +0000 Subject: [PATCH] fix: make notebook default to false in show --- pyvis/network.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/pyvis/network.py b/pyvis/network.py index 8deb915..f9532a0 100644 --- a/pyvis/network.py +++ b/pyvis/network.py @@ -533,8 +533,7 @@ def write_html(self, name, local=True, notebook=False,open_browser=False): if open_browser: # open the saved file in a new browser window. webbrowser.open(getcwd_name) - - def show(self, name, local=True,notebook=True): + def show(self, name, local=True, notebook=False): """ Writes a static HTML file and saves it locally before opening. @@ -542,10 +541,9 @@ def show(self, name, local=True,notebook=True): :type name: str """ print(name) - if notebook: - self.write_html(name, open_browser=False,notebook=True) - else: - self.write_html(name, open_browser=True) + + open_browser = not notebook + self.write_html(name, open_browser=open_browser, notebook=notebook) if notebook: return IFrame(name, width=self.width, height=self.height)