Page MenuHomePhabricator

Generate graphs from native wikitables
Open, LowPublic

Description

It would be nice to allow graphs to be auto-generated from native wikitables. This will make it easier to use compared to extension tag, at least for simple graphs, and make it more widely adopted across pages.

  1. This is supposed to be a simple to use and for basic cases - it doesn't have to support all types of graphs, all possible transformations, color selection etc. For advanced usage users should be encouraged to use <graph>. Probably bar/line plot would be enough as the most common scenarios
  2. This allows nice fallback when someone copy&paste wikitable from wiki that have graphs installed to a wiki where there is no extension (simply doesn't show the graph attached to the table)

Possible syntax:

{| class="mw-table mw-table-graph-bar"
! class="mw-table-graph-xaxis" |  Year
!  class="mw-table-graph-yaxis" | Population
|-
| 1995 || 100000
|-
| 1996 ||100300
|}

Output:

<table>...</table>
<graph>...</graph>

Event Timeline

There will be a considerable number of other settings. How should they be declared?

Probably as data attributes for few attributes that are commonly used other settings could be just not supported with this syntax

@eranroz could you give an example for things like: should the scale start at zero or the minimum of all values (zero=true), should the scale be linear or logarithmic, should there be a "category" column that specifies that this is a multi-series(lines) graph rather than one graph, should there be an option to show the data as a pie chart vs a line chart? Possibly the color of the graph should be customizable too. The more complex examples include "stacked" graphs, where multiple series are drawn one on top of the other to show the cumulative area of the data, but this might not be needed in this case.