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

Empty overlay data causes crashes. #50

Open
4 tasks done
Swoorup opened this issue Jan 16, 2023 · 1 comment
Open
4 tasks done

Empty overlay data causes crashes. #50

Swoorup opened this issue Jan 16, 2023 · 1 comment

Comments

@Swoorup
Copy link
Contributor

Swoorup commented Jan 16, 2023

Describe the bug

It's useful to have empty data, especially for streaming cases where you are generating stuff on the fly. It appears that having an empty dataset in the overlay causes crash.

Reproduction

https://codesandbox.io/s/playing-around-6-forked-4sof7y?file=/data-1.json:1465-1487

Steps to reproduce

  • Run the reproduction example with the link.
  • Empty the overlay spline data

Javascript Framework

no-framework (vanilla-js)

Logs

Log ```shell TypeError Cannot read properties of undefined (reading '1') preSampler unknown calcPrecision https://4sof7y.csb.app/node_modules/night-vision/dist/night-vision.umd.cjs:2169:17 calcSidebar https://4sof7y.csb.app/node_modules/night-vision/dist/night-vision.umd.cjs:2089:24 new Scale https://4sof7y.csb.app/node_modules/night-vision/dist/night-vision.umd.cjs:2335:5 makeScales https://4sof7y.csb.app/node_modules/night-vision/dist/night-vision.umd.cjs:2529:21 new GridMaker https://4sof7y.csb.app/node_modules/night-vision/dist/night-vision.umd.cjs:2564:5 new Layout https://4sof7y.csb.app/node_modules/night-vision/dist/night-vision.umd.cjs:2625:18 Object.update2 [as chart] https://4sof7y.csb.app/node_modules/night-vision/dist/night-vision.umd.cjs:10953:32 Events.emitSpec https://4sof7y.csb.app/node_modules/night-vision/dist/night-vision.umd.cjs:1442:23 eval https://4sof7y.csb.app/node_modules/night-vision/dist/night-vision.umd.cjs:1816:21 ```

Validations

  • Read the docs.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • Make sure this is a NightVision issue and not a framework-specific issue.
  • The provided reproduction is a minimal reproducible example of the bug.
@C451
Copy link
Contributor

C451 commented Jan 16, 2023

Yes, need to skip sampling for precision for empty overlays:
https://github.com/project-nv/night-vision/blob/main/src/core/gridScale.js#L145

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

Successfully merging a pull request may close this issue.

2 participants