Page MenuHomePhabricator

Impact Module: "sparkline" style graph that shows pageviews over time
Closed, ResolvedPublic

Assigned To
Authored By
SBisson
Apr 4 2019, 6:47 PM
Referenced Files
Restricted File
Nov 30 2022, 3:42 AM
F35824828: Screen Shot 2022-11-29 at 6.53.29 PM.png
Nov 30 2022, 3:40 AM
F35824823: Screen Shot 2022-11-29 at 8.55.32 AM.png
Nov 30 2022, 3:40 AM
F35789640: image.png
Nov 17 2022, 10:15 AM
F35789634: image.png
Nov 17 2022, 10:15 AM
F35789150: image.png
Nov 17 2022, 10:15 AM
F35789146: image.png
Nov 17 2022, 10:15 AM
F35733141: Screenshot 2022-11-09 at 17.04.51.png
Nov 9 2022, 4:07 PM

Description

The newcomer homepage is a feature to help newcomers get oriented when they first create their account, so they can figure out how to start editing quickly. One component of the homepage is the impact module, which shows newcomers how many pageviews the pages get they have edited, which is meant to motivate them about continuing to contribute.

Problem: Currently, only the number of pageviews for an article is shown in the impact module, which makes it unclear that selecting this number takes the user to the article's Pageviews stats page.

Proposed: Add a "spark" line chart to each article pageview number. This will:
(a) show how page views have changed over time within the module,
(b) better indicate that selecting this will take users to see how the pageviews for the pages have changed over time, and
(c) help distinguish is as a separate link destination to the article title.

Proposed design:

image.png (1,170×1,066 px, 281 KB)

More details on this figma page

NOTE: This task is about adding the chart to the module, final chart visual design TBC.

Related Objects

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes
SBisson renamed this task from "sparkline" style graph hat shows pageviews over time to Homepage Impact: "sparkline" style graph hat shows pageviews over time.Apr 4 2019, 7:12 PM
MMiller_WMF renamed this task from Homepage Impact: "sparkline" style graph hat shows pageviews over time to Homepage Impact: "sparkline" style graph that shows pageviews over time.Apr 6 2019, 1:04 AM
MMiller_WMF updated the task description. (Show Details)

@MMiller_WMF @SBisson
I have changed the task description and added a link to the invision mockup of an older version of the impact module with the "sparkline" icon.
Could you please confirm it is the one you were referring to?

Moving to Triaged but Future; if we should prioritize this for an upcoming quarter please move on workboard @MMiller_WMF

Sparklines should also be part of the Design inventory T277047. If considered sub-group of data visualizations or lone-standing is to be discussed.

KStoller-WMF renamed this task from Homepage Impact: "sparkline" style graph that shows pageviews over time to Impact Module: "sparkline" style graph that shows pageviews over time.Jul 18 2022, 11:21 PM

The mock uses a chartline which goes back five days (or five somethings, could be weekly I guess), is that the intention? I suspect the sparkline will be much less visually compelling if we try to make it use a much higher data resolution (e.g. daily views in the last 30 days), as page view data is relatively noisy.

Should the Y axes be zero-based, or zoomed into the actual data range? Should the different sparklines have the same Y axis?

The figma description says "ALT text should describe the general trend in the spark line" (which implies this will be implemented with something that has alt text; not sure what our options are here - inline SVG with <title>, maybe?) which will have to be specified in more details.

@Tgr Sorry for the delay, just realised the visual design for the sparkline was tbc. In answer to your questions relating to the design:

The mock uses a chartline which goes back five days (or five somethings, could be weekly I guess), is that the intention? I suspect the sparkline will be much less visually compelling if we try to make it use a much higher data resolution (e.g. daily views in the last 30 days), as page view data is relatively noisy.

I can’t comment on the original intention but five data points seems like a reasonable amount given the size of the icon so I’m happy to go with that. I think your suggestion of weeks is a good one, however, does that mean that no data would be shown until five weeks data has been collected? If so, I think we might need to show daily data points at first so that newcomers will see something straight away.

Should the Y axes be zero-based, or zoomed into the actual data range? Should the different sparklines have the same Y axis?

My instinct here is to say that the different sparklines do not need to have the same Y axis, as I think this could potentially create too much variation across each item. Also, I think the purpose of the sparkline is to show the general trend of views for each individual article and not to compare articles with each other.

Would it be possible for us to take the current visual treatment and approach described above and experiment with real data? I think once we see the results of real data it maybe easier to assess what design changes may need to be made.

cc @KStoller-WMF

@kostajh - I'm curious on what you think the level of effort will be to create this sparkline visual? If it seems fairly complex, then this is another task I'm open to moving to the second iteration of Positive Reinforcement. I do have some concerns that this could get fairly complex while still not really providing much insight due to the very small size of the sparkline.

