Page MenuHomePhabricator

Wikistats2: Values in map view show unnecessary decimal digits
Closed, ResolvedPublic3 Story Points

Description

See e.g. https://stats.wikimedia.org/v2/#/all-projects/reading/page-views-by-country/normal|map|1-Month~2018061900~2018072000|~total

The ranges are now as follows:
1K, 6.55K, 42.9K, 281.03K, 1.84M, 12.06M, 78.98M, 517.29M, 3.39B

I'm pretty sure all readers all going to ignore these values as 'not fit for humans', which is one part of why this chart is not so informative.

Event Timeline

ezachte created this task.Jul 20 2018, 9:42 AM
Restricted Application added a project: Analytics. · View Herald TranscriptJul 20 2018, 9:42 AM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript
fdans triaged this task as Low priority.Jul 26 2018, 3:36 PM
fdans raised the priority of this task from Low to Normal.
fdans moved this task from Incoming to Wikistats Beta on the Analytics board.
Jsc39 claimed this task.Dec 13 2018, 9:07 PM
Jsc39 added a subscriber: Jsc39.

I want to work on this issue. I am new over here so it would be kind if you could guide me on this

mforns added a subscriber: mforns.Mar 11 2019, 4:27 PM

@ezachte The issue 1 has changed since your initial description.
Now we do not have intervals, rather we round to the 1000s. However, there is still some non-human values like 304.33M.
What do you think would be a good formatting?

Issues #2 and #3 are tackled in other tasks: T187212 and T218045 respectively. Let's keep this task about issue #1.
@Jsc39, please feel free to take this task :] Ping me, if you need some help!

mforns renamed this task from Issues with page view map in Wikistats 2 to Wikistats2: Values in map view show unnecessary decimal digits.Mar 11 2019, 4:32 PM
mforns updated the task description. (Show Details)
Milimetric raised the priority of this task from Normal to High.Apr 1 2019, 4:30 PM
fdans claimed this task.Tue, Jun 25, 2:26 PM

Change 519036 had a related patch set uploaded (by Fdans; owner: Fdans):
[analytics/wikistats2@master] Alter map number filter to show only 3 significant digits

https://gerrit.wikimedia.org/r/519036

fdans moved this task from Next Up to In Code Review on the Analytics-Kanban board.
Nuria added a subscriber: Nuria.Wed, Jun 26, 12:03 AM

Going with https://stats.wikimedia.org/wikimedia/animations/wivivi/wivivi.html I think 50.3M should be probably 50M? and 50.6 M gets shown as 51M?

Nuria added a comment.Wed, Jun 26, 1:04 AM

Should we do these changes for the dashboard as well?

Nuria added a comment.Wed, Jun 26, 1:07 AM

I am a bit unsure of what is the format we are aiming for here, if it is a removal of decimal places we can do:

const kmb = (n) => {

let units = numeral(n).format('0 a');
return units.toUpperCase();

}

This would render numbers like:
1234 K
24M
4B

ping to @Milimetric @fdans and @mforns so they can chime in

Going with https://stats.wikimedia.org/wikimedia/animations/wivivi/wivivi.html I think 50.3M should be probably 50M? and 50.6 M gets shown as 51M?

I think, philosophically, 3 significant digits (50.3M) is more coherent with the fact that we already are simplifying big numbers by way of K, M, etc. abreviations.
Right now, we simplify 534208 to 534K (3 significant digits).
If we did only 2 significant digits, 534805 would rather be simplified to 530K, right?
So following this rule, we can apply the same to numbers that acquire a decimal part, no? 50345719 -> 50.3M, 4378452 -> 4.38M
That said... practically, I think both 2-significant-digits and 3-significant-digits are good for the Wikistats2 case.

Should we do these changes for the dashboard as well?

I think we should! And everywhere in Wikistats, no?
Maybe, we could factor this out into a single place that affects all the app?

Nuria added a comment.Wed, Jun 26, 3:21 PM

Maybe, we could factor this out into a single place that affects all the app?

it already is, filters take care of all the formatting. Ok, I will do the changes.

Nuria added a comment.Wed, Jun 26, 3:30 PM

Confirming this is what we expect

Nuria claimed this task.Wed, Jun 26, 6:11 PM
Nuria added a subscriber: fdans.

Per our after standup conversation, changing code to be slightly different than last screenshoot

Change 519036 merged by Milimetric:
[analytics/wikistats2@master] Change number formating to show less decimal places

https://gerrit.wikimedia.org/r/519036

(btw didn't mention this on the review but I looked at the pageviews-by-country map and it looks much nicer with the new formatting)

Nuria moved this task from Ready to Deploy to Done on the Analytics-Kanban board.Wed, Jul 3, 9:50 PM
Nuria set the point value for this task to 3.
Nuria closed this task as Resolved.Tue, Jul 9, 3:29 PM