Page MenuHomePhabricator

Fix overflow behavior for image generated by Extension:Graph on mobile view
Closed, ResolvedPublicBUG REPORT

Description

The Graph extension doesn't provide a solution to fix overflow issue on mobile view, so if the image is extreme wide than viewport, the entire page would be scrollable in any direction on mobile phone, that is inconvenience for readers.

This problem is reproducable with https://en.m.wikipedia.org/wiki/Template:Graph:PageViews while you see this page on your mobile phone, and even before the image is loaded.

Screenshot_20210415-162623.png (2×1 px, 239 KB)

Mozilla/5.0 (Android 7.0; Mobile; rv:87.0) Gecko/87.0 Firefox/87.0

To fix that, you can integrate a @media rule from the following Wikipedia template:
https://en.wikipedia.org/wiki/Template:Graph:Chart/styles.css

Event Timeline

TheDJ changed the subtype of this task from "Task" to "Bug Report".Jan 20 2022, 2:22 PM
TheDJ subscribed.

Mobile does have some logic for this, but only for the canvas of the actual graph, not for the wrapping element .mw-graph, which sets 'min-width' / 'min-height'.

Change 910796 had a related patch set uploaded (by Jdlrobson; author: TheDJ):

[mediawiki/extensions/Graph@master] Restrict graph to fit within the specified dimensions

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

Jdlrobson updated Other Assignee, added: Jdlrobson.

Change 910796 merged by jenkins-bot:

[mediawiki/extensions/Graph@master] Restrict graph to fit within the specified dimensions

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

Change 912426 had a related patch set uploaded (by Jdlrobson; author: Jdlrobson):

[mediawiki/extensions/Graph@master] data.format.parse may not exist

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

Change 912426 merged by jenkins-bot:

[mediawiki/extensions/Graph@master] data.format.parse may not exist

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