Skip to content

[Bug] PointCloudLayer types do not accept loaders.gl data format #10219

@marcomuser

Description

@marcomuser

Description

The PointCloudLayer has a normalizeData function to support the loaders.gl point cloud data format. While it works at runtime, I get a type error when I pass in a conforming object to the data prop. Example:

new PointCloudLayer({
        // @ts-expect-error Type is not assignable to type '(PointCloudData & LayerDataSource<any>) | undefined'.
        data: {
          header: {
            vertexCount: 640*480,
          },
          attributes: {
            POSITION: {
              size: 3,
              value: Float64Array,
            },
            COLOR_0: {
              size: 3,
              value: Uint8Array,
            },
          },
        }

Flavors

  • Script tag
  • React
  • Python/Jupyter notebook
  • MapboxOverlay
  • GoogleMapsOverlay
  • CARTO
  • ArcGIS

Expected Behavior

The types should follow the runtime behaviour.

Steps to Reproduce

  1. Create a PointCloudLayer
  2. Pass an object in the loaders.gl format (https://loaders.gl/docs/specifications/category-mesh#data-format) to data prop
  3. Expect ts error

Environment

  • Framework version: deck.gl@9.2.8
  • Browser: Chrome
  • OS: MacOS

Logs

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions