energy-data / energydata.info

energydata.info - open data and analytics for a sustainable energy future
http://energydata.info
MIT License
25 stars 6 forks source link

Not all countries tagged appear in left country bar #381

Closed anderspeders closed 1 year ago

anderspeders commented 1 year ago

Not all countries appear in the left country bar (see for example Maldives missing). This is when browsing in default mode without applying any other filters.

image

image

jodiegardiner commented 1 year ago

How very strange. Investigating.

anderspeders commented 1 year ago

You will also note that countries when listed do not appear alphabetically once you go past the first letter: For example Burundi appears before Benin, and Ghana appears before Gambia.

image

So there are mulitple issues with the country left filtering bar.

anderspeders commented 1 year ago

Please share an update on this issue with the country left bar.

jodiegardiner commented 1 year ago

Hi Anders,

This is a two-part issue.

One is that there are two different country files. This is from legacy and I am consolidating.

Two is that they are sorted by the three digit ISO3 codes which explains the odd ordering. I am changing that to sort by display name.

jodiegardiner commented 1 year ago

I have discovered another interesting issue:

If you search for Maldives, it does appear in the left menu once results have been returned:

Screenshot 2023-03-28 at 14 49 08 Screenshot 2023-03-28 at 14 49 24
jodiegardiner commented 1 year ago

I think "Show all countries" may not, in fact, be showing all, technically speaking.

jodiegardiner commented 1 year ago

Solved, finally. This was simply a default limit of 50. So only the top 50 by dataset count were making the grade. Of course, once you drill down and search for a term, then less than 50 matching countries could be surfaced, explaining why Maldives only appears when searched for. The fix is to remove this limit. Deploying to prod in the morning when I'm fresh.

Part 2 is just sorting so I'll include that too, then return to close this once deployed, so you have visibility on it.

jodiegardiner commented 1 year ago

Deployed to production.