tidy3d icon indicating copy to clipboard operation
tidy3d copied to clipboard

fix(): SCEM-5311 - Make Tidy3D plot_3d compatible with script limits

Open tim-goddard-flexcompute opened this issue 1 year ago • 1 comments

The Tidy3D notebooks environment is about to introduce a number of limits on script content in cell output as a security precaution. This conflicts with the way the plot_3d function operates, which is dependent on the ability to output JavaScript.

This change modifies the injected JavaScript to function whether the script is evaluated inline, or a similar copy is included in the environment. Our notebooks environment will add this script at the same time as introducing the change to strip script output from cells, preserving the ability to render 3d plots.

The script has been included inline, rather than from an external source, to most closely mimic the existing behavior, avoid adding an external script inclusion to customer environments.

tim-goddard-flexcompute avatar Apr 08 '24 00:04 tim-goddard-flexcompute

Thanks @tim-goddard-flexcompute, looks good to me. I'm just trying to figure out whether to release this as a patch 2.6.4 or whether it can wait a few weeks to release in our 2.7.0. Is it an urgent fix?

tylerflex avatar Apr 08 '24 07:04 tylerflex

Also, just wondering whether this has been tested in eg. a notebook or if that's still needed?

tylerflex avatar Apr 10 '24 02:04 tylerflex

FYI just tested on StartHere.ipynb and works as expected

image

tylerflex avatar Apr 10 '24 02:04 tylerflex