@kostajh - I'm curious on what you think the level of effort will be to create this sparkline visual? If it seems fairly complex, then this is another task I'm open to moving to the second iteration of Positive Reinforcement. I do have some concerns that this could get fairly complex while still not really providing much insight due to the very small size of the sparkline.

My assumption had been that we would use a library, like vue-sparklines or jquery-sparkline to generate these. (@Sgs has an alternative proposal to use SVGs for this.)

My second assumption is that we'll use the same implementation for the larger, cumulative chart as we would for individual rows on the table.

So, it could make sense to defer this feature to a second iteration, but only if we are also deferring the cumulative chart at the top of the module, because they would in theory both be done in the same way.

My feeling at the moment is that we should keep this for the current iteration for now. If we run into unanticipated problems in implementing, then we can reconsider.

As discussed with @kostajh we'll do a spike to use the already available library D3 in Extension:Graph to build the sparkline graphic rather than pulling another external library. The reasons are possible security flaws for the new packages, we didn't find any vue/jquery library that fits our visual requirements (background and points of data) and reusing available tools.

Urbanecm_WMF changed the task status from Open to In Progress.Sep 29 2022, 10:06 AM
Sgs removed Sgs as the assignee of this task.Oct 10 2022, 6:16 PM

Un-assigning since I'm not actively working on this. This task could be easier to complete after T310660: Impact module: Cumulative pageviews trendchart is finished, which is probably blocked by T318854: Application Security Review Request : d3.js

kostajh raised the priority of this task from Medium to High.Oct 17 2022, 9:14 AM

Un-assigning since I'm not actively working on this. This task could be easier to complete after T310660: Impact module: Cumulative pageviews trendchart is finished, which is probably blocked by T318854: Application Security Review Request : d3.js

Not exactly blocked by T313310: Impact module: Implement table list component, but we should build on the patch that is there, if it is not merged before someone claims this task.

Change 850672 had a related patch set uploaded (by Sergio Gimeno; author: Sergio Gimeno):

[mediawiki/extensions/GrowthExperiments@master] User impact: add sparkline beside article pageviews count

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

Sgs added a subscriber: RHo.

We've explored solving this issue reusing the line chart created in T310660: Impact module: Cumulative pageviews trendchart which can be seen already in beta (Special:Impact) pages. I'm requesting a design review on the size of the graphic to display here beside the page views number. The current design has a width of 15,7px and height of 8,7px. I find it quite small. Is this size correct and accessibility compliant? What do you think @RHo

We've explored solving this issue reusing the line chart created in T310660: Impact module: Cumulative pageviews trendchart which can be seen already in beta (Special:Impact) pages. I'm requesting a design review on the size of the graphic to display here beside the page views number. The current design has a width of 15,7px and height of 8,7px. I find it quite small. Is this size correct and accessibility compliant? What do you think @RHo

The size of the sparkline chart areas is meant to the same size as an icon canvas (20x20px), with 2px spacing for the square-shaped chart:

image.png (1,672×1,386 px, 194 KB)

IMO this is fine for tertiary data indicating views trend next to the vital pageviews number, and for what it's worth, is similar size (height-wise) to what is the (Android) app:

image.png (1,296×726 px, 140 KB)

One other example of accessible sparklines I found in this alistapart article also shows sparkline charts at less than 20px, and scaleable to text size.

Is it possible to proceed with the 20x20px size as max and see how it looks?

Change 850672 merged by jenkins-bot:

[mediawiki/extensions/GrowthExperiments@master] User impact: add sparkline beside article pageviews count

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

Is it possible to proceed with the 20x20px size as max and see how it looks?

It can be tested now in betalabs but needs some follow ups since it seems that we're displaying more than 5 data points and the size is not corrected yet. Let me fix it and ping back.

Is it possible to proceed with the 20x20px size as max and see how it looks?

It can be tested now in betalabs but needs some follow ups since it seems that we're displaying more than 5 data points and the size is not corrected yet. Let me fix it and ping back.

About the 5 data points, that is filed as T322410: NewImpact: Limit article table list to 5 articles with data and 5 articles pending data

About the data points what I was meaning is what others already pointed before:

The mock uses a chartline which goes back five days (or five somethings, could be weekly I guess), is that the intention? I suspect the sparkline will be much less visually compelling if we try to make it use a much higher data resolution (e.g. daily views in the last 30 days), as page view data is relatively noisy.

I think the "noisy" effect is happening now, even worse since there are 60 days as data points:

Screenshot 2022-11-09 at 17.04.51.png (2,338×582 px, 195 KB)

We can reduce the number of data points to a fixed number, eg: 5 or to a fixed unit, ie: weeks.

Change 855017 had a related patch set uploaded (by Sergio Gimeno; author: Sergio Gimeno):

[mediawiki/extensions/GrowthExperiments@master] User impact: fix article sparkline graph size

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

Change 855017 merged by jenkins-bot:

[mediawiki/extensions/GrowthExperiments@master] User impact: fix article sparkline graph size

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

About the data points what I was meaning is what others already pointed before:

The mock uses a chartline which goes back five days (or five somethings, could be weekly I guess), is that the intention? I suspect the sparkline will be much less visually compelling if we try to make it use a much higher data resolution (e.g. daily views in the last 30 days), as page view data is relatively noisy.

I think the "noisy" effect is happening now, even worse since there are 60 days as data points:

Screenshot 2022-11-09 at 17.04.51.png (2,338×582 px, 195 KB)

We can reduce the number of data points to a fixed number, eg: 5 or to a fixed unit, ie: weeks.

Possibly already suggested/tried but how does it look with smoothing applied using interpolate as well as reducing data points?
http://www.d3noob.org/2013/01/smoothing-out-lines-in-d3js.html

About the data points what I was meaning is what others already pointed before:

The mock uses a chartline which goes back five days (or five somethings, could be weekly I guess), is that the intention? I suspect the sparkline will be much less visually compelling if we try to make it use a much higher data resolution (e.g. daily views in the last 30 days), as page view data is relatively noisy.

I think the "noisy" effect is happening now, even worse since there are 60 days as data points:

Screenshot 2022-11-09 at 17.04.51.png (2,338×582 px, 195 KB)

We can reduce the number of data points to a fixed number, eg: 5 or to a fixed unit, ie: weeks.

Possibly already suggested/tried but how does it look with smoothing applied using interpolate as well as reducing data points?
http://www.d3noob.org/2013/01/smoothing-out-lines-in-d3js.html

AFAICT, nowadays one should use d3.curve() for this functionality, see https://stackoverflow.com/questions/40198378/interpolate-is-not-a-function and https://github.com/d3/d3-shape#curveBasis

In the interest of keeping the board tidy, could I suggest we create that as a separate task, if needed, and place this one in QA?

Hi @kostajh, I took a look at the view on the Impact section and

  1. The numbers appear to be different from when I open the link to the page views. It is 305,054 on my view but 322,762 on pageviews
image.png (1,136×870 px, 120 KB)
image.png (3,002×1,694 px, 3 MB)
  1. The graph does not show the dips and peaks that correspond to the page views, as designed in Figma. It is pretty much on the same level all through, whereas the page view count go as low as 4000 and as high as 10,000.
image.png (604×226 px, 25 KB)
image.png (1,074×358 px, 52 KB)

Hi @kostajh, I took a look at the view on the Impact section and

  1. The numbers appear to be different from when I open the link to the page views. It is 305,054 on my view but 322,762 on pageviews
image.png (1,136×870 px, 120 KB)
image.png (3,002×1,694 px, 3 MB)

@EUdoh-WMF thanks for these notes; I suggest re-checking this after T323253: NewImpact module: Page view data should be limited to when user made their first edit is done.

  1. The graph does not show the dips and peaks that correspond to the page views, as designed in Figma. It is pretty much on the same level all through, whereas the page view count go as low as 4000 and as high as 10,000.
image.png (604×226 px, 25 KB)
image.png (1,074×358 px, 52 KB)

That is probably worth its own task to follow-up on: T323478: NewImpact: graph does not show the dips and peaks that correspond to the page views

Etonkovidova subscribed.

Checked in betalabs

zero viewsmobile view
Screen Shot 2022-11-29 at 8.55.32 AM.png (1,036×1,120 px, 103 KB)
Screen Shot 2022-11-29 at 6.53.29 PM.png (916×596 px, 98 KB)
{F35824871}

Note: two outstanding issues (the mismatch between the number of views displayed on Homepage and on the pageviews stats and the smoothness of the sparkline) were reported in T323253 and T323478 per https://phabricator.wikimedia.org/T220141#8408697.

Note: two outstanding issues (the mismatch between the number of views displayed on Homepage and on the pageviews stats and the smoothness of the sparkline) were reported in T323253 and T323478 per https://phabricator.wikimedia.org/T220141#8408697.

They probably show a slightly different set of days (maybe because of T323748: UserImpact: Adjust time zone correction for page view URLs, maybe it's just an off-by-one error somewhere). AIUI we are not treating this as a deploy blocker.

Note there is a third related issue, mentioned at T323478#8422623.

Note that I am providing sign off on design on the current sparkline, but have created T324165 to address visual refinements afterwards.

Note that I am providing sign off on design on the current sparkline, but have created T324165 to address visual refinements afterwards.

Checked in testwiki wmf.12 - some improvements will be addressed in the follow-up tickets as mentioned in the comments.