EditCounter: + logscale option for monthyearcharts - #507
Conversation
MusikAnimal
left a comment
There was a problem hiding this comment.
This causes my browser to crash. I used enwiki user GoldenRing as an example. That user has a long tenure, but relatively few edits. I tried on a few other accounts and had the same problem.
We appear to be using Chart.js version 2.3.0 in Pageviews Analysis, and the toggle for the logarithmic scale there seems to work fine. I don't know if any inspiration can be drawn from it (it's admittedly old and convoluted code), but here's where it happens:
- yAxes configuration
- Automatically determining if logarithmic scale should be used based on the Theil index – something we might consider as well
It does appear, however, that I also had to destroy the chart and rebuild. That I suppose is fine; you don't even notice really, at least on my machine.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #507 +/- ##
============================================
- Coverage 71.30% 70.99% -0.32%
- Complexity 1275 1298 +23
============================================
Files 46 46
Lines 3792 3913 +121
============================================
+ Hits 2704 2778 +74
- Misses 1088 1135 +47 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Huurrrggghhh. After a lot of head-banging and thinking I found it three times, I finally found it. It's one of the stupidest bugs I ever saw. Until ChartJS PR 4959, which was in 2.7.2 (we're in 2.7.0 🥲), every time a log scale is given a zero, it goes infinite-loopy. Well, anyhow. In the end the fix is Heh, what was I saying the other day about the amount of work for six bytes? This time about 5 hours. Don't mind the close-reopen, just a misclick. |
MusikAnimal
left a comment
There was a problem hiding this comment.
Logarithmic scales can't begin at zero anyway, and there are no fractional numbers here, so starting at 1 is fine. Pageviews Analysis appears to do the same thing.
Thank you for your hard work!! :D
Has been requested a few times.
Implementation details:
use-log-scaleinqqq.json,en.jsonandfr.json. Do tell me if there's something else I need to do to setup i18n.xAxiselse we'd get a lot of overlappingBug: T177658