မေႃႇၵျူး:Medical cases chart
Appearance
ၽိုၼ်ၵႅမ်မိုဝ်းမေႃႇၵျူး[သၢင်ႈ]
တွၼ်ႈတႃႇ Scribunto module ဢၼ်ၼႆႉ ၸဝ်ႈၵဝ်ႇ ၸၢင်ႈ သၢင်ႈ ၼႃႈလိၵ်ႈ ၼႆႉလႆႈယူႇၶႃႈ။ ၽူႈၸိူဝ်းမႄးထတ်းၶဝ် ၸၢင်ႈၸၢမ်းတူၺ်းလႆႈ ၸိူဝ်းပဵၼ်ၼႃႈလိၵ်ႈ sandbox (သၢင်ႈ | ငဝ်းမိူၼ်) လႄႈ testcases (သၢင်ႈ) ႁင်း မေႃႇၵျူးဢၼ်ၼႆႉ လႆႈယူႇၶႃႈ။ သႂ်ႇပိူင်ထၢၼ်ႈ ၵႃႈတီႈ ၼႃႈလိၵ်ႈၽႄ /doc လႄႈ။ ၼႃႈလိၵ်ႈၽႄ ႁင်း မေႃႇၵျူး ဢၼ်ၼႆႉ။. |
local p = {}
function p.buildBars( frame )
local barwidth = frame.args.barwidth
local data = frame.args.data
local divisor = frame.args.divisor
local numwidth = frame.args.numwidth
local collapsible = frame.args.collapsible
local lines = mw.text.split( data, '\n' )
local i = 1
if divisor == '' then
local total1, total2 = 0, 0
for parameter in mw.text.gsplit( lines[#lines], ';' ) do
if not string.find( parameter, '^ *%a' ) then
if i == 7 then
total1 = tonumber( (string.gsub( parameter, '%D', '' )) )
if not total1 then
total1 = 0
end
elseif i == 9 then
total2 = tonumber( (string.gsub( parameter, '%D', '' )) )
if not total2 then
total2 = 0
end
break
end
i = i + 1
end
end
divisor = math.max( total1, total2 ) / ( 0.95 * barwidth )
end
local bars = ''
local args
for k, line in pairs( lines ) do
args, i = {}, 1
for parameter in mw.text.gsplit( line, ';' ) do
if string.find( parameter, '^ *%a' ) then
parameter = mw.text.split( parameter, '=' )
args[parameter[1]] = parameter[2]
else
args[i] = parameter
i = i + 1
end
end
args['divisor'] = divisor
args['numwidth'] = numwidth
args['collapsible'] = collapsible
bars = bars .. frame:expandTemplate{ title = 'Medical cases chart/Row', args = args }
end
return bars
end
return p