visgl / visgl/deck.gl

[Doc]HexagonLayer: TypeScript example cannot be compiled

Open
#9,512 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

doc
Dominant language
TypeScript
Stars
14.6k
Forks
2.3k
Avg merge
2d 9h
Merged PRs (30d)
42

Description

Link

https://deck.gl/docs/api-reference/aggregation-layers/hexagon-layer

Description

The line

getTooltip: ({object}: PickingInfo<BikeRack>) => object && `Count: ${object.elevationValue}`,

in the TypeScript example cannot be compiled. The error the compiler issues is:

Type '({ object }: HexagonLayerPickingInfo<BikeRack>) => string | undefined' is not assignable to type '(info: { color: Uint8Array<ArrayBufferLike> | null; layer: Layer<{}> | null; sourceLayer?: Layer<{}> | null | undefined; viewport?: Viewport | undefined; ... 8 more ...; pixelRatio: number; }) => TooltipContent'.
  Type 'string | undefined' is not assignable to type 'TooltipContent'.
    Type 'undefined' is not assignable to type 'TooltipContent'.ts(2322)

(using typescript 5.7.3)

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.

Research direction

Open the HexagonLayer documentation page and inspect the TypeScript example containing the getTooltip callback. Compile the example with TypeScript 5.7.3, then adjust the documented example so it compiles without the reported type error and verify the error is gone.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
documentation
Issue type
Documentation
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
50/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.