fix(): SCEM-5311 - Make Tidy3D plot_3d compatible with script limits #1586
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.