ipyvolume
ipyvolume copied to clipboard
`ipyvolume.save` fails to serialize `pythreejs.OrbitControls` due to +-Infinity
Hi,
the following code
import ipyvolume
import pythreejs
import sys
figure = ipyvolume.figure()
controls = pythreejs.OrbitControls(controlling=figure.camera)
if False:
controls.maxAzimuthAngle = sys.float_info.max
controls.maxDistance = sys.float_info.max
controls.maxZoom = sys.float_info.max
controls.minAzimuthAngle = -sys.float_info.max
figure.controls = controls
ipyvolume.save("./2022-02-18 min.html")
produces "JSON.parse: unexpected character at line 417 column 28 of the JSON data". Its because the object contains a couple of +-Infinity. With if True the error disappears.
There is https://github.com/jupyter-widgets/pythreejs/issues/366, looks like a pythreejs issue spilling over