Vizzuality / TRASE-frontend

Trase brings unprecedented transparency to commodity supply chains revealing new pathways towards achieving a deforestation-free economy.
http://trase.earth
MIT License
14 stars 2 forks source link

Place profile: display soy land value in Ha #470

Closed agnessa closed 6 years ago

agnessa commented 7 years ago

For the "SOY LAND" header stat, instead of the soy_farmland attribute which is a % please use soy_area which is in Ha (it's the same value as "land occupied by soy" in the summary text). Unfortunately, the unit is hardcoded, for some reason that is the way we did for all header stats :( So this requires a front end change. It's a much longer number as well.

Related commit: https://github.com/Vizzuality/trase-api/commit/789abb15a25976dac85e2366400499d8f3a94430

Request comes from: https://github.com/Vizzuality/trase-api/commit/789abb15a25976dac85e2366400499d8f3a94430

nerik commented 7 years ago

Before: screen shot 2017-09-19 at 12 29 40

After: screen shot 2017-09-19 at 12 37 02

Looks good to you?

nerik commented 7 years ago

It looks like this value is often set to "NaN" in the API response, for instance: http://staging.trase.earth/api/v2/get_place_node_attributes?&node_id=13999

nerik commented 7 years ago

(also in the summary)

agnessa commented 7 years ago

Would you rather it was 0 when not available?

nerik commented 7 years ago

Usually in that kind of situation null or the absence of the value in the object would seem better.

But it needs to be handled on the API side in the text blurb anyways: screen shot 2017-09-19 at 13 15 36

tiagojsag commented 6 years ago

@agnessa @nerik I think there's nothing left to do here, but can one of you confirm please?

thanks

agnessa commented 6 years ago

I'm not sure empty values are handled in the blurb. In other words the original issue is resolved, but the NaN issue probably not.

tiagojsag commented 6 years ago

good enough IMO