Skip to content

TypedArrays as mesh3d attributes #2319

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

Closed
dy opened this issue Feb 1, 2018 · 1 comment
Closed

TypedArrays as mesh3d attributes #2319

dy opened this issue Feb 1, 2018 · 1 comment

Comments

@dy
Copy link
Contributor

dy commented Feb 1, 2018

Sometimes 3d data, like simplicial-complex, has TypedArray format, eg. Float32Array for positions and Uint32Array for cell indices:

  // positions = Float32Array
  // cells = Uint32Array

  Plotly.plot(document.body, [{
    "x": positions.filter((p, i) => !(i % 3)),
    "y": positions.filter((p, i) => !((i-1) % 3)),
    "z": positions.filter((p, i) => !((i-2) % 3)),
    "i": indices.filter((p, i) => !(i % 3)),
    "j": indices.filter((p, i) => !((i-1) % 3)),
    "k": indices.filter((p, i) => !((i-2) % 3)),
  }])

Would be nice for plotly to be able to deal with TypedArrays and not force users cast data to exact datatype.

@etpinard
Copy link
Contributor

etpinard commented Feb 1, 2018

duplicate of #860

@dy dy closed this as completed Feb 1, 2018
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

2 participants