deck.gl
deck.gl copied to clipboard
[Bug] Heatmap layer does not work for negative weights
Description
There is no way to currently use the Heatmap layer with negative values for weights. Things I've tried:
- Threshold: 0
- Threshold: any negative number
- ColorDomain: [negative numbers, postive numbers]
If you try the above the areas where the heatmap would have a negative value are cut off. Potentially it is calculating the right weight through the sum of the values but can't apply it to the colourRange correctly.
Flavors
- [ ] Script tag
- [X] React
- [ ] Python/Jupyter notebook
- [ ] MapboxOverlay
- [ ] GoogleMapsOverlay
- [ ] CartoLayer
- [ ] ArcGIS
Expected Behavior
Very negative values appear at the bottom of the colorRange on the heatmap, very positive values at the top.
Steps to Reproduce
- Make a Heatmap layer over a map
- Have data points with negative weights at a position. e.g.
{
lonlat: [1, 2],
score: -0.5
}
getWeight: d => d.score,- observe
Environment
- Framework version: "deck.gl": "^9.0.27",
- Browser: Brave Version 1.66.115 Chromium: 125.0.6422.112 (Official Build) (arm64)
- OS: Mac OS Version 14.0
Logs
No response