jeroenheijmans / advent-of-code-surveys

Advent of Code (unofficial) Surveys
Other
41 stars 2 forks source link

All bar charts have confusing logic for which "top" languages to show if not all years are visible #21

Open flwyd opened 1 year ago

flwyd commented 1 year ago

The default view at the top of the survey results is programming languages used in 2022. But the languages which aren't grouped into the "Other" bucket aren't the same as the top 15 languages used in 2022. The data table shows

but the graph shows …, Ruby, PHP, Clojure/ClojureScript, Python 2. It looks like it's sorted in order of 2018 popularity, which is confusing when looking at 2022 data alone.

jeroenheijmans commented 1 year ago

Thanks for the report! I'm on mobile so a bit hard to check, but I think I know what you mean. It's subtly different though...

The graph shows languages that had >= a certain percentage share in any year, and groups the rest as "Other...".

It should probably do so for "any visible year" instead.

This little weird logic is needed to be able to show languages that declined to zero in the current year.

I'll think of some improvements for 2023, thx for the report!!

jeroenheijmans commented 8 months ago

This was reported once more on Reddit and I think I should rename the title of this issue a bit (hoping it still reflects OP's report).

To fully clarify, this is what happens:

This is:

This holds not only for "Languages" but for any bar chart.


Reproducing my Reddit reply here as it further details the issue and provides possible solutions:

The short explanation:

Any language that had >=2.0% for any year (even if it's hidden) is on its own. The rest is "Other...".

So for your example:

  • PHP and Clojure(Script) show individually because e.g. in 2018 they had >=2.0%
  • Scala is not shown individually but clumped into "Other..." because it has never reached >=2.0% in any one year
  • So it's not a "bug" as in that it's random or broken, but it is a "bug" in the sense that it is currently mightily confusing - more so because by default not all years are shown.

I'm not sure how to fix it while keeping cool insights. It's hard (especially on small viewports) to keep the graphs usable. Probably the best thing to do is to have the top 10 languages (+ Other...) be calculated based on the visible years. That requires some major rework on the dashboard code though 😢

Hope this makes sense! I wasn't trying to underplay any particular language 😅

PS. This also holds for other graphs, and explains why "Atom" is still shown by default for 2023.