deck.gl icon indicating copy to clipboard operation
deck.gl copied to clipboard

Is there a way to interpolate height of hexagons when data updated in HexagonLayer?

Open ricardoCyy opened this issue 8 years ago • 3 comments

Hi, thanks again for your great works!

Background

I have twenty-four point files recording taxi demands(lng,lat) in a city and use HexagonLayer(3d-heatmap) to visualize the spatial patterns in 3D. And I want to show the change of demands between different files.

Actual Result

The heights of hexagons change roughly after data changed.

Expected Result

The heights of hexagons gradually transit from previous data to current data. Just like this gif. Expected Result

Addition:

I have read property-animation-rfc.md and it seems like my issue cannot be solved in current version, but is there any trick I could use to achieve the goal?

Any advise or guidance would be greatly appreciated! Thanks!

ricardoCyy avatar Jun 06 '18 12:06 ricardoCyy

@ricardoCyy Property animations wouldn't work in this case, since the interpolation happens per hexagon (when implemented, props animation will just animate say the elevationScale prop which will affect all hexagons).

You want to look at attribute transitions, which are already implemented. I am not 100% sure it works with aggregating layers like the hexagon layer but by adding a transitions prop when changing the data you should be able to get it to work.

@Pessimistress

ibgreen avatar Jun 06 '18 17:06 ibgreen

@ibgreen Thanks for your reply, I added transitions in my layer's prop like this: const hex = new HexagonLayer({
id: 'heatmap', ...props, getElevationValue: p=> p.length, transitions:{ getElevationValue: { duration: 300, } } });
But nothing happened. Did I miss something?

ricardoCyy avatar Jun 08 '18 09:06 ricardoCyy

@ricardoCyy The transitions prop is under development and doesn't work on all properties yet. With that said, it shouldn't be hard to support this use case. Maybe we can release a patch for this? @jianhuang01

Pessimistress avatar Jun 08 '18 15:06 Pessimistress