Module:Sandbox/Ajuanca/GraphIt/doc explained

= 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.

<nowiki>{{</nowiki>#invoke:{{BASEPAGENAME}}|''function_name''|''param1''|''param2''|''param name = param value''}}

Incidence proportion: get_incidence

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:

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 can be given. They will be passed to this moduled without any kind of modification.

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

{{((}}#invoke:{{BASEPAGENAME}}|'''get_all_incidence'''|''src''|''colum_name''|''date_name''|''inhabitants''|''nth''|graph=''true''{{))}}

Examples

Let's say we want a graph of the Data:COVID-19 cases in Asturias.tab Tabular file, showing the daily incidence of the total COVID-19 confirmed cases (which is registered in the "total_cases" column), expressed per 100.000 inhabitants, and assuming a total population of 1,018,775. Also note that the date is written in a format compatible with the (in the "date" row).

In this case, we will type:

{{((}}#invoke:{{BASEPAGENAME}}|get_all_incidence|COVID-19 cases in Asturias.tab|total_cases|date|1018775|5|graph=true{{))}}

which will output:

But this is an awful graph. remmeber that we can pass any Module:Graph parameter. In this case, we should specify that the x-values are dates. We can give a width and height, and other line width and color. A legend is also available.

With {{((}}#invoke:{{BASEPAGENAME}}|get_all_incidence|COVID-19 cases in Asturias.tab|total_cases|date|1018775|5|graph=true|height=300|width=800|colors=#2c72ff|linewidth=2|xType=date|legend=Legend|y1Title=Confirmed cases per 100.,000 inhabitants|title=COVID-19 cases in Asturias{{))}}

we get:

Various incidence proportions: get_incidences

This function calculates various incidence proportions of the given events for all the available dates. It can also output the medium of a specified interval, instead of all daily values.

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

Parameters

The possible parameters are:

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

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

{{((}}#invoke:{{BASEPAGENAME}}|'''get_incidences'''|''src''|''colum_names''|''date_name''|''inhabitants''|''nth''|''avgs''|graph=''true''{{))}}

Examples

Let's say we want a graph of the Data:COVID-19 cases in Asturias.tab Tabular file, showing the daily incidence of the total COVID-19 confirmed cases (which is registered in the "total_cases" column), expressed per 100,000 inhabitants, and assuming a total population of 1,018,775. We will request an average per two days. In the same plot, the recovered cases, also expressed per 100,000, with an average of one week.

In this case, we will type:

{{((}}#invoke:{{BASEPAGENAME}}|get_incidences|COVID-19 cases in Asturias.tab|total_cases,total_recovered|date|1018775|5|avgs=2,7|graph=true{{))}}

which will output: