Also allow creating html files in Draw from jupyter notebook

This commit is contained in:
Matthias Hochsteger 2024-06-11 16:27:45 +02:00
parent cc3f27e514
commit d9af1262a2

View File

@ -389,6 +389,7 @@ def Draw(obj, *args, show=True, **kwargs):
html = scene.GenerateHTML() html = scene.GenerateHTML()
display(HTML(html)) display(HTML(html))
return
else: else:
import webgui_jupyter_widgets as wjw import webgui_jupyter_widgets as wjw
from packaging.version import parse from packaging.version import parse
@ -400,8 +401,6 @@ def Draw(obj, *args, show=True, **kwargs):
scene.Draw( scene.Draw(
kwargs_with_defaults["width"], kwargs_with_defaults["height"] kwargs_with_defaults["width"], kwargs_with_defaults["height"]
) )
return scene
else:
if "filename" in kwargs_with_defaults: if "filename" in kwargs_with_defaults:
scene.GenerateHTML(filename=kwargs_with_defaults["filename"]) scene.GenerateHTML(filename=kwargs_with_defaults["filename"])
return scene return scene