Page MenuHomePhabricator

Update chart extension to include client side rendering
Closed, ResolvedPublic3 Estimated Story Points

Description

Background

In T376971 we considered options for optimizing our charts for different platforms/screen resolutions. The conclusion was to load the echarts library on the client. This will require some changes to the extension.

Blockers

Requirements

  • Users who are not running JavaScript will see an SVG. The SVG will be optimized for mobile and horizontally centered.
  • For users with capable browsers, charts will appear blurred initially until the echarts library has loaded and progressively enhanced the chart.
  • The echarts library will be loaded when a chart is scrolled into view using IntersectionObserver
  • The chart rendered via the JS library initially will look identical to the non-JS rendered chart but will have more interactivity (e.g. hovering over links will show)
  • The chart will be optimized for the user's language, for example numbers in Hebrew will be localized.
  • The initial CSS and JS bundles loaded on page load for Charts will be less than 1kb.
  • Charts will make use of custom elements so should be progressively enhanced using standard web technologies
  • For security reasons, the echarts library is private, it should not be possible for gadgets or user scripts to access it (yet) e.g. window.echarts is undefined. (We will add API abstractions to it at a later date)
  • For security reasons, it should not be possible to progressively enhance rendered via gadgets or via templates (for now). To do this custom elements will check that 1) the wiki-chart is in the code on page load and is trusted e.g. is marked up with the data-mw attribute.

Event Timeline

Jdlrobson edited projects, added Charts (Sprint 9); removed Charts.
Jdlrobson set the point value for this task to 2.
Jdlrobson changed the point value for this task from 2 to 3.
Jdlrobson moved this task from Incoming to Doing on the Charts (Sprint 9) board.
Jdlrobson lowered the priority of this task from High to Medium.
Jdlrobson moved this task from Doing to Ready for Signoff on the Charts (Sprint 9) board.
Jdlrobson moved this task from Ready for Signoff to Doing on the Charts (Sprint 9) board.
Jdlrobson updated the task description. (Show Details)
Jdlrobson added a subscriber: CCiufo-WMF.

Change #1079683 had a related patch set uploaded (by Jdlrobson; author: Santhosh):

[mediawiki/extensions/Chart@master] Interactive chart: Progressive enhancement at client side

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

Change #1079683 merged by jenkins-bot:

[mediawiki/extensions/Chart@master] Interactive chart: Progressive enhancement at client side

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