VEuPathDB / web-eda

Web browser code for EDA-based applications
Apache License 2.0
0 stars 0 forks source link

For very large / small numbers, use formatting standard to epidemiologists #1275

Closed danicahelb closed 2 years ago

danicahelb commented 2 years ago

When extreme range selections are made, the default notation for axes labels used by plotly is not standard in the field of epidemiology

To reproduce (after log scale and related axis work has been completed for https://github.com/VEuPathDB/web-eda/issues/1228 and https://github.com/VEuPathDB/web-eda/issues/1157):

GEMS1

moontrip commented 2 years ago

I have looked at plotly.js API docs and tested something. From my understanding, this is doable but will wait for the implementation as indicated in the ticket. For a record, here is a solution:

layout.yaxis.showexponent: 'all', layout.yaxis.minexponent: 4, layout.yaxis.exponentformat: 'power',

note) exponentformat of 'power' displays the above ideal format like 1.5 x 10^-5, 4.6 x 10^10, etc minexponent determines when we will show exponent. Its input is absolute value, meaning that if 4 (power), then values with power of (+/-5) or larger (> 10^5) / smaller (< 10^-5) will start to show the exponent.

moontrip commented 2 years ago

@danicahelb As mentioned above this is doable. I just want to know which plot/visualization and axis (X/Y) would have this power format as an axis label. Usually, those large/small values exist at dependent axis (Y), though.

danicahelb commented 2 years ago

Hi @moontrip it seems like this can happen on any axis where the user can both (i) select log scale and (ii) set either a very small value for minimum or very large value for the maximum of the axis range

this is not a priority for b59 so i am moving the ticket to "Backlog"

Image

danicahelb commented 2 years ago

@moontrip this is very low priority, i will let you know when you should work on it. i've moved it back to Backlog

moontrip commented 2 years ago

@danicahelb Thank you for your information. I think that it is close to the end as there already exists PR with a couple of reviews.

moontrip commented 2 years ago

closing due to merges: https://github.com/VEuPathDB/web-components/pull/384 & https://github.com/VEuPathDB/web-eda/pull/1348

sweverschulman commented 1 year ago

Functionality works. Confirmed using both GEMS 1 example (scatter plot) and a line plot in MAL-ED <img width="553" alt="Screen Shot 2022-10-21 at 10 44 48 AM" src="https://user-images.githubusercontent.com/62298921/197226027-12d0fd3f-9a9a-4408-b308

Screen Shot 2022-10-21 at 10 44 56 AM

-20c46c80ab2f.png">