vasturiano / globe.gl

UI component for Globe Data Visualization using ThreeJS/WebGL
https://vasturiano.github.io/globe.gl/example/world-population/
MIT License
2.06k stars 304 forks source link

choropleth + world-population example combined #83

Open gomedya opened 2 years ago

gomedya commented 2 years ago

hi , is it possible to set different heights of individual polygons in choropleth example and keep them fixed like world-pop example?

sort of like Elevated Polygons but with walls/sides going all the way down to globe.

Thanks.

vasturiano commented 2 years ago

@gomedya there is the .polygonAltitude method available exactly for that purpose.

gomedya commented 2 years ago

hi , when you hover in choropleth example , countries go up and down. i need to specify each country a different altitude and not go up and down. it will look like a bar chart , countries with different heights.

vasturiano commented 2 years ago

Yes, that should all be easily doable using polygonAltitude. You can see a similar use of that in the Elevated Polygons example, particularly this line: https://github.com/vasturiano/globe.gl/blob/999c2c139327dddeffeb5478d7eafd26ec3026c1/example/countries-population/index.html#L32

gomedya commented 2 years ago

that did work like charm. is there an easy way to map the click to country name?

vasturiano commented 2 years ago

The onPolygonClick event includes the polygon object that was clicked. You should be able to extract from that any meta data that's available in the original data set.

gomedya commented 2 years ago

that was great help that came with great library. if I end up using it , i'll be more than happy to pay it back. thank you.