Module:Sandbox/Ajuanca/GraphIt/doc

From blackwiki
Jump to navigation Jump to search

This is the documentation page for Module:Sandbox/Ajuanca/GraphIt

Usage

Place the following snippet on the wiki page, replacing function_name with the name of the function to be used, and giving the parameters separated with |. Specific parameters, the ones with a specific name, like avgs, are assigned with the = sign: |avgs=2,3,4|.

For all the examples shown below, the file Data:COVID-19 cases in Asturias.tab is going to be used.

{{#invoke:Sandbox/Ajuanca/GraphIt|function_name|param1|param2|param name = param value}}

Incidence proportion

This function calculates the incidence proportion of a specific event for all the available dates.

I.e.: The daily confirmed cases of flu per 10.000 inhabitants in Asturias.

Parameters

The possible parameters are:

  • src= or the first param: The name of the Tabular file. These files are hosted on Wikimedia Commons, inside the Data namespace ("Data:name of tabular file.tab"). The files in this section must end with the suffix ("Data: name of tabular file.tab"). I.e. The file itself, "COVID-19 cases in Asturias.tab"
  • column_name= or the second param: The name of the column where the data of the event is stored. I.e. The column with the total confirmed cases of COVID-19 in Asturias, called "total_cases".
  • date_name= or the third param: The name of the column where the date of the data of the event is stored. I.e. The column with the date (in a String format YYYY-MM-DD), called "date".
  • inhabitants= or the fourth param: The population size of the given region. I.e. 1,018,775 total inhabitants living in Asturias, according to the INE as a temporarly data for January 1st, 2020.
  • nth= or the fifth param: The power of 10 for the generated output (the power of ten to the nth, 10n). This value normally will be 4 or 5, althought can be changed for smaller or bigger population sizes. I.e. 5, which causes the output to be given per 105 inhabitants (100,000).
  • graph= param: A Boolean (true or false) specifiying if a graph should be generated as an output. Default is false. I.e. true (showing a graph as an output).
  • ltable= param: A Boolean (true or false) specifiying if the Lua variable should be generated as an output. Default is false. I.e. false (no returning the variable itself). This is a extrange value to be requested.
  • wtable= param: A Boolean (true or false) specifiying if a Wikitable table should be generated as an output. Default is false. I.e. false (no returning a wikitable). This options is still NOT AVAILABLE.


Note 1: Instead of the column_name parameter, column_title can be used intead. Alike, date_title can be given. It is unusual, but two or more columns could have the same title (but not the same name), so this approach is less safe than column_name and date_name.


Note 2: If graph=true is requested, all parameters available at the Module:Graph can be given. They will be passed to this moduled without any kind of modification.


As a recap, the snippet to include will loke like this:

{{#insert:Sandbox/Ajuanca/GraphIt|get_all_incidence|src|colum_name|date_name|inhabitants|nth|graph=true}}

Examples