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">&#x26AB;</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">&#x26AB;</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">&#x26AB;</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">&#x26AB;</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">&#x26AB;</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">&#x26AB;</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">&#x26AB;</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">&#x26AB;</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">&#x26AB;</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">&#x26AB;</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">&#x26AB;</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">&#x26AB;</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">&#x26AB;</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">&#x26AB;</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">&#x26AB;</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">&#x26AB;</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">&#x26AB;</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">&#x26AB;</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">&#x26AB;</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">&#x26AB;</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">&#x26AB;</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">&#x26AB;</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">&#x26AB;</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">&#x26AB;</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">&#x26AB;</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">&#x26AB;</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">&#x26AB;</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">&#x26AB;</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> '&lt;div class="center" style="width:77px"&gt;' .. -- 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> '&lt;div class="center" style="width:77px"&gt;' .. -- 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">&#x26AB;</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">&#x26AB;</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">&#x26AB;</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">&#x26AB;</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">&#x26AB;</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">&#x26AB;</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">&#x26AB;</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(&#039;Module:Arguments&#039;).getArgs<br /> local yesno = require(&#039;Module:Yesno&#039;)<br /> local barBox = require(&#039;Module:Bar box&#039;)<br /> <br /> local language = &#039;en-US&#039; -- local default language<br /> <br /> local i18n = require(&quot;Module:Medical cases chart/i18n&quot;)[language]<br /> <br /> local function is(v)<br /> return (v or &#039;&#039;) ~= &#039;&#039;<br /> end<br /> <br /> local p = {}<br /> <br /> function p._barColors(n)<br /> local colors = {<br /> &#039;#A50026&#039;, --deaths<br /> &#039;SkyBlue&#039;, --recoveries<br /> &#039;Tomato&#039;, --cases or altlbl1<br /> &#039;Gold&#039;, --altlbl2<br /> &#039;OrangeRed&#039; --altlbl3<br /> }<br /> <br /> return colors[n]<br /> end<br /> <br /> function p._legend0(args)<br /> return &#039;&lt;span style=&quot;font-size:90%; margin:0px&quot;&gt;&#039; .. &#039;&lt;span style=&quot;&#039; .. &#039;background-color:&#039; .. (args[1] or &#039;none&#039;) .. &#039;; border:&#039; .. (args.border or &#039;none&#039;) .. &#039;; color:&#039; .. (args[1] or &#039;none&#039;) .. &#039;&quot;&gt;&#039; .. &#039;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&#039; .. &#039;&lt;/span&gt;&#039; .. &#039;&amp;nbsp;&#039; .. (args[2] or &#039;&#039;) .. &#039;&lt;/span&gt;&#039;<br /> end<br /> <br /> function p._customBarStacked(args)<br /> barargs = {}<br /> barargs[1] = args[1]<br /> <br /> local function _numwidth(nw)<br /> if nw == &#039;n&#039; then<br /> return 0<br /> elseif nw == &#039;t&#039; then<br /> return 2.45<br /> elseif nw == &#039;m&#039; then<br /> return 3.5<br /> elseif nw == &#039;w&#039; then<br /> return 4.55<br /> elseif nw == &#039;x&#039; then<br /> return 5.6<br /> elseif nw == &#039;d&#039; 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 /> &#039;&lt;span class=&quot;cbs-ibr&quot; style=&quot;padding:0 0.3em 0 0; width:&#039; .. width1 .. &#039;em&quot;&gt;&#039; .. (args[7] or &#039;&#039;) .. &#039;&lt;/span&gt;&#039; ..<br /> &#039;&lt;span class=&quot;cbs-ibl&quot; style=&quot;width:&#039; .. width2 .. &#039;em&quot;&gt;&#039; .. (args[8] or &#039;&#039;) .. &#039;&lt;/span&gt;&#039;<br /> <br /> if mw.ustring.len(args.numwidth) == 4 then<br /> local padding = &#039;0.3em&#039;<br /> if mw.ustring.sub(args.numwidth,3,3) == &#039;n&#039; then<br /> padding = &#039;0&#039;<br /> end<br /> <br /> barargs.note2 =<br /> &#039;&lt;span class=&quot;cbs-ibr&quot; style=&quot;padding:0 &#039; .. padding .. &#039; 0 0; width:&#039; .. width3 .. &#039;em&quot;&gt;&#039; .. (args[9] or &#039;&#039;) .. &#039;&lt;/span&gt;&#039; ..<br /> &#039;&lt;span class=&quot;cbs-ibl&quot; style=&quot;width:&#039; .. width4 .. &#039;em&quot;&gt;&#039; .. (args[10] or &#039;&#039;) .. &#039;&lt;/span&gt;&#039;<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[&#039;title&#039; .. i] = args[i+1]<br /> end<br /> <br /> barargs.align = &#039;cdcc&#039;<br /> barargs.collapsed = args.collapsed<br /> barargs.id = args.id<br /> barargs.rowstyle = is(tonumber(args.rowheight)) and (&#039;line-height:&#039;..args.rowheight..&#039;;&#039;) 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 &#039;&#039;<br /> <br /> if is(args[1]) then<br /> if pcall(function () mw.getContentLanguage():formatDate(&#039;&#039;, args[1]) end) then<br /> barargs[1] = args[1]<br /> rowDate = args[1]<br /> else<br /> barargs[1] = &#039;&lt;strong class=&quot;error&quot;&gt;&#039; .. i18n.invalidTime .. &#039;&lt;/strong&gt;&#039;<br /> end<br /> else<br /> barargs[1] = &#039;⋮&#039;<br /> end<br /> barargs[1] = barargs[1] .. (args[&#039;note0&#039;] or &#039;&#039;)<br /> <br /> barargs[2] = args[2] or 0<br /> barargs[3] = args[3] or 0<br /> <br /> if is(args[&#039;alttot1&#039;]) then<br /> barargs[4] = args[&#039;alttot1&#039;]<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[&#039;alttot2&#039;]) then<br /> barargs[6] = args[&#039;alttot2&#039;]<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 &#039;&#039;<br /> <br /> local function changeArg(firstright, valuecol, changecol)<br /> local change = &#039;&#039;<br /> if yesno(args[&#039;firstright&#039; .. firstright]) == true then<br /> change = &#039;(&#039; .. i18n.na .. &#039;)&#039;<br /> elseif yesno(args[&#039;firstright&#039; .. firstright]) == false or not is(args[&#039;firstright&#039; .. firstright]) then<br /> if not is(args[1]) and is(args[valuecol]) then<br /> change = &#039;(&#039; .. i18n[&#039;=&#039;] .. &#039;)&#039;<br /> else<br /> change = is(args[changecol]) and &#039;(&#039; .. args[changecol] .. &#039;)&#039; or &#039;&#039;<br /> end<br /> end<br /> change = change .. (args[&#039;note&#039; .. firstright] or &#039;&#039;)<br /> <br /> return change<br /> end<br /> <br /> barargs[8] = changeArg(1,7,8)<br /> barargs[9] = args[9] or &#039;&#039;<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 &gt;= duration then<br /> barargs.collapsed = &#039;y&#039;<br /> else<br /> barargs.collapsed = &#039;&#039;<br /> end<br /> <br /> if args.id then<br /> barargs.id = args.id<br /> elseif args.nooverlap and args.rowsToEnd &lt; duration then<br /> barargs.id = &#039;l&#039; .. duration<br /> else<br /> barargs.id = mw.ustring.lower(mw.getLanguage(&#039;en&#039;):formatDate(&#039;M&#039;, rowDate))<br /> if args.rowsToEnd &lt; duration then<br /> barargs.id = barargs.id .. &#039;-l&#039; .. duration<br /> end<br /> end<br /> else<br /> barargs.collapsed = &#039;&#039;<br /> barargs.id = &#039;&#039;<br /> end<br /> <br /> return p._customBarStacked(barargs)<br /> end<br /> <br /> function p._buildBars(args)<br /> local lines = mw.text.split(args.data, &#039;\n&#039;)<br /> local frame = mw.getCurrentFrame()<br /> local lang = mw.getContentLanguage()<br /> <br /> local bars, rows, months, prevRow, maxparam = {}, {}, {}, &#039;&#039;, 1<br /> for k, line in pairs(lines) do<br /> local barargs, i = {}, 1<br /> for parameter in mw.text.gsplit(line, &#039;;&#039;) do<br /> parameter = mw.text.trim(parameter)<br /> if string.find(parameter, &#039;^%a&#039;) then<br /> parameter = mw.text.split(parameter, &#039;=&#039;)<br /> if parameter[1] == &#039;alttot1&#039; or parameter[1] == &#039;alttot2&#039; then<br /> parameter[2] = tonumber(frame:callParserFunction(&#039;#expr&#039;, 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 &gt;= 2 and i &lt;= 6 then<br /> parameter = tonumber(frame:callParserFunction(&#039;#expr&#039;, frame:callParserFunction(&#039;formatnum&#039;,parameter,&#039;R&#039;)))<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(&#039;formatnum&#039;,parameter,&#039;R&#039;), &#039;^%d*&#039;))<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[&#039;right&#039; .. col .. &#039;data&#039;]<br /> local changetype = args[&#039;changetype&#039; .. col]<br /> local value, num, prevnum<br /> <br /> if data == &#039;alttot1&#039; then<br /> num = tonumber(barargs.alttot1 or barargs[4])<br /> prevnum = tonumber(prevRow.alttot1 or prevRow[4])<br /> elseif data == &#039;alttot2&#039; 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 == &#039;o&#039; and &#039;&#039; or lang:formatNum(num) -- set value to num if changetype isn&#039;t &#039;o&#039;<br /> <br /> if not change and yesno(barargs[&#039;firstright&#039; .. 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 == &#039;a&#039; then -- change type is &quot;absolute&quot;<br /> if change &gt; 0 then<br /> change = &#039;+&#039; .. lang:formatNum(change)<br /> end<br /> else -- change type is &quot;percent&quot;, &quot;only percent&quot; or undefined<br /> local percent = 100 * change / prevnum -- calculate percent<br /> local rounding = math.abs(percent) &gt;= 10 and &quot;%.0f&quot; or math.abs(percent) &gt;= 1 and &quot;%.1f&quot; or &quot;%.2f&quot;<br /> percent = tonumber(mw.ustring.format(rounding, percent)) -- round to two sigfigs<br /> <br /> if percent &gt; 0 then<br /> change = &#039;+&#039; .. lang:formatNum(percent) .. &#039;%&#039;<br /> elseif percent &lt; 0 then<br /> change = lang:formatNum(percent) .. &#039;%&#039;<br /> else<br /> change = i18n[&#039;=&#039;]<br /> end<br /> end<br /> else -- data has not changed since previous row<br /> change = i18n[&#039;=&#039;]<br /> end<br /> else -- no data on previous row<br /> barargs[&#039;firstright&#039; .. 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(&#039;en&#039;):formatDate(&#039;M&#039;,barargs[1]),<br /> mw.getLanguage(&#039;en&#039;):formatDate(&#039;j&#039;,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&gt;(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 &#039;&#039;,1,3))<br /> local outString = &#039;&#039;<br /> local newline = (args.nonewline or false) and &#039;&#039; or &#039;\n&#039;<br /> if is(month) then<br /> local collapsed = (args.active == &#039;&#039;) and &#039;&#039; or &#039; mw-collapsed&#039;<br /> local uncollapsed = (args.active == &#039;&#039;) and &#039; mw-collapsed&#039; or &#039;&#039;<br /> if args.nooverlap then<br /> outString = &#039;&lt;span class=&quot;mw-collapsible mw-customtoggle-&#039; .. month .. &#039; %s&quot; id=&quot;mw-customcollapsible-&#039; .. month .. &#039;&quot; style=&quot;padding:0 8px&quot;&gt;%s&lt;/span&gt;\n&#039; ..<br /> &#039;&lt;span class=&quot;mw-collapsible mw-customtoggle-&#039; .. month .. &#039; %s&quot; id=&quot;mw-customcollapsible-&#039; .. month .. &#039;&quot; style=&quot;border:2px solid lightblue; padding:0 8px&quot;&gt;%s&lt;/span&gt;&#039; .. newline<br /> <br /> if mw.ustring.sub(month,1,1) == &#039;l&#039; and tonumber(mw.ustring.sub(month,2)) == args.duration then<br /> --&quot;Last ## days&quot;<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 -- &quot;Mmm ##–##&quot;<br /> month = mw.ustring.gsub(i18n.toggleRange,&#039;$.&#039;, {<br /> [&#039;$m&#039;] = i18n.m[month],<br /> [&#039;$s&#039;] = args.month[2],<br /> [&#039;$e&#039;] = args.month[3]})<br /> else -- &quot;Mmm ##&quot;&quot;<br /> month = mw.ustring.gsub(i18n.toggleSingleDate,&#039;$.&#039;, {<br /> [&#039;$m&#039;] = i18n.m[month],<br /> [&#039;$s&#039;] = args.month[2]})<br /> end<br /> else --&quot;Mmm&quot;<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) == &#039;l&#039; and tonumber(mw.ustring.sub(month,2)) == args.duration then<br /> local customtoggles = {(&#039; mw-customtoggle-l&#039; .. args.duration)}<br /> for k in pairs(i18n.m) do --list of months<br /> customtoggles[#customtoggles + 1] = &#039; mw-customtoggle-&#039; .. k .. &#039;-l&#039; .. args.duration<br /> end<br /> <br /> local lastDays = mw.ustring.format(i18n.lastDays, args.duration)<br /> <br /> outString = &#039;&lt;span class=&quot;mw-collapsible&#039; .. table.concat(customtoggles) .. collapsed .. &#039;&quot; id=&quot;mw-customcollapsible-&#039; .. month .. &#039;&quot; style=&quot;padding:0 8px&quot;&gt;&#039; .. lastDays .. &#039;&lt;/span&gt;\n&#039; ..<br /> &#039;&lt;span class=&quot;mw-collapsible&#039; .. table.concat(customtoggles) .. uncollapsed .. &#039;&quot; id=&quot;mw-customcollapsible-&#039; .. month .. &#039;&quot; style=&quot;border:2px solid lightblue; padding:0 8px&quot;&gt;&#039; .. lastDays .. &#039;&lt;/span&gt;&#039; .. newline<br /> <br /> else<br /> local customtoggles = &#039; mw-customtoggle-&#039; .. month .. &#039; mw-customtoggle-&#039; .. month .. &#039;-l&#039; .. args.duration<br /> <br /> outString = &#039;&lt;span class=&quot;mw-collapsible&#039; .. customtoggles .. uncollapsed .. &#039;&quot; id=&quot;mw-customcollapsible-&#039; .. month .. &#039;&quot; style=&quot;padding:0 8px&quot;&gt;&#039; .. (i18n.m[month] or month) .. &#039;&lt;/span&gt;\n&#039; ..<br /> &#039;&lt;span class=&quot;mw-collapsible mw-customtoggle-&#039; .. customtoggles .. collapsed .. &#039;&quot; id=&quot;mw-customcollapsible-&#039; .. month .. &#039;&quot; style=&quot;border:2px solid lightblue; padding:0 8px&quot;&gt;&#039; .. (i18n.m[month] or month) .. &#039;&lt;/span&gt;&#039; .. newline<br /> end<br /> end<br /> <br /> return outString<br /> end<br /> <br /> function p._chart(args)<br /> local navbar = require(&#039;Module:Navbar&#039;)._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 .. &#039;px&#039;<br /> barargs.barwidth = barwidth .. &#039;px&#039;<br /> else<br /> barargs.width = &#039;auto&#039;<br /> barargs.barwidth = &#039;auto&#039;<br /> end<br /> <br /> barargs.float = args.float and args.float or &#039;right&#039;<br /> local location = mw.ustring.gsub(args.location, &#039;the &#039;, &#039;&#039;)<br /> location = mw.ustring.upper(mw.ustring.sub(location,1,1)) .. mw.ustring.sub(location,2)<br /> <br /> local navbartitle = args.outbreak .. &#039; data/&#039; ..<br /> (args.location3 and args.location3 .. &#039;/&#039; or &#039;&#039;) ..<br /> (args.location2 and args.location2 .. &#039;/&#039; or &#039;&#039;) ..<br /> location .. &#039; medical cases chart&#039;<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 = {{}}, &#039;&#039;, 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 &#039;&#039;<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(&#039;Module:Medical cases chart/data&#039;)._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 &#039;&#039;),1,1) -- 1st letter<br /> --buildargs.changetype2 = mw.ustring.sub(args.changetype2 or (args.changetype or &#039;&#039;),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 &lt;= 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 &gt; 1 and i &gt; 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={(&#039;l&#039; .. duration)}, duration=duration, nooverlap=nooverlap})<br /> togglesbar = &#039;&lt;div class=&quot;nomobile&quot; style=&quot;text-align:center&quot;&gt;\n&#039; .. table.concat(toggles) .. &#039;&lt;/div&gt;&#039;<br /> end<br /> end<br /> end<br /> <br /> local title = {}<br /> title[1] = (args.pretitle and args.pretitle .. &#039; &#039; or &#039;&#039;) ..<br /> args.disease .. &#039; &#039; .. i18n.casesIn .. &#039; &#039; .. args.location ..<br /> (args.location2 and &#039;, &#039; .. args.location2 or &#039;&#039;) ..<br /> (args.location3 and &#039;, &#039; .. args.location3 or &#039;&#039;) ..<br /> (args.posttitle and &#039; &#039; .. args.posttitle or &#039;&#039;) .. &#039;&lt;span class=&quot;nowrap&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;(&#039; ..<br /> navbar({[1] = navbartitle, titleArg = &#039;:&#039; .. mw.getCurrentFrame():getParent():getTitle(), mini = 1, nodiv = 1}) ..<br /> &#039;)&lt;br /&gt;&#039;<br /> title[2] = p._legend0({[1] = p._barColors(1), [2] = &#039;Deaths&#039;})<br /> if args.recoveries then<br /> title[3] = &#039;&lt;span class=&quot;nowrap&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&#039; .. p._legend0({[1] = p._barColors(2), [2] = args.reclbl or i18n.recoveries})<br /> else<br /> title[3] = &#039;&#039;<br /> end<br /> title[4] = &#039;&lt;span class=&quot;nowrap&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&#039; .. p._legend0({[1] = p._barColors(3), [2] = args.altlbl1 or i18n.activeCases})<br /> if args.altlbl2 then<br /> title[5] = &#039;&lt;span class=&quot;nowrap&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&#039; .. p._legend0({[1] = p._barColors(4), [2] = args.altlbl2})<br /> else<br /> title[5] = &#039;&#039;<br /> end<br /> if args.altlbl3 then<br /> title[6] = &#039;&lt;span class=&quot;nowrap&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&#039; .. p._legend0({[1] = p._barColors(5), [2] = args.altlbl3}) ..&#039;\n&#039;<br /> else<br /> title[6] = &#039;\n&#039;<br /> end<br /> title[7] = togglesbar<br /> <br /> <br /> barargs.title = table.concat(title)<br /> barargs.left1 =<br /> &#039;&lt;div class=&quot;center&quot; style=&quot;width:77px&quot;&gt;&#039; .. -- 85-8 because of padding<br /> &quot;&#039;&#039;&#039;&quot; .. i18n.date .. &quot;&#039;&#039;&#039;&quot; ..<br /> &#039;&lt;/div&gt;&#039;<br /> <br /> barargs.right1 =<br /> &#039;&lt;div class=&quot;center&quot; style=&quot;width:&#039; .. right1 .. &#039;px&quot;&gt;&#039; ..<br /> &quot;&#039;&#039;&#039;&quot; .. (args.right1 or i18n.noOfCases) .. &quot;&#039;&#039;&#039;&quot; ..<br /> &#039;&lt;/div&gt;&#039;<br /> <br /> if args.right2 then<br /> barargs.right2 =<br /> &#039;&lt;div class=&quot;center&quot; style=&quot;width:&#039; .. right2 ..&#039;px&quot;&gt;&#039; ..<br /> &quot;&#039;&#039;&#039;&quot; .. args.right2 .. &quot;&#039;&#039;&#039;&quot; ..<br /> &#039;&lt;/div&gt;&#039;<br /> end<br /> <br /> barargs.caption = args.caption<br /> barargs.css = &#039;Template:Medical_cases_chart/styles.css&#039;<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 = {[&#039;n&#039;] = 0, [&#039;t&#039;] = 40, [&#039;m&#039;] = 55, [&#039;w&#039;] = 70, [&#039;x&#039;] = 85, [&#039;d&#039;] = 55}<br /> local function _numwidth(p)<br /> local nw = mw.ustring.sub(sNumwidthLower or &#039;&#039;,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) == &#039;n&#039; 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) == &#039;n&#039; 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) == &#039;n&#039; 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 = {[&#039;thin&#039;] = 120, [&#039;medium&#039;] = 280, [&#039;wide&#039;] = 400, [&#039;auto&#039;] = &#039;auto&#039;}<br /> local sBarWidthLower = tRawPams[&#039;barwidth&#039;] and mw.ustring.lower(tRawPams[&#039;barwidth&#039;]) or nil<br /> tRawPams[&#039;barwidth&#039;] = 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 &#039;&#039;<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 &#039;l15&#039;}<br /> args.active = frame:getParent().args.active or &#039;true&#039;<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