https://en.wikipedia.org/w/index.php?action=history&feed=atom&title=Module%3AMedical_cases_chart%2Fsandbox3
Module:Medical cases chart/sandbox3 - Revision history
2025-06-07T16:41:58Z
Revision history for this page on the wiki
MediaWiki 1.45.0-wmf.4
https://en.wikipedia.org/w/index.php?title=Module:Medical_cases_chart/sandbox3&diff=996787863&oldid=prev
Kohraa Mondel: intermediate restructured version
2020-12-28T16:43:02Z
<p>intermediate restructured version</p>
<table style="background-color: #fff; color: #202122;" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Previous revision</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 16:43, 28 December 2020</td>
</tr><tr>
<td colspan="2" class="diff-lineno">Line 6:</td>
<td colspan="2" class="diff-lineno">Line 6:</td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>local i18n = require("Module:Medical cases chart/i18n")[language]</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>local i18n = require("Module:Medical cases chart/i18n")[language]</div></td>
</tr>
<tr>
<td colspan="2" class="diff-empty diff-side-deleted"></td>
<td class="diff-marker"><a class="mw-diff-movedpara-right" title="Paragraph was moved. Click to jump to old location." href="#movedpara_3_0_lhs">⚫</a></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><a name="movedpara_1_0_rhs"></a>local navbar = require('Module:Navbar')._navbar</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>local function is(v)</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>local function is(v)</div></td>
</tr>
<tr>
<td colspan="2" class="diff-lineno">Line 371:</td>
<td colspan="2" class="diff-lineno">Line 372:</td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>function p._chart(args)</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>function p._chart(args)</div></td>
</tr>
<tr>
<td class="diff-marker"><a class="mw-diff-movedpara-left" title="Paragraph was moved. Click to jump to new location." href="#movedpara_1_0_rhs">⚫</a></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><a name="movedpara_3_0_lhs"></a><del style="font-weight: bold; text-decoration: none;"> </del>local navbar = require('Module:Navbar')._navbar</div></td>
<td colspan="2" class="diff-empty diff-side-added"></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> local barargs = {}</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> local barargs = {}</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
</tr>
<tr>
<td class="diff-marker" data-marker="−"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> -- <del style="font-weight: bold; text-decoration: none;">mapping</del> and <del style="font-weight: bold; text-decoration: none;">default of numwidth, right1, right2</del> moved to _getChartPams</div></td>
<td class="diff-marker" data-marker="+"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> -- <ins style="font-weight: bold; text-decoration: none;">mappings</ins> and <ins style="font-weight: bold; text-decoration: none;">defaults</ins> moved to _getChartPams</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> local numwidth = args.numwidthwidth</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> local numwidth = args.numwidthwidth</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> local right1 = args.right1width</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> local right1 = args.right1width</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> local right2 = args.right2width</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> local right2 = args.right2width</div></td>
</tr>
<tr>
<td class="diff-marker" data-marker="−"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><br /></td>
<td colspan="2" class="diff-empty diff-side-added"></td>
</tr>
<tr>
<td class="diff-marker" data-marker="−"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> -- mapping and default of barwidth moved to _getChartPams</div></td>
<td colspan="2" class="diff-empty diff-side-added"></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> local barwidth = args.barwidth</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> local barwidth = args.barwidth</div></td>
</tr>
<tr>
<td colspan="2" class="diff-empty diff-side-deleted"></td>
<td class="diff-marker"><a class="mw-diff-movedpara-right" title="Paragraph was moved. Click to jump to old location." href="#movedpara_11_4_lhs">⚫</a></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><a name="movedpara_9_0_rhs"></a><ins style="font-weight: bold; text-decoration: none;"> </ins>barargs.width = <ins style="font-weight: bold; text-decoration: none;">args.sTotalWidth</ins></div></td>
</tr>
<tr>
<td colspan="2" class="diff-empty diff-side-deleted"></td>
<td class="diff-marker"><a class="mw-diff-movedpara-right" title="Paragraph was moved. Click to jump to old location." href="#movedpara_11_5_lhs">⚫</a></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><a name="movedpara_9_1_rhs"></a><ins style="font-weight: bold; text-decoration: none;"> </ins>barargs.barwidth = <ins style="font-weight: bold; text-decoration: none;">args.sBarWidth</ins></div></td>
</tr>
<tr>
<td colspan="2" class="diff-empty diff-side-deleted"></td>
<td class="diff-marker"><a class="mw-diff-movedpara-right" title="Paragraph was moved. Click to jump to old location." href="#movedpara_11_8_lhs">⚫</a></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><a name="movedpara_9_2_rhs"></a> barargs.float = args.float</div></td>
</tr>
<tr>
<td colspan="2" class="diff-empty diff-side-deleted"></td>
<td class="diff-marker" data-marker="+"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> local duration = args.nDuration</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
</tr>
<tr>
<td class="diff-marker"><a class="mw-diff-movedpara-left" title="Paragraph was moved. Click to jump to new location." href="#movedpara_26_0_rhs">⚫</a></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><a name="movedpara_11_0_lhs"></a> if tonumber(barwidth) then</div></td>
<td colspan="2" class="diff-empty diff-side-added"></td>
</tr>
<tr>
<td class="diff-marker"><a class="mw-diff-movedpara-left" title="Paragraph was moved. Click to jump to new location." href="#movedpara_26_1_rhs">⚫</a></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><a name="movedpara_11_1_lhs"></a> <del style="font-weight: bold; text-decoration: none;">barargs</del>.<del style="font-weight: bold; text-decoration: none;">width</del> = 85 + barwidth + numwidth .. 'px'</div></td>
<td colspan="2" class="diff-empty diff-side-added"></td>
</tr>
<tr>
<td class="diff-marker" data-marker="−"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> barargs.barwidth = barwidth .. 'px'</div></td>
<td colspan="2" class="diff-empty diff-side-added"></td>
</tr>
<tr>
<td class="diff-marker"><a class="mw-diff-movedpara-left" title="Paragraph was moved. Click to jump to new location." href="#movedpara_26_3_rhs">⚫</a></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><a name="movedpara_11_3_lhs"></a> else</div></td>
<td colspan="2" class="diff-empty diff-side-added"></td>
</tr>
<tr>
<td class="diff-marker"><a class="mw-diff-movedpara-left" title="Paragraph was moved. Click to jump to new location." href="#movedpara_9_0_rhs">⚫</a></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><a name="movedpara_11_4_lhs"></a><del style="font-weight: bold; text-decoration: none;"> </del>barargs.width = <del style="font-weight: bold; text-decoration: none;">'auto'</del></div></td>
<td colspan="2" class="diff-empty diff-side-added"></td>
</tr>
<tr>
<td class="diff-marker"><a class="mw-diff-movedpara-left" title="Paragraph was moved. Click to jump to new location." href="#movedpara_9_1_rhs">⚫</a></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><a name="movedpara_11_5_lhs"></a><del style="font-weight: bold; text-decoration: none;"> </del>barargs.barwidth = <del style="font-weight: bold; text-decoration: none;">'auto'</del></div></td>
<td colspan="2" class="diff-empty diff-side-added"></td>
</tr>
<tr>
<td class="diff-marker"><a class="mw-diff-movedpara-left" title="Paragraph was moved. Click to jump to new location." href="#movedpara_26_6_rhs">⚫</a></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><a name="movedpara_11_6_lhs"></a> end</div></td>
<td colspan="2" class="diff-empty diff-side-added"></td>
</tr>
<tr>
<td class="diff-marker" data-marker="−"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><br /></td>
<td colspan="2" class="diff-empty diff-side-added"></td>
</tr>
<tr>
<td class="diff-marker"><a class="mw-diff-movedpara-left" title="Paragraph was moved. Click to jump to new location." href="#movedpara_9_2_rhs">⚫</a></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><a name="movedpara_11_8_lhs"></a> barargs.float = args.float<del style="font-weight: bold; text-decoration: none;"> and args.float or 'right'</del></div></td>
<td colspan="2" class="diff-empty diff-side-added"></td>
</tr>
<tr>
<td class="diff-marker"><a class="mw-diff-movedpara-left" title="Paragraph was moved. Click to jump to new location." href="#movedpara_16_0_rhs">⚫</a></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><a name="movedpara_11_9_lhs"></a> local location = mw.ustring.gsub(args.location, 'the ', '')</div></td>
<td colspan="2" class="diff-empty diff-side-added"></td>
</tr>
<tr>
<td class="diff-marker"><a class="mw-diff-movedpara-left" title="Paragraph was moved. Click to jump to new location." href="#movedpara_16_1_rhs">⚫</a></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><a name="movedpara_11_10_lhs"></a> location = mw.ustring.upper(mw.ustring.sub(location,1,1)) .. mw.ustring.sub(location,2)</div></td>
<td colspan="2" class="diff-empty diff-side-added"></td>
</tr>
<tr>
<td class="diff-marker" data-marker="−"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><br /></td>
<td colspan="2" class="diff-empty diff-side-added"></td>
</tr>
<tr>
<td class="diff-marker"><a class="mw-diff-movedpara-left" title="Paragraph was moved. Click to jump to new location." href="#movedpara_16_3_rhs">⚫</a></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><a name="movedpara_11_12_lhs"></a> local navbartitle = args.outbreak .. ' data/' ..</div></td>
<td colspan="2" class="diff-empty diff-side-added"></td>
</tr>
<tr>
<td class="diff-marker"><a class="mw-diff-movedpara-left" title="Paragraph was moved. Click to jump to new location." href="#movedpara_16_4_rhs">⚫</a></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><a name="movedpara_11_13_lhs"></a> (args.location3 and args.location3 .. '/' or '') ..</div></td>
<td colspan="2" class="diff-empty diff-side-added"></td>
</tr>
<tr>
<td class="diff-marker"><a class="mw-diff-movedpara-left" title="Paragraph was moved. Click to jump to new location." href="#movedpara_16_5_rhs">⚫</a></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><a name="movedpara_11_14_lhs"></a> (args.location2 and args.location2 .. '/' or '') ..</div></td>
<td colspan="2" class="diff-empty diff-side-added"></td>
</tr>
<tr>
<td class="diff-marker"><a class="mw-diff-movedpara-left" title="Paragraph was moved. Click to jump to new location." href="#movedpara_16_6_rhs">⚫</a></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><a name="movedpara_11_15_lhs"></a> location .. ' medical cases chart'</div></td>
<td colspan="2" class="diff-empty diff-side-added"></td>
</tr>
<tr>
<td class="diff-marker" data-marker="−"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> </div></td>
<td colspan="2" class="diff-empty diff-side-added"></td>
</tr>
<tr>
<td class="diff-marker"><a class="mw-diff-movedpara-left" title="Paragraph was moved. Click to jump to new location." href="#movedpara_28_4_rhs">⚫</a></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><a name="movedpara_11_17_lhs"></a> --<del style="font-weight: bold; text-decoration: none;"> get</del> duration <del style="font-weight: bold; text-decoration: none;">for toggles</del></div></td>
<td colspan="2" class="diff-empty diff-side-added"></td>
</tr>
<tr>
<td class="diff-marker" data-marker="−"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> local duration = 15 -- default if manual togglesbar is last 15 days</div></td>
<td colspan="2" class="diff-empty diff-side-added"></td>
</tr>
<tr>
<td class="diff-marker"><a class="mw-diff-movedpara-left" title="Paragraph was moved. Click to jump to new location." href="#movedpara_28_5_rhs">⚫</a></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><a name="movedpara_11_19_lhs"></a> <del style="font-weight: bold; text-decoration: none;">if</del> yesno(<del style="font-weight: bold; text-decoration: none;">args</del>.collapsible)<del style="font-weight: bold; text-decoration: none;"> == true</del> and<del style="font-weight: bold; text-decoration: none;"> (</del> not <del style="font-weight: bold; text-decoration: none;">is(args</del>.togglesbar<del style="font-weight: bold; text-decoration: none;">) ) then</del></div></td>
<td colspan="2" class="diff-empty diff-side-added"></td>
</tr>
<tr>
<td class="diff-marker" data-marker="−"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> duration = tonumber(args.duration) or 15 -- default if auto togglesbar is last 15 days</div></td>
<td colspan="2" class="diff-empty diff-side-added"></td>
</tr>
<tr>
<td class="diff-marker" data-marker="−"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> end</div></td>
<td colspan="2" class="diff-empty diff-side-added"></td>
</tr>
<tr>
<td class="diff-marker" data-marker="−"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> </div></td>
<td colspan="2" class="diff-empty diff-side-added"></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> local months, togglesbar, lastdate = {{}}, '', nil</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> local months, togglesbar, lastdate = {{}}, '', nil</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> if args.rows then</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> if args.rows then</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> barargs.bars = args.rows</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> barargs.bars = args.rows</div></td>
</tr>
<tr>
<td class="diff-marker" data-marker="−"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> <del style="font-weight: bold; text-decoration: none;">if</del> yesno(args.collapsible) <del style="font-weight: bold; text-decoration: none;">==</del> <del style="font-weight: bold; text-decoration: none;">true</del> <del style="font-weight: bold; text-decoration: none;">then</del></div></td>
<td class="diff-marker" data-marker="+"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> <ins style="font-weight: bold; text-decoration: none;">togglesbar =</ins> yesno(args.collapsible) <ins style="font-weight: bold; text-decoration: none;">and ( args.togglesbar or '' )</ins> <ins style="font-weight: bold; text-decoration: none;">or</ins> <ins style="font-weight: bold; text-decoration: none;">nil</ins></div></td>
</tr>
<tr>
<td class="diff-marker" data-marker="−"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> togglesbar = is(args.togglesbar) and args.togglesbar or ''</div></td>
<td colspan="2" class="diff-empty diff-side-added"></td>
</tr>
<tr>
<td class="diff-marker" data-marker="−"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> end</div></td>
<td colspan="2" class="diff-empty diff-side-added"></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> elseif is(args.data) or is(args.datapage) then</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> elseif is(args.data) or is(args.datapage) then</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> local buildargs = {}</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> local buildargs = {}</div></td>
</tr>
<tr>
<td colspan="2" class="diff-lineno">Line 474:</td>
<td colspan="2" class="diff-lineno">Line 451:</td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> end</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> end</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> </div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> </div></td>
</tr>
<tr>
<td colspan="2" class="diff-empty diff-side-deleted"></td>
<td class="diff-marker"><a class="mw-diff-movedpara-right" title="Paragraph was moved. Click to jump to old location." href="#movedpara_11_9_lhs">⚫</a></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><a name="movedpara_16_0_rhs"></a> local location = mw.ustring.gsub(args.location, 'the ', '')</div></td>
</tr>
<tr>
<td colspan="2" class="diff-empty diff-side-deleted"></td>
<td class="diff-marker"><a class="mw-diff-movedpara-right" title="Paragraph was moved. Click to jump to old location." href="#movedpara_11_10_lhs">⚫</a></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><a name="movedpara_16_1_rhs"></a> location = mw.ustring.upper(mw.ustring.sub(location,1,1)) .. mw.ustring.sub(location,2)</div></td>
</tr>
<tr>
<td colspan="2" class="diff-empty diff-side-deleted"></td>
<td class="diff-marker" data-marker="+"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><br /></td>
</tr>
<tr>
<td colspan="2" class="diff-empty diff-side-deleted"></td>
<td class="diff-marker"><a class="mw-diff-movedpara-right" title="Paragraph was moved. Click to jump to old location." href="#movedpara_11_12_lhs">⚫</a></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><a name="movedpara_16_3_rhs"></a> local navbartitle = args.outbreak .. ' data/' ..</div></td>
</tr>
<tr>
<td colspan="2" class="diff-empty diff-side-deleted"></td>
<td class="diff-marker"><a class="mw-diff-movedpara-right" title="Paragraph was moved. Click to jump to old location." href="#movedpara_11_13_lhs">⚫</a></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><a name="movedpara_16_4_rhs"></a> (args.location3 and args.location3 .. '/' or '') ..</div></td>
</tr>
<tr>
<td colspan="2" class="diff-empty diff-side-deleted"></td>
<td class="diff-marker"><a class="mw-diff-movedpara-right" title="Paragraph was moved. Click to jump to old location." href="#movedpara_11_14_lhs">⚫</a></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><a name="movedpara_16_5_rhs"></a> (args.location2 and args.location2 .. '/' or '') ..</div></td>
</tr>
<tr>
<td colspan="2" class="diff-empty diff-side-deleted"></td>
<td class="diff-marker"><a class="mw-diff-movedpara-right" title="Paragraph was moved. Click to jump to old location." href="#movedpara_11_15_lhs">⚫</a></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><a name="movedpara_16_6_rhs"></a> location .. ' medical cases chart'</div></td>
</tr>
<tr>
<td colspan="2" class="diff-empty diff-side-deleted"></td>
<td class="diff-marker" data-marker="+"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><br /></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> local title = {}</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> local title = {}</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> title[1] = (args.pretitle and args.pretitle .. ' ' or '') ..</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> title[1] = (args.pretitle and args.pretitle .. ' ' or '') ..</div></td>
</tr>
<tr>
<td colspan="2" class="diff-lineno">Line 500:</td>
<td colspan="2" class="diff-lineno">Line 485:</td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> end</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> end</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> title[7] = togglesbar</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> title[7] = togglesbar</div></td>
</tr>
<tr>
<td colspan="2" class="diff-empty diff-side-deleted"></td>
<td class="diff-marker"><a class="mw-diff-movedpara-right" title="Paragraph was moved. Click to jump to old location." href="#movedpara_21_0_lhs">⚫</a></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><a name="movedpara_18_0_rhs"></a> barargs.title = table.concat(title)</div></td>
</tr>
<tr>
<td class="diff-marker" data-marker="−"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> </div></td>
<td colspan="2" class="diff-empty diff-side-added"></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
</tr>
<tr>
<td class="diff-marker"><a class="mw-diff-movedpara-left" title="Paragraph was moved. Click to jump to new location." href="#movedpara_18_0_rhs">⚫</a></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><a name="movedpara_21_0_lhs"></a> barargs.title = table.concat(title)</div></td>
<td colspan="2" class="diff-empty diff-side-added"></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> barargs.left1 =</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> barargs.left1 =</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> '<div class="center" style="width:77px">' .. -- 85-8 because of padding</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> '<div class="center" style="width:77px">' .. -- 85-8 because of padding</div></td>
</tr>
<tr>
<td colspan="2" class="diff-lineno">Line 586:</td>
<td colspan="2" class="diff-lineno">Line 570:</td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> end</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> end</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> </div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> </div></td>
</tr>
<tr>
<td class="diff-marker" data-marker="−"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> -- barwidth</div></td>
<td class="diff-marker" data-marker="+"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> -- barwidth<ins style="font-weight: bold; text-decoration: none;"> and width</ins></div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> local tBarWidthMap = {['thin'] = 120, ['medium'] = 280, ['wide'] = 400, ['auto'] = 'auto'}</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> local tBarWidthMap = {['thin'] = 120, ['medium'] = 280, ['wide'] = 400, ['auto'] = 'auto'}</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> local sBarWidthLower = tRawPams['barwidth'] and mw.ustring.lower(tRawPams['barwidth']) or nil</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> local sBarWidthLower = tRawPams['barwidth'] and mw.ustring.lower(tRawPams['barwidth']) or nil</div></td>
</tr>
<tr>
<td class="diff-marker" data-marker="−"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> tRawPams<del style="font-weight: bold; text-decoration: none;">['</del>barwidth<del style="font-weight: bold; text-decoration: none;">']</del> = tBarWidthMap[sBarWidthLower] or 280</div></td>
<td class="diff-marker" data-marker="+"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> tRawPams<ins style="font-weight: bold; text-decoration: none;">.</ins>barwidth = tBarWidthMap[sBarWidthLower] or 280</div></td>
</tr>
<tr>
<td colspan="2" class="diff-empty diff-side-deleted"></td>
<td class="diff-marker"><a class="mw-diff-movedpara-right" title="Paragraph was moved. Click to jump to old location." href="#movedpara_11_0_lhs">⚫</a></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><a name="movedpara_26_0_rhs"></a> if tonumber(<ins style="font-weight: bold; text-decoration: none;">tRawPams.</ins>barwidth) then</div></td>
</tr>
<tr>
<td colspan="2" class="diff-empty diff-side-deleted"></td>
<td class="diff-marker"><a class="mw-diff-movedpara-right" title="Paragraph was moved. Click to jump to old location." href="#movedpara_11_1_lhs">⚫</a></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><a name="movedpara_26_1_rhs"></a> <ins style="font-weight: bold; text-decoration: none;">tRawPams</ins>.<ins style="font-weight: bold; text-decoration: none;">sTotalWidth</ins> = <ins style="font-weight: bold; text-decoration: none;">(</ins>85 + <ins style="font-weight: bold; text-decoration: none;">tRawPams.</ins>barwidth + numwidth<ins style="font-weight: bold; text-decoration: none;">)</ins> .. 'px'</div></td>
</tr>
<tr>
<td colspan="2" class="diff-empty diff-side-deleted"></td>
<td class="diff-marker"><a class="mw-diff-movedpara-right" title="Paragraph was moved. Click to jump to old location." href="#movedpara_11_2_lhs">⚫</a></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><a name="movedpara_26_2_rhs"></a> <ins style="font-weight: bold; text-decoration: none;">tRawPams</ins>.<ins style="font-weight: bold; text-decoration: none;">sBarWidth</ins> = <ins style="font-weight: bold; text-decoration: none;">tRawPams.</ins>barwidth .. 'px'</div></td>
</tr>
<tr>
<td colspan="2" class="diff-empty diff-side-deleted"></td>
<td class="diff-marker"><a class="mw-diff-movedpara-right" title="Paragraph was moved. Click to jump to old location." href="#movedpara_11_3_lhs">⚫</a></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><a name="movedpara_26_3_rhs"></a> else</div></td>
</tr>
<tr>
<td colspan="2" class="diff-empty diff-side-deleted"></td>
<td class="diff-marker" data-marker="+"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> tRawPams.sTotalWidth = 'auto'</div></td>
</tr>
<tr>
<td colspan="2" class="diff-empty diff-side-deleted"></td>
<td class="diff-marker" data-marker="+"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> tRawPams.sBarWidth = 'auto'</div></td>
</tr>
<tr>
<td colspan="2" class="diff-empty diff-side-deleted"></td>
<td class="diff-marker"><a class="mw-diff-movedpara-right" title="Paragraph was moved. Click to jump to old location." href="#movedpara_11_6_lhs">⚫</a></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><a name="movedpara_26_6_rhs"></a> end</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> -- recoveries, defaults to true for undefined or unrecognised values</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> -- recoveries, defaults to true for undefined or unrecognised values</div></td>
</tr>
<tr>
<td colspan="2" class="diff-lineno">Line 598:</td>
<td colspan="2" class="diff-lineno">Line 589:</td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> tRawPams.changetype1 = tRawPams.changetype1 and mw.ustring.lower(mw.ustring.sub(tRawPams.changetype1, 1, 1)) or sChangeType</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> tRawPams.changetype1 = tRawPams.changetype1 and mw.ustring.lower(mw.ustring.sub(tRawPams.changetype1, 1, 1)) or sChangeType</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> tRawPams.changetype2 = tRawPams.changetype2 and mw.ustring.lower(mw.ustring.sub(tRawPams.changetype2, 1, 1)) or sChangeType</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> tRawPams.changetype2 = tRawPams.changetype2 and mw.ustring.lower(mw.ustring.sub(tRawPams.changetype2, 1, 1)) or sChangeType</div></td>
</tr>
<tr>
<td colspan="2" class="diff-empty diff-side-deleted"></td>
<td class="diff-marker" data-marker="+"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><br /></td>
</tr>
<tr>
<td colspan="2" class="diff-empty diff-side-deleted"></td>
<td class="diff-marker" data-marker="+"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> -- float</div></td>
</tr>
<tr>
<td colspan="2" class="diff-empty diff-side-deleted"></td>
<td class="diff-marker" data-marker="+"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> tRawPams.float = tRawPams.float or 'right'</div></td>
</tr>
<tr>
<td colspan="2" class="diff-empty diff-side-deleted"></td>
<td class="diff-marker" data-marker="+"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><br /></td>
</tr>
<tr>
<td colspan="2" class="diff-empty diff-side-deleted"></td>
<td class="diff-marker"><a class="mw-diff-movedpara-right" title="Paragraph was moved. Click to jump to old location." href="#movedpara_11_17_lhs">⚫</a></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><a name="movedpara_28_4_rhs"></a> -- duration <ins style="font-weight: bold; text-decoration: none;">(togglesbar)</ins></div></td>
</tr>
<tr>
<td colspan="2" class="diff-empty diff-side-deleted"></td>
<td class="diff-marker"><a class="mw-diff-movedpara-right" title="Paragraph was moved. Click to jump to old location." href="#movedpara_11_19_lhs">⚫</a></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><a name="movedpara_28_5_rhs"></a> <ins style="font-weight: bold; text-decoration: none;">local bCanSetDur =</ins> yesno(<ins style="font-weight: bold; text-decoration: none;">tRawPams</ins>.collapsible) and not <ins style="font-weight: bold; text-decoration: none;">tRawPams</ins>.togglesbar</div></td>
</tr>
<tr>
<td colspan="2" class="diff-empty diff-side-deleted"></td>
<td class="diff-marker" data-marker="+"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> tRawPams.nDuration = bCanSetDur and tonumber(tRawPams.duration) or 15</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> --return tRawRows, tChartPams</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> --return tRawRows, tChartPams</div></td>
</tr>
</table>
Kohraa Mondel
https://en.wikipedia.org/w/index.php?title=Module:Medical_cases_chart/sandbox3&diff=996745978&oldid=prev
Kohraa Mondel: sandbox for structural changes
2020-12-28T11:21:27Z
<p>sandbox for structural changes</p>
<p><b>New page</b></p><div>local getArgs = require('Module:Arguments').getArgs<br />
local yesno = require('Module:Yesno')<br />
local barBox = require('Module:Bar box')<br />
<br />
local language = 'en-US' -- local default language<br />
<br />
local i18n = require("Module:Medical cases chart/i18n")[language]<br />
<br />
local function is(v)<br />
return (v or '') ~= ''<br />
end<br />
<br />
local p = {}<br />
<br />
function p._barColors(n)<br />
local colors = {<br />
'#A50026', --deaths<br />
'SkyBlue', --recoveries<br />
'Tomato', --cases or altlbl1<br />
'Gold', --altlbl2<br />
'OrangeRed' --altlbl3<br />
}<br />
<br />
return colors[n]<br />
end<br />
<br />
function p._legend0(args)<br />
return '<span style="font-size:90%; margin:0px">' .. '<span style="' .. 'background-color:' .. (args[1] or 'none') .. '; border:' .. (args.border or 'none') .. '; color:' .. (args[1] or 'none') .. '">' .. '&nbsp;&nbsp;&nbsp;&nbsp;' .. '</span>' .. '&nbsp;' .. (args[2] or '') .. '</span>'<br />
end<br />
<br />
function p._customBarStacked(args)<br />
barargs = {}<br />
barargs[1] = args[1]<br />
<br />
local function _numwidth(nw)<br />
if nw == 'n' then<br />
return 0<br />
elseif nw == 't' then<br />
return 2.45<br />
elseif nw == 'm' then<br />
return 3.5<br />
elseif nw == 'w' then<br />
return 4.55<br />
elseif nw == 'x' then<br />
return 5.6<br />
elseif nw == 'd' then<br />
return 3.5<br />
end<br />
<br />
return 3.5<br />
end<br />
<br />
width1 = 3.5<br />
width2 = 3.5<br />
if is(args.numwidth) then<br />
width1 = _numwidth(mw.ustring.sub(args.numwidth,1,1))<br />
width2 = _numwidth(mw.ustring.sub(args.numwidth,2,2))<br />
width3 = _numwidth(mw.ustring.sub(args.numwidth,3,3))<br />
width4 = _numwidth(mw.ustring.sub(args.numwidth,4,4))<br />
end<br />
<br />
barargs[2] =<br />
'<span class="cbs-ibr" style="padding:0 0.3em 0 0; width:' .. width1 .. 'em">' .. (args[7] or '') .. '</span>' ..<br />
'<span class="cbs-ibl" style="width:' .. width2 .. 'em">' .. (args[8] or '') .. '</span>'<br />
<br />
if mw.ustring.len(args.numwidth) == 4 then<br />
local padding = '0.3em'<br />
if mw.ustring.sub(args.numwidth,3,3) == 'n' then<br />
padding = '0'<br />
end<br />
<br />
barargs.note2 =<br />
'<span class="cbs-ibr" style="padding:0 ' .. padding .. ' 0 0; width:' .. width3 .. 'em">' .. (args[9] or '') .. '</span>' ..<br />
'<span class="cbs-ibl" style="width:' .. width4 .. 'em">' .. (args[10] or '') .. '</span>'<br />
end<br />
<br />
for i=1,5 do<br />
barargs[2*i + 1] = p._barColors(i)<br />
barargs[2*i + 2] = (tonumber(args[i+1]) or 0)/(tonumber(args.divisor) or 1)<br />
barargs['title' .. i] = args[i+1]<br />
end<br />
<br />
barargs.align = 'cdcc'<br />
barargs.collapsed = args.collapsed<br />
barargs.id = args.id<br />
barargs.rowstyle = is(tonumber(args.rowheight)) and ('line-height:'..args.rowheight..';') or nil<br />
<br />
return barBox._stacked(barargs)<br />
end<br />
<br />
function p._row(args)<br />
local barargs = {}<br />
local rowDate = args.prevDate or ''<br />
<br />
if is(args[1]) then<br />
if pcall(function () mw.getContentLanguage():formatDate('', args[1]) end) then<br />
barargs[1] = args[1]<br />
rowDate = args[1]<br />
else<br />
barargs[1] = '<strong class="error">' .. i18n.invalidTime .. '</strong>'<br />
end<br />
else<br />
barargs[1] = '⋮'<br />
end<br />
barargs[1] = barargs[1] .. (args['note0'] or '')<br />
<br />
barargs[2] = args[2] or 0<br />
barargs[3] = args[3] or 0<br />
<br />
if is(args['alttot1']) then<br />
barargs[4] = args['alttot1']<br />
elseif args[4] then<br />
barargs[4] = (tonumber(args[4]) or 0) - (tonumber(barargs[2]) or 0) - (tonumber(barargs[3]) or 0)<br />
else<br />
barargs[4] = 0<br />
end<br />
<br />
barargs[5] = args[5] or 0<br />
<br />
if is(args['alttot2']) then<br />
barargs[6] = args['alttot2']<br />
elseif args[6] then<br />
barargs[6] = (tonumber(args[6]) or 0) - (tonumber(barargs[2]) or 0) - (tonumber(barargs[3]) or 0)<br />
else<br />
barargs[6] = 0<br />
end<br />
<br />
barargs[7] = args[7] or ''<br />
<br />
local function changeArg(firstright, valuecol, changecol)<br />
local change = ''<br />
if yesno(args['firstright' .. firstright]) == true then<br />
change = '(' .. i18n.na .. ')'<br />
elseif yesno(args['firstright' .. firstright]) == false or not is(args['firstright' .. firstright]) then<br />
if not is(args[1]) and is(args[valuecol]) then<br />
change = '(' .. i18n['='] .. ')'<br />
else<br />
change = is(args[changecol]) and '(' .. args[changecol] .. ')' or ''<br />
end<br />
end<br />
change = change .. (args['note' .. firstright] or '')<br />
<br />
return change<br />
end<br />
<br />
barargs[8] = changeArg(1,7,8)<br />
barargs[9] = args[9] or ''<br />
barargs[10] = changeArg(2,9,10)<br />
<br />
barargs.divisor = args.divisor or 1<br />
barargs.numwidth = args.numwidth<br />
barargs.rowheight = args.rowheight<br />
<br />
if yesno(args.collapsible) == true then<br />
local duration = tonumber(args.duration) or 15<br />
if args.collapsed then<br />
barargs.collapsed = args.collapsed<br />
elseif args.rowsToEnd >= duration then<br />
barargs.collapsed = 'y'<br />
else<br />
barargs.collapsed = ''<br />
end<br />
<br />
if args.id then<br />
barargs.id = args.id<br />
elseif args.nooverlap and args.rowsToEnd < duration then<br />
barargs.id = 'l' .. duration<br />
else<br />
barargs.id = mw.ustring.lower(mw.getLanguage('en'):formatDate('M', rowDate))<br />
if args.rowsToEnd < duration then<br />
barargs.id = barargs.id .. '-l' .. duration<br />
end<br />
end<br />
else<br />
barargs.collapsed = ''<br />
barargs.id = ''<br />
end<br />
<br />
return p._customBarStacked(barargs)<br />
end<br />
<br />
function p._buildBars(args)<br />
local lines = mw.text.split(args.data, '\n')<br />
local frame = mw.getCurrentFrame()<br />
local lang = mw.getContentLanguage()<br />
<br />
local bars, rows, months, prevRow, maxparam = {}, {}, {}, '', 1<br />
for k, line in pairs(lines) do<br />
local barargs, i = {}, 1<br />
for parameter in mw.text.gsplit(line, ';') do<br />
parameter = mw.text.trim(parameter)<br />
if string.find(parameter, '^%a') then<br />
parameter = mw.text.split(parameter, '=')<br />
if parameter[1] == 'alttot1' or parameter[1] == 'alttot2' then<br />
parameter[2] = tonumber(frame:callParserFunction('#expr', parameter[2]))<br />
if is(parameter[2]) then<br />
maxparam = math.max(maxparam, parameter[2])<br />
end<br />
end<br />
barargs[parameter[1]] = parameter[2]<br />
else<br />
if is(parameter) then<br />
if i >= 2 and i <= 6 then<br />
parameter = tonumber(frame:callParserFunction('#expr', frame:callParserFunction('formatnum',parameter,'R')))<br />
maxparam = math.max(maxparam, parameter or 1)<br />
end<br />
barargs[i] = parameter<br />
if i == 7 or i == 9 then<br />
parameter = tonumber(mw.ustring.match(frame:callParserFunction('formatnum',parameter,'R'), '^%d*'))<br />
maxparam = math.max(maxparam, parameter or 1)<br />
end<br />
end<br />
i = i + 1<br />
end<br />
end<br />
<br />
local function fillCols(col, change)<br />
local data = args['right' .. col .. 'data']<br />
local changetype = args['changetype' .. col]<br />
local value, num, prevnum<br />
<br />
if data == 'alttot1' then<br />
num = tonumber(barargs.alttot1 or barargs[4])<br />
prevnum = tonumber(prevRow.alttot1 or prevRow[4])<br />
elseif data == 'alttot2' then<br />
num = tonumber(barargs.alttot2 or barargs[6])<br />
prevnum = tonumber(prevRow.alttot2 or prevRow[6])<br />
elseif is(data) then<br />
num = tonumber(barargs[tonumber(data) + 1])<br />
prevnum = tonumber(prevRow[tonumber(data) + 1])<br />
end<br />
<br />
if is(data) and num then -- nothing in column, source found, and data exists<br />
value = changetype == 'o' and '' or lang:formatNum(num) -- set value to num if changetype isn't 'o'<br />
<br />
if not change and yesno(barargs['firstright' .. col] ~= true) then<br />
if prevnum and prevnum ~= 0 then -- data on previous row<br />
if num - prevnum ~= 0 then --data has changed since previous row<br />
change = num-prevnum<br />
if changetype == 'a' then -- change type is "absolute"<br />
if change > 0 then<br />
change = '+' .. lang:formatNum(change)<br />
end<br />
else -- change type is "percent", "only percent" or undefined<br />
local percent = 100 * change / prevnum -- calculate percent<br />
local rounding = math.abs(percent) >= 10 and "%.0f" or math.abs(percent) >= 1 and "%.1f" or "%.2f"<br />
percent = tonumber(mw.ustring.format(rounding, percent)) -- round to two sigfigs<br />
<br />
if percent > 0 then<br />
change = '+' .. lang:formatNum(percent) .. '%'<br />
elseif percent < 0 then<br />
change = lang:formatNum(percent) .. '%'<br />
else<br />
change = i18n['=']<br />
end<br />
end<br />
else -- data has not changed since previous row<br />
change = i18n['=']<br />
end<br />
else -- no data on previous row<br />
barargs['firstright' .. col] = true -- set to (n.a.)<br />
end<br />
end<br />
end<br />
<br />
return value, change<br />
end<br />
<br />
if not is(barargs[7]) then<br />
barargs[7], barargs[8] = fillCols(1, barargs[8])<br />
end<br />
if not is(barargs[9]) then<br />
barargs[9], barargs[10] = fillCols(2, barargs[10])<br />
end<br />
<br />
if is(barargs[1]) then<br />
local e,f,g = pcall(<br />
function ()<br />
return mw.getLanguage('en'):formatDate('M',barargs[1]),<br />
mw.getLanguage('en'):formatDate('j',barargs[1])<br />
end<br />
)<br />
if e then<br />
months[#months+1] = {f,g}<br />
end<br />
end<br />
<br />
barargs.prevDate = prevRow[1]<br />
rows[#rows + 1] = barargs<br />
prevRow = barargs<br />
end<br />
<br />
for i=1,#rows do -- build rows<br />
rows[i].divisor = tonumber(args.divisor) and tonumber(args.divisor) or maxparam / (0.95 * args.barwidth)<br />
rows[i].numwidth = args.numwidth<br />
rows[i].collapsible = args.collapsible<br />
rows[i].rowsToEnd = #rows - i<br />
rows[i].rowheight = args.rowheight<br />
rows[i].duration = args.duration<br />
if #months>(args.duration or 0) then<br />
rows[i].nooverlap = args.nooverlap<br />
end<br />
<br />
bars[i] = p._row(rows[i])<br />
end<br />
<br />
return table.concat(bars), months<br />
end<br />
<br />
function p._monthToggleButton(args)<br />
local month = mw.ustring.lower(mw.ustring.sub(args.month[1] or '',1,3))<br />
local outString = ''<br />
local newline = (args.nonewline or false) and '' or '\n'<br />
if is(month) then<br />
local collapsed = (args.active == '') and '' or ' mw-collapsed'<br />
local uncollapsed = (args.active == '') and ' mw-collapsed' or ''<br />
if args.nooverlap then<br />
outString = '<span class="mw-collapsible mw-customtoggle-' .. month .. ' %s" id="mw-customcollapsible-' .. month .. '" style="padding:0 8px">%s</span>\n' ..<br />
'<span class="mw-collapsible mw-customtoggle-' .. month .. ' %s" id="mw-customcollapsible-' .. month .. '" style="border:2px solid lightblue; padding:0 8px">%s</span>' .. newline<br />
<br />
if mw.ustring.sub(month,1,1) == 'l' and tonumber(mw.ustring.sub(month,2)) == args.duration then<br />
--"Last ## days"<br />
local lastDays = mw.ustring.format(i18n.lastDays, args.duration)<br />
<br />
outString = mw.ustring.format( outString,<br />
collapsed, lastDays,<br />
uncollapsed, lastDays )<br />
else<br />
if i18n.m[month] then<br />
if is(args.month[2]) and is(args.month[3]) then<br />
if (args.month[2] ~= args.month[3]) then -- "Mmm ##–##"<br />
month = mw.ustring.gsub(i18n.toggleRange,'$.', {<br />
['$m'] = i18n.m[month],<br />
['$s'] = args.month[2],<br />
['$e'] = args.month[3]})<br />
else -- "Mmm ##""<br />
month = mw.ustring.gsub(i18n.toggleSingleDate,'$.', {<br />
['$m'] = i18n.m[month],<br />
['$s'] = args.month[2]})<br />
end<br />
else --"Mmm"<br />
month = i18n.m[month]<br />
end<br />
end<br />
<br />
outString = mw.ustring.format( outString,<br />
uncollapsed, month,<br />
collapsed, month )<br />
end<br />
elseif mw.ustring.sub(month,1,1) == 'l' and tonumber(mw.ustring.sub(month,2)) == args.duration then<br />
local customtoggles = {(' mw-customtoggle-l' .. args.duration)}<br />
for k in pairs(i18n.m) do --list of months<br />
customtoggles[#customtoggles + 1] = ' mw-customtoggle-' .. k .. '-l' .. args.duration<br />
end<br />
<br />
local lastDays = mw.ustring.format(i18n.lastDays, args.duration)<br />
<br />
outString = '<span class="mw-collapsible' .. table.concat(customtoggles) .. collapsed .. '" id="mw-customcollapsible-' .. month .. '" style="padding:0 8px">' .. lastDays .. '</span>\n' ..<br />
'<span class="mw-collapsible' .. table.concat(customtoggles) .. uncollapsed .. '" id="mw-customcollapsible-' .. month .. '" style="border:2px solid lightblue; padding:0 8px">' .. lastDays .. '</span>' .. newline<br />
<br />
else<br />
local customtoggles = ' mw-customtoggle-' .. month .. ' mw-customtoggle-' .. month .. '-l' .. args.duration<br />
<br />
outString = '<span class="mw-collapsible' .. customtoggles .. uncollapsed .. '" id="mw-customcollapsible-' .. month .. '" style="padding:0 8px">' .. (i18n.m[month] or month) .. '</span>\n' ..<br />
'<span class="mw-collapsible mw-customtoggle-' .. customtoggles .. collapsed .. '" id="mw-customcollapsible-' .. month .. '" style="border:2px solid lightblue; padding:0 8px">' .. (i18n.m[month] or month) .. '</span>' .. newline<br />
end<br />
end<br />
<br />
return outString<br />
end<br />
<br />
function p._chart(args)<br />
local navbar = require('Module:Navbar')._navbar<br />
<br />
local barargs = {}<br />
<br />
-- mapping and default of numwidth, right1, right2 moved to _getChartPams<br />
local numwidth = args.numwidthwidth<br />
local right1 = args.right1width<br />
local right2 = args.right2width<br />
<br />
-- mapping and default of barwidth moved to _getChartPams<br />
local barwidth = args.barwidth<br />
<br />
if tonumber(barwidth) then<br />
barargs.width = 85 + barwidth + numwidth .. 'px'<br />
barargs.barwidth = barwidth .. 'px'<br />
else<br />
barargs.width = 'auto'<br />
barargs.barwidth = 'auto'<br />
end<br />
<br />
barargs.float = args.float and args.float or 'right'<br />
local location = mw.ustring.gsub(args.location, 'the ', '')<br />
location = mw.ustring.upper(mw.ustring.sub(location,1,1)) .. mw.ustring.sub(location,2)<br />
<br />
local navbartitle = args.outbreak .. ' data/' ..<br />
(args.location3 and args.location3 .. '/' or '') ..<br />
(args.location2 and args.location2 .. '/' or '') ..<br />
location .. ' medical cases chart'<br />
<br />
-- get duration for toggles<br />
local duration = 15 -- default if manual togglesbar is last 15 days<br />
if yesno(args.collapsible) == true and ( not is(args.togglesbar) ) then<br />
duration = tonumber(args.duration) or 15 -- default if auto togglesbar is last 15 days<br />
end<br />
<br />
local months, togglesbar, lastdate = {{}}, '', nil<br />
if args.rows then<br />
barargs.bars = args.rows<br />
if yesno(args.collapsible) == true then<br />
togglesbar = is(args.togglesbar) and args.togglesbar or ''<br />
end<br />
elseif is(args.data) or is(args.datapage) then<br />
local buildargs = {}<br />
<br />
local nooverlap = yesno(args.nooverlap)<br />
<br />
buildargs.barwidth = tonumber(barwidth) or 280<br />
buildargs.data = is(args.datapage) and require('Module:Medical cases chart/data')._externalData(args) or args.data<br />
buildargs.divisor = args.divisor<br />
buildargs.numwidth = args.numwidth<br />
buildargs.collapsible = args.collapsible<br />
buildargs.right1data = args.right1data or -- if no right1data and right1 title is default, use 3rd classification<br />
not args.right1 and 3<br />
buildargs.right2data = args.right2data or -- if no right2data and right2 title is deaths, use 1st classification<br />
(args.right2 == i18n.noOfDeaths or args.right2 == i18n.noOfDeaths2) and 1<br />
--buildargs.changetype1 = mw.ustring.sub(args.changetype1 or (args.changetype or ''),1,1) -- 1st letter<br />
--buildargs.changetype2 = mw.ustring.sub(args.changetype2 or (args.changetype or ''),1,1) -- 1st letter<br />
buildargs.changetype1 = args.changetype1<br />
buildargs.changetype2 = args.changetype2<br />
buildargs.rowheight = args.rowheight<br />
buildargs.duration = duration<br />
if is(args.togglesbar) then<br />
buildargs.nooverlap = false<br />
else<br />
buildargs.nooverlap = nooverlap<br />
end<br />
<br />
barargs.bars, monthList = p._buildBars(buildargs)<br />
<br />
local lastRow = #monthList<br />
if nooverlap == true then<br />
if #monthList <= duration then<br />
nooverlap = false<br />
else<br />
lastRow = #monthList - duration<br />
end<br />
end<br />
<br />
for i=1,(lastRow) do -- deduplicate months<br />
if monthList[i][1] ~= months[#months][1] then --new month<br />
if #months > 1 and i > 1 then<br />
months[#months][3] = monthList[i-1][2] --store end of previous month<br />
end<br />
months[#months+1] = monthList[i] --store start of this month<br />
end<br />
end<br />
months[#months][3] = monthList[lastRow][2] --store end of final month<br />
<br />
-- automatically generate toggles<br />
if yesno(args.collapsible) == true then<br />
if is(args.togglesbar) then<br />
togglesbar = args.togglesbar<br />
else<br />
local toggles = {}<br />
for i=1,#months do<br />
toggles[#toggles+1] = p._monthToggleButton({month=months[i], duration=duration, nooverlap=nooverlap})<br />
end<br />
toggles[#toggles+1] = p._monthToggleButton({month={('l' .. duration)}, duration=duration, nooverlap=nooverlap})<br />
togglesbar = '<div class="nomobile" style="text-align:center">\n' .. table.concat(toggles) .. '</div>'<br />
end<br />
end<br />
end<br />
<br />
local title = {}<br />
title[1] = (args.pretitle and args.pretitle .. ' ' or '') ..<br />
args.disease .. ' ' .. i18n.casesIn .. ' ' .. args.location ..<br />
(args.location2 and ', ' .. args.location2 or '') ..<br />
(args.location3 and ', ' .. args.location3 or '') ..<br />
(args.posttitle and ' ' .. args.posttitle or '') .. '<span class="nowrap">&nbsp;&nbsp;</span>(' ..<br />
navbar({[1] = navbartitle, titleArg = ':' .. mw.getCurrentFrame():getParent():getTitle(), mini = 1, nodiv = 1}) ..<br />
')<br />'<br />
title[2] = p._legend0({[1] = p._barColors(1), [2] = 'Deaths'})<br />
if args.recoveries then<br />
title[3] = '<span class="nowrap">&nbsp;&nbsp;&nbsp;</span>' .. p._legend0({[1] = p._barColors(2), [2] = args.reclbl or i18n.recoveries})<br />
else<br />
title[3] = ''<br />
end<br />
title[4] = '<span class="nowrap">&nbsp;&nbsp;&nbsp;</span>' .. p._legend0({[1] = p._barColors(3), [2] = args.altlbl1 or i18n.activeCases})<br />
if args.altlbl2 then<br />
title[5] = '<span class="nowrap">&nbsp;&nbsp;&nbsp;</span>' .. p._legend0({[1] = p._barColors(4), [2] = args.altlbl2})<br />
else<br />
title[5] = ''<br />
end<br />
if args.altlbl3 then<br />
title[6] = '<span class="nowrap">&nbsp;&nbsp;&nbsp;</span>' .. p._legend0({[1] = p._barColors(5), [2] = args.altlbl3}) ..'\n'<br />
else<br />
title[6] = '\n'<br />
end<br />
title[7] = togglesbar<br />
<br />
<br />
barargs.title = table.concat(title)<br />
barargs.left1 =<br />
'<div class="center" style="width:77px">' .. -- 85-8 because of padding<br />
"'''" .. i18n.date .. "'''" ..<br />
'</div>'<br />
<br />
barargs.right1 =<br />
'<div class="center" style="width:' .. right1 .. 'px">' ..<br />
"'''" .. (args.right1 or i18n.noOfCases) .. "'''" ..<br />
'</div>'<br />
<br />
if args.right2 then<br />
barargs.right2 =<br />
'<div class="center" style="width:' .. right2 ..'px">' ..<br />
"'''" .. args.right2 .. "'''" ..<br />
'</div>'<br />
end<br />
<br />
barargs.caption = args.caption<br />
barargs.css = 'Template:Medical_cases_chart/styles.css'<br />
return barBox._box(barargs)<br />
end<br />
<br />
function p.chart(frame)<br />
local tRawPams = getArgs(frame)<br />
<br />
local tChartPams = p._getChartPams(tRawPams)<br />
--local tRawRows, tChartPams = p._getChartPams(tRawPams)<br />
--local tBoxPams = p._getBoxPams(tRawPams)<br />
<br />
--tBoxPams.bars = p._getDataRows(tRawRows, tChartPams)<br />
<br />
--return barBox._box(tBoxPams)<br />
<br />
return p._chart(tChartPams)<br />
end<br />
<br />
<br />
function p._getChartPams(tRawPams)<br />
--local tRawRows = tRawPams.data<br />
<br />
--local tChartPams = {}<br />
<br />
-- numwidth<br />
local sNumwidthLower = tRawPams.numwidth and mw.ustring.lower(tRawPams.numwidth) or nil<br />
local tNumWidthMap = {['n'] = 0, ['t'] = 40, ['m'] = 55, ['w'] = 70, ['x'] = 85, ['d'] = 55}<br />
local function _numwidth(p)<br />
local nw = mw.ustring.sub(sNumwidthLower or '',p,p)<br />
return tNumWidthMap[nw] or 0<br />
end<br />
local numwidth = 120<br />
local right1 = numwidth - 8 -- -8 because of padding<br />
if sNumwidthLower then<br />
numwidth = _numwidth(1) + 10 + _numwidth(2)<br />
if mw.ustring.len(sNumwidthLower) == 4 then<br />
numwidth = numwidth + _numwidth(3) + _numwidth(4)<br />
if mw.ustring.sub(sNumwidthLower,3,3) == 'n' then<br />
numwidth = numwidth + 6<br />
else<br />
numwidth = numwidth + 10<br />
end<br />
end<br />
right1 = _numwidth(1) + 2 + _numwidth(2)<br />
if not tRawPams.right2 and mw.ustring.len(sNumwidthLower) == 4 then<br />
right1 = right1 + _numwidth(3) + _numwidth(4)<br />
if mw.ustring.sub(sNumwidthLower,3,3) == 'n' then<br />
numwidth = numwidth + 6<br />
else<br />
numwidth = numwidth + 10<br />
end<br />
end<br />
end<br />
tRawPams.numwidthwidth = numwidth<br />
tRawPams.right1width = right1<br />
if tRawPams.right2 then<br />
local right2 = _numwidth(3) + _numwidth(4)<br />
if mw.ustring.sub(tRawPams.numwidth,3,3) == 'n' then<br />
right2 = right2 - 2<br />
else<br />
right2 = right2 + 2<br />
end<br />
tRawPams.right2width = right2<br />
end<br />
<br />
-- barwidth<br />
local tBarWidthMap = {['thin'] = 120, ['medium'] = 280, ['wide'] = 400, ['auto'] = 'auto'}<br />
local sBarWidthLower = tRawPams['barwidth'] and mw.ustring.lower(tRawPams['barwidth']) or nil<br />
tRawPams['barwidth'] = tBarWidthMap[sBarWidthLower] or 280<br />
<br />
-- recoveries, defaults to true for undefined or unrecognised values<br />
tRawPams.recoveries = not (yesno(tRawPams.recoveries) == false)<br />
<br />
-- changetype[|1|2]<br />
local sChangeType = tRawPams.changetype and mw.ustring.lower(mw.ustring.sub(tRawPams.changetype, 1, 1)) or ''<br />
tRawPams.changetype1 = tRawPams.changetype1 and mw.ustring.lower(mw.ustring.sub(tRawPams.changetype1, 1, 1)) or sChangeType<br />
tRawPams.changetype2 = tRawPams.changetype2 and mw.ustring.lower(mw.ustring.sub(tRawPams.changetype2, 1, 1)) or sChangeType<br />
<br />
--return tRawRows, tChartPams<br />
return tRawPams<br />
end<br />
<br />
<br />
function p.barColors(frame)<br />
return p._barColors(tonumber(frame:getParent().args[1]))<br />
end<br />
<br />
function p.buildBars(frame)<br />
local bars = p._buildBars(frame.args)<br />
return bars<br />
end<br />
<br />
function p.monthToggleButton(frame)<br />
local args = {}<br />
args.month = {frame:getParent().args.month or frame:getParent().args[1] or 'l15'}<br />
args.active = frame:getParent().args.active or 'true'<br />
args.duration = frame:getParent().args.duration or 15<br />
args.nonewline = true<br />
return p._monthToggleButton(args)<br />
end<br />
<br />
return p</div>
Kohraa Mondel