Skip to content

TypedArrays as mesh3d attributes #2319

Closed
@dy

Description

@dy

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions