Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ipyvolume.save fails to serialize pythreejs.OrbitControls due to +-Infinity #405

Open
notEvil opened this issue Feb 18, 2022 · 1 comment

Comments

@notEvil
Copy link

notEvil commented Feb 18, 2022

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.

@notEvil
Copy link
Author

notEvil commented Feb 21, 2022

There is jupyter-widgets/pythreejs#366, looks like a pythreejs issue spilling over

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant