question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

HexagonLayer elevation based on getColorValue

See original GitHub issue

image

This is the map what I got, I have a customized getColorValue on props, how can I make the hexbins elevation based on this value? Seems currently the elevation is based on points.length and I can’t customize it?

_onGetSublayerElevation(cell) {
    ...
    const domain = elevationDomain || [0, sortedBins.maxCount];
    return linearScale(domain, elevationRange, cell.points.length);
}

Maybe change to this?

const { getColorValue } = this.props;
...
return linearScale(domain, elevationRange, getColorValue(cell.points));

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
heshan0131commented, Jun 2, 2017

I agree that elevation can be based on other metrics besides count. However I would not have it based on the same value that color is based on.

Color and Elevation are two different visual channels that can be used to encode different metrics. E.g. as it is implemented right now. With a heatmap showing population demographic, elevation can be used to show population density and color can be used to show average household income. In which case, we can tell the story of how income correlates to density.

That being said. I think we can add another props getElevationValue similar as getColorValue, it would have the binning and sorting run twice on ever data change. Because it needs to sort the hex bins by values that color is based on AND values that elevation is based on. User can always pass the same function if they want the elevation to correlate with the color.

0reactions
1chanducommented, Sep 26, 2017

@heshan0131 It is resolved by #938, can we close it?

Read more comments on GitHub >

github_iconTop Results From Across the Web

HexagonLayer elevation based on getColorValue #674 - GitHub
This is the map what I got, I have a customized getColorValue on props, how can I make the hexbins elevation based on...
Read more >
HexagonLayer - deck.gl
The HexagonLayer aggregates data into a hexagon-based heatmap. The color and height of a hexagon are determined based on the objects it contains....
Read more >
HexagonLayer - Get aggregated data or it's value bounds
I am building mapbox & deck.gl application and I want to filter some bars at runtime based on value ranges.
Read more >
Hexagon Layer with Custom Elevation value? - Using Streamlit
Is there a way I can assign a value from my data frame to my HexagonLayer layer? Here is my data: Here is...
Read more >
deck.gl | GPUGridLayer (WebGL2)
The color and height of a cell are determined based on the objects it ... Instead of getColorValue , getColorWeight and colorAggregation should...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found