USEPA / useeio-widgets

Creative Commons Zero v1.0 Universal
3 stars 17 forks source link

3. Auto check top 10 commodities in IOGrid #29

Closed TheTisiboth closed 3 years ago

TheTisiboth commented 3 years ago
  1. When no sectors or naics are indicated, please auto-check the top 10 commodities in the center column. (Match the initial rows-per=page count.) This will allow the Upstream and Downstream columns to initially show ranked values (rather than defaulting alphabetically to Abrasive Products).

https://model.earth/io/build/slider.html#indicators=LAND,PEST

TheTisiboth commented 3 years ago

Should the url remain without the top 10 selected sectors? I don't think that is doable, since we need to have this information in the config for the 3 different widgets

localsite commented 3 years ago

This is where the hiddenhash would be used. Save the sectors or naics in the hiddenhash, and automatically trigger the other widgets to update when the hiddenhash changes. (We may need to save the hiddenhash object string in a hidden div to do this efficiently.)

In the JQuery frontend, URL values like show=bioeconomy will trigger specific naics values to be inserted into the hiddenhash.

For the indicator changes: Try updating the URL as the indicator changes, WITHOUT updating the URL history. Then the user won't have to click back dozens of times to return to the previous page. (Later we could make this a setting option: Retain URL history for each hash change.) You may want to post this paragraph as a unique issue.

localsite commented 3 years ago

Prevent links 5 and 7 from updating the hash.

https://thetisiboth.github.io/useeio-widget-builds/

Avoid auto-appending the scale levels (100) to the sector hash on the initial load.

The hash would still be updated when the user moves the sliders (it will continue to append the scale :99 etc. to each sector id, just not the default 100 scale.) It would be best to never show :100 in the hash.

Thanks!

PS: I'm currently not able to slide the scales on the input-output page without having them jump back to 100. Worked before.

TheTisiboth commented 3 years ago

Prevent links 5 and 7 from updating the hash.

What do you mean with this ?

Yes, I am opening an new issue about the widget update : https://github.com/USEPA/useeio-widgets/issues/41

And thanks for the tips!

LorenHeyns commented 3 years ago

When the count is 20, auto check all 20. https://thetisiboth.github.io/useeio-widget-builds/slider.html#count=20

TheTisiboth commented 3 years ago

So the 10 first commodities should be selected if no sectors are indicated, and the 20 first commodities should be selected if count = 20 is indicated. Is that all ?

TheTisiboth commented 3 years ago

And if the count is 30, what should happen ?

ModelEarth commented 3 years ago

The items displayed initially would all be checked (so first 30 would be checked when count=30). When clicking to the second page (in the pagination), none would be checked.

Also provide a means to check all using a hash value. Perhaps allsectors=true