Project Information
- Name of tool/project: Chart (extension) and chart-renderer (service)
- Project home page: https://www.mediawiki.org/wiki/Extension:Chart
- Name of team requesting review: Charts task force
- Primary contact: @Jdlrobson (filling in for @Catrope, who will be on parental leave)
- Target date for deployment: October 2024 (approximate; we plan to deploy when we're ready to from a feature completeness perspective, see T372082. We may want to deploy to testwiki slightly before that)
- Link to code repository / patchset: https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/Chart/+/refs/heads/master and https://gitlab.wikimedia.org/repos/mediawiki/services/chart-renderer
- Link to scc output for general sizing of codebases (https://github.com/boyter/scc): P68256 and P68257
Description of the tool/project:
MediaWiki extension that allows editors to create charts and embed them in wiki pages, replacing the legacy Graph extension. Charts are rendered on the server by making an HTTP request to a private HTTP service based on Express and service-runner, which uses Apache eCharts to render charts as SVGs. Initial deployment will likely not involve client-side enhancement of charts, but this may be added later.
Note that the extension and service are still under development, in that we're still adding more chart types and features. But the structure of things is not expected to change much (except for T370378), so we think it's ready for a security review at this stage.
Description of how the tool will be used at WMF:
Will be deployed on all wikis (except loginwiki and fishbowl wikis). Users will use this to put charts in wiki pages. Chart definitions and data will be hosted on Commons, but charts can be embedded on pages on any wiki.
Dependencies
Chart extension:
- The JsonConfig extension (already deployed in production)
- An optional dependency on the GlobalUsage extension may be introduced by T370378, depending on how usage tracking is implemented
chart-renderer service:
- Apache eCharts
- The svgo NPM package, for SVG manipulation
- Standard NPM packages for running an HTTP service: service-runner, express, body-parser, compression
- We're aware that @tchin/service-utils is intended to replace service-runner, but we were told it wasn't stable enough to use yet. We're happy to migrate to this whenever is appropriate.
- The commander NPM package, to allow the chart renderer to be invoked as a CLI script instead of an HTTP service, mainly intended for local development and for 3rd-party wiki support. This would not be used in production (but the NPM dependency would still be there). If required, we could explore restructuring the CLI wrapper such that the HTTP service can be built without the commander dependency.
Has this project been reviewed before?
No
Working test environment
The extension and the service are deployed in the beta cluster.
- Example chart definition page (which is a JSON blob when you edit it, but appears as a chart when you view it): https://commons.wikimedia.beta.wmflabs.org/wiki/Data:1993_Canadian_federal_election.chart
- This uses the data from https://commons.wikimedia.beta.wmflabs.org/wiki/Data:1993_Canadian_federal_election.tab, which is a tabular data page. Tabular data pages are provided by the JsonConfig extension and are already available in production, see e.g. https://commons.wikimedia.org/wiki/Data:Election_results/May_2018_Ohio_Issue_1.tab
- Example usage on an article page: https://en.wikipedia.beta.wmflabs.org/wiki/User:RoanKattouw/charts
- For how the extension is configured on the beta cluster, see https://gerrit.wikimedia.org/r/c/operations/mediawiki-config/+/1055984
- For local testing, follow the instructions in the README file in the Chart extension repo
Post-deployment
The Charts task force is responsible for this extension and is actively developing it. The main point of contact is Jon Robson (@Jdlrobson), who is filling in for Roan Kattouw (@Catrope)'s parental leave until late November / early December.