Draw requires additional arguments

I believe some changes were made to the Draw() interface in Jupyter, since my previous Draw commands stopped working and are now resulting in an error message.

MRE:

from ngsolve import *
from ngsolve.webgui import Draw
from netgen.geom2d import unit_square

mesh = Mesh(unit_square.GenerateMesh(maxh=0.2))

Draw(mesh)

The error message reads:

TypeError Traceback (most recent call last)
in
5 mesh = Mesh(unit_square.GenerateMesh(maxh=0.2))
6
----> 7 Draw(mesh)

/opt/tljh/user/lib/python3.7/site-packages/ngsolve/webgui.py in Draw(mesh_or_func, mesh_or_none, name, order, min, max, draw_vol, draw_surf, autoscale, intpoints, deformation, interpolate_multidim, animate, clipping, vectors, js_code, eval_function, eval, filename, objects, nodal_p1, settings, width, height)
596 else:
597 # render scene using widgets.DOMWidget
→ 598 scene.Draw(width, height)
599 return scene
600 else:

TypeError: Draw() takes 1 positional argument but 3 were given

This never happend before. I would be grateful for any advice!

Hello,

You need to upgrade webgui_jupyter_widgets:

pip install --upgrade webgui_jupyter_widgets
jupyter nbextension install --py webgui_jupyter_widgets

There was a new release adding width and height arguments (workaround for jupyter inside vscode, see Problem with Draw function, large scale - #7 by nilsansorgeeagleburg )

Best,
Matthias

Thanks, that solved it!