::No doubt Wikidata and Commons:Data are the future, but as of now, I don't see data there being updated, do you? Look at [[commons:Data:Bea.gov/GDP by state.tab]], the very first source there on [[Template:Graph:Stacked]]: the data is 5 years stale, whereas the data at the [[List of states and territories of the United States by GDP]] is freshly updated.
::No doubt too that this is a much more fragile solution, yet much more flexible (as is typically the case with... everything in life?). Besides, not every wikitable warrants a database in Wikidata or Commons:Data, yet readers may benefit from seeing its data graphed in the article. [[User:Guarapiranga|— 𝐆𝐮𝐚𝐫𝐚𝐩𝐢𝐫𝐚𝐧𝐠𝐚]] ([[User talk:Guarapiranga|talk]]) 08:09, 20 May 2021 (UTC)
:::this module should not be tasked with harvesting wikidata. however, it should be straightforward to write a module to do the harvesting, and use the functionality of this module to chart the graph. it can be done without touching this one - the caller has to generate a "frame" object, and call one of the exported functions here (it doesn't even have to be "real" frame object- simply a table with "args" field, containing data and parameters). this module is too complex as it is, and i don't think it's such a great idea to complicate it further. it's possible (and makes sense) to slightly modify this one, such that the "frame wrapping" can be skipped, by adding and exporting, e.g., function _pieChart(args), which will be marginally easier to call from other modules.
::: [[User:Guarapiranga]] you may want to continue developing your "first crack", and teach it to <syntaxhighlight lang="lua">
-- this code is inside your exported function
local args = {}
-- prepare "args", from parameters "piped" from the calling template and data harvested from wikidata
-- hack hack hack
return require('Module:Chart').pieChart({ ['args'] = args } ) -- return chart to page
-- alternatively, if we break out "_pieChart":
return require('Module:Chart')._pieChart(args)
</syntaxhighlight>peace - [[User:קיפודנחש|קיפודנחש (aka kipod)]] ([[User talk:קיפודנחש|talk]]) 05:07, 23 May 2021 (UTC)
|