Module talk:Chart: Difference between revisions

Content deleted Content added
Line 441:
 
That would be real game changer for Wikipedia, as charts would be automatically updated when tables received new data. [[Module:User script table row/data|Here]] is a good example of how to read data from tables. The module could be called with a ''page name'' (if not its own), a ''table id'' (if not the 1st one), and the columns for ''labels'' and ''values'' (if not the 1st and 2nd, respectively). It would certainly break if the table is oddly shaped or malformed, but that could be minimised ignoring header rows. This shouldn't be too hard, as this module already converts parameter values into values on tables. [[Module:Datatable|Here]] is my first crack at it. [[User:Guarapiranga|— 𝐆𝐮𝐚𝐫𝐚𝐩𝐢𝐫𝐚𝐧𝐠𝐚]] ([[User talk:Guarapiranga|talk]]) 01:36, 20 May 2021 (UTC)
:There appears to be a trend towards modules reading the content of a page, then trying to parse the wikitext and doing something with the result. That could be reasonable for something like [[Wikipedia:User scripts/Most imported scripts]] (the example given above) but I don't think it's desirable for articles. I have commented on that before and might try to say more but for now I'll just note that IMHO it would be better to have the data stored somewhere (in a module or in Commons structured data) and display the table and the chart from that data. That would be much more efficient and understandable, and would be much less fragile. [[User:Johnuniq|Johnuniq]] ([[User talk:Johnuniq|talk]]) 05:16, 20 May 2021 (UTC)