Please export `getAccessorFromBuffer`

Open
#6,332 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
55/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Stale
Tech stack
typescript
Domain
api

Research direction

Start in modules/core/src/utils/iterable-utils.js at getAccessorFromBuffer and trace how createIterable is exported from @deck.gl/core. Check the package's public export entry points and existing tests, then verify that consumers can import getAccessorFromBuffer while preserving its documented accessor behavior.

Written by the indexing model from the issue text.

Description

feature
Target Use case

I am working on a CompositeLayer that needs to iterate though the data in the CPU on updateState before passing to the render method. While it would be technically possible to require the data to be in a particular format, or otherwise handle the processing of that data prior to passing to the layer, I would prefer that the data format be flexible and consistent with other layers that I'm building.

For that reason, I am trying to implement the accessor pattern inside the updateState method, and would like it to be able to accept binary attributes, whether they are as a luma Buffer or a TypedArray, and the various props to handle interleaved data, as well as falling back to the getPosition accessor function that is optionally passed.

I noticed the getAccessorFromBuffer function here:
https://github.com/visgl/deck.gl/blob/8.6-release/modules/core/src/utils/iterable-utils.js

Yet, it is not exported by @deck.gl/core (yet createIterable is).

It would be helpful if either that was exported, or otherwise some general pattern were provided for iterating over an accessor in a CompositeLayer.

It would make it possible to iterate over an accessor in a CompositeLayer, regardless of how the data is passed, allowing for all layers in a project to accept the same inputs.

Proposed feature

Export getAccessorFromBuffer.

To Do List
  • Add label and assign to milestone
  • Coding
  • Doc update
  • What’s new update
  • Test
Dominant language
TypeScript
Stars
14.6k
Forks
2.3k
Avg merge
2d 9h
Merged PRs (30d)
42

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from visgl/deck.gl

All issues in visgl/deck.gl

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.