[Bug] Type TooltipContent is not exported by module @deck.gl/core
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 14.6k
- Forks
- 2.3k
- Avg merge
- 2d 9h
- Merged PRs (30d)
- 42
Description
Description
If you want to add your own tooltip provider via attribute getTooltip to a Deck, you need to import the types PickingInfo and TooltipContent because getTooltip has the following signature:
getTooltip?: ((info: PickingInfo) => TooltipContent) | null;
While PickingInfo is properly exported by module @deck.gl/core, the type TooltipContent is not exported. The workaround is to import it from the declaring file like this:
import { TooltipContent } from '@deck.gl/core/lib/tooltip';
Although this import works, it actually breaks the module idea of Typescript.
Flavors
- Script tag
- React
- Python/Jupyter notebook
- MapboxOverlay
- GoogleMapsOverlay
- CartoLayer
- ArcGIS
Expected Behavior
Type TooltipContent is exported by https://github.com/visgl/deck.gl/blob/master/modules/core/src/index.ts
Steps to Reproduce
See my question https://github.com/visgl/deck.gl/discussions/8999 in discussions.
Environment
- Framework version: 9.0.21
- Browser: Chrome
- OS: Windows 10
Logs
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The public entry point is modules/core/src/index.ts, while TooltipContent is declared in modules/core/src/tooltip. Start by comparing the core exports with the existing import workaround. Done means TooltipContent can be imported from @deck.gl/core and remains usable in the getTooltip signature.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- data-visualization, frontend
- Issue type
- Bug
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 52/100