<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>https://stockhub.co/index.php?action=history&amp;feed=atom&amp;title=Module%3AImportProtein</id>
	<title>Module:ImportProtein - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://stockhub.co/index.php?action=history&amp;feed=atom&amp;title=Module%3AImportProtein"/>
	<link rel="alternate" type="text/html" href="https://stockhub.co/index.php?title=Module:ImportProtein&amp;action=history"/>
	<updated>2026-04-09T09:49:50Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.5</generator>
	<entry>
		<id>https://stockhub.co/index.php?title=Module:ImportProtein&amp;diff=136871&amp;oldid=prev</id>
		<title>imported&gt;Jonesey95: div for multi-line legend</title>
		<link rel="alternate" type="text/html" href="https://stockhub.co/index.php?title=Module:ImportProtein&amp;diff=136871&amp;oldid=prev"/>
		<updated>2021-10-02T19:55:46Z</updated>

		<summary type="html">&lt;p&gt;div for multi-line legend&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;local p = {}&lt;br /&gt;
&lt;br /&gt;
function p.main (frame)&lt;br /&gt;
    ---- Set up the initial frame parameters&lt;br /&gt;
   local debuglog=&amp;quot;|}|}&amp;quot;&lt;br /&gt;
   local args=frame.args&lt;br /&gt;
   local parent=frame.getParent(frame)&lt;br /&gt;
   local pargs={}&lt;br /&gt;
   if parent then pargs=parent.args end&lt;br /&gt;
   local height=args.height or pargs.height or &amp;quot;50&amp;quot;&lt;br /&gt;
   local width=args.width or pargs.width or &amp;quot;600&amp;quot;&lt;br /&gt;
   local background=args.background or pargs.background or &amp;quot;#333333&amp;quot;&lt;br /&gt;
   local vtext=args.vtext or pargs.vtext or 25 -- characters of legend text to display vertically down from motifs&lt;br /&gt;
   local largeonlyregion=args.largeonlyregion or pargs.largeonlyregion or 20&lt;br /&gt;
   local vtext=tonumber(vtext) -- no meaning except as a number&lt;br /&gt;
   local tableoutput=args.tableoutput or pargs.tableoutput or &amp;quot;mw-collapsed&amp;quot; -- I&amp;#039;ve decided to use the table as the legend much of the time after all, I think.  (previously defaulted to &amp;quot;nil&amp;quot; to suppress)&lt;br /&gt;
   if tableoutput==&amp;quot;no&amp;quot; then tableoutput=nil end&lt;br /&gt;
   local vwidth=args.vwidth or pargs.vwidth or 4 -- number of PIXELS to tag as not overwriteable with vertical text.&lt;br /&gt;
   local vclaim={} --- if vclaim[pixel] is true, that pixel is taken&lt;br /&gt;
   local vprotest=&amp;#039;&amp;#039; --- list of positions not shown separated by spaces&lt;br /&gt;
   local nowiki=args.nowiki or pargs.nowiki&lt;br /&gt;
   &lt;br /&gt;
    ---- These parameters send text that needs to be processed into tables&lt;br /&gt;
    ---- include is nil to include everything.  If it exists then only what is in it is used.&lt;br /&gt;
    ---- format is &amp;quot;I want only this&amp;quot; (any junk) &amp;quot;and this&amp;quot; etc.  Note weakness - a stray quote would foul up the whole template.&lt;br /&gt;
   local include=args.include or pargs.include or &amp;quot;all&amp;quot;&lt;br /&gt;
   if include == &amp;quot;all&amp;quot; then include = nil end&lt;br /&gt;
   local tinclude={}&lt;br /&gt;
   if include then&lt;br /&gt;
      for i in mw.ustring.gmatch(include,[[%&amp;quot;(.-)%&amp;quot;]]) do&lt;br /&gt;
         tinclude[i]=1&lt;br /&gt;
      end&lt;br /&gt;
   end&lt;br /&gt;
    ---- replaceregion defines a section with too many features to note individually.&lt;br /&gt;
    ---- Instead you group them with a new text.&lt;br /&gt;
    ---- The format is xx..yy:&amp;quot;Use this text&amp;quot;&lt;br /&gt;
   local replaceregion=args.replaceregion or pargs.replaceregion or &amp;quot;&amp;quot;&lt;br /&gt;
   local treplaceregion={}&lt;br /&gt;
      treplaceregion.s={};treplaceregion.e={};treplaceregion.t={}&lt;br /&gt;
      for i,j,k in mw.ustring.gmatch(replaceregion,[[(%d+)%.%.(%d+):%&amp;quot;(.-)%&amp;quot;]]) do&lt;br /&gt;
          table.insert(treplaceregion.s,tonumber(i));table.insert(treplaceregion.e,tonumber(j));table.insert(treplaceregion.t,tostring(k))&lt;br /&gt;
      end&lt;br /&gt;
    ---- exclude &amp;quot;Forget about this&amp;quot; (junk between ignored).&lt;br /&gt;
    ---- this prevents things from showing up even in the table and all motifs of this kind&lt;br /&gt;
   local exclude=args.exclude or pargs.exclude or &amp;quot;&amp;quot; -- for these empty arrays will be ignored later.&lt;br /&gt;
   local texclude={}&lt;br /&gt;
   for i in mw.ustring.gmatch(exclude,[[%&amp;quot;(.-)%&amp;quot;]]) do&lt;br /&gt;
      texclude[i]=1&lt;br /&gt;
   end&lt;br /&gt;
    ---- usenotes &amp;quot;This is a crummy motif name&amp;quot; (junk between ignored).  Uses /note entries instead&lt;br /&gt;
   local usenotes=args.usenotes or pargs.usenotes or &amp;quot;&amp;quot;&lt;br /&gt;
   local tusenotes={}&lt;br /&gt;
   for i in mw.ustring.gmatch(usenotes,[[%&amp;quot;(.-)%&amp;quot;]]) do&lt;br /&gt;
      tusenotes[i]=1&lt;br /&gt;
   end&lt;br /&gt;
    ---- substitute &amp;quot;Don&amp;#039;t like this wording&amp;quot;:&amp;quot;That&amp;#039;s what I want&amp;quot; (anything between these ignored)&lt;br /&gt;
   local substitute=args.substitute or pargs.substitute or &amp;quot;&amp;quot;&lt;br /&gt;
   local tsubstitute={}&lt;br /&gt;
   for i,j in mw.ustring.gmatch(substitute,[[%&amp;quot;(.-)%&amp;quot;:%&amp;quot;(.-)%&amp;quot;]]) do&lt;br /&gt;
      tsubstitute[i]=j&lt;br /&gt;
   end&lt;br /&gt;
    ---- toprow &amp;quot;Put this motif in the top row, no vertical annotation&amp;quot;&lt;br /&gt;
    ---- If present, defines an upper part of the graphic to mark certain features by color only - most likely, helices and sheets and turns&lt;br /&gt;
   local toprowtext=args.toprow or pargs.toprow or &amp;quot;&amp;quot;&lt;br /&gt;
   local ttoprow={}&lt;br /&gt;
   local toprowheight=0 -- no height unless one exists&lt;br /&gt;
   local toprow -- boolean to mark if anything is actually on the top row&lt;br /&gt;
   for i in mw.ustring.gmatch(toprowtext,[[%&amp;quot;(.-)%&amp;quot;]]) do&lt;br /&gt;
      ttoprow[i]=1;toprow=true&lt;br /&gt;
   end&lt;br /&gt;
   if toprow then toprowheight=args.toprowheight or pargs.toprowheight or 10 end&lt;br /&gt;
    ---- Check there is a protein sequence file and figure out where the CDS in it starts and ends&lt;br /&gt;
   local file=args.file or pargs.file&lt;br /&gt;
   if not(file) then return &amp;quot;error: use &amp;#039;file=some cut-and-pasted NCBI protein sequence&amp;#039; to input a protein to be diagrammed&amp;quot; end&lt;br /&gt;
   local cdsstart, cdsend = mw.ustring.match(file,&amp;quot;Protein%s-(%d+)%.%.(%d+)&amp;quot;)&lt;br /&gt;
   cdsstart=tonumber(cdsstart);cdsend=tonumber(cdsend)&lt;br /&gt;
   if ((cdsstart&amp;lt;1) or (cdsend&amp;lt;1)) then return [[error: the module expected a line &amp;quot;Protein: &amp;#039;&amp;#039;start amino acid&amp;#039;&amp;#039;..&amp;#039;&amp;#039;end amino acid&amp;#039;&amp;#039;&amp;quot; to define the CDS.]] end&lt;br /&gt;
   local cdswidth=cdsend-cdsstart&lt;br /&gt;
    ---- Find and replace Site and Region to create unique separators&lt;br /&gt;
    ---- so that every one of these sections can be individually processed in the main loop&lt;br /&gt;
   file = mw.ustring.gsub(file,&amp;quot;Site%s+&amp;quot;,&amp;quot;|##|S&amp;quot;) -- there are no pipe characters in the input or it would have choked&lt;br /&gt;
   file = mw.ustring.gsub(file,&amp;quot;Region%s+&amp;quot;,&amp;quot;|##|R&amp;quot;)&lt;br /&gt;
   file = mw.ustring.gsub(file,&amp;quot;$&amp;quot;,&amp;quot;|##|&amp;quot;) --- close last feature at the EOF&lt;br /&gt;
    ---- Load a set of colors to use for the different motifs.&lt;br /&gt;
    ---- Any unicode separator changes them.  No format expectations.&lt;br /&gt;
   local colorpage=mw.title.new(&amp;quot;Template:ImportProtein/DefaultColors&amp;quot;)&lt;br /&gt;
   local content&lt;br /&gt;
   local color={}&lt;br /&gt;
   if colorpage then&lt;br /&gt;
       content=colorpage.getContent(colorpage)&lt;br /&gt;
       if content then&lt;br /&gt;
          for x in mw.ustring.gmatch(content,&amp;quot;(%S+)&amp;quot;) do&lt;br /&gt;
              table.insert(color,x)&lt;br /&gt;
          end&lt;br /&gt;
       end&lt;br /&gt;
   end&lt;br /&gt;
   if #color&amp;lt;1 then color={&amp;quot;#000055&amp;quot;,&amp;quot;#000099&amp;quot;,&amp;quot;#0000CC&amp;quot;,&amp;quot;#0000FF&amp;quot;,&amp;quot;#550055&amp;quot;,&amp;quot;#550099&amp;quot;,&amp;quot;#5500CC&amp;quot;,&amp;quot;#5500FF&amp;quot;,&amp;quot;#990055&amp;quot;,&amp;quot;#990099&amp;quot;,&amp;quot;#9900CC&amp;quot;,&amp;quot;#9900FF&amp;quot;,&amp;quot;#CC0055&amp;quot;,&amp;quot;#CC0099&amp;quot;,&amp;quot;#CC00CC&amp;quot;,&amp;quot;#CC00FF&amp;quot;,&amp;quot;#FF0000&amp;quot;,&amp;quot;#FF0055&amp;quot;,&amp;quot;#FF0099&amp;quot;,&amp;quot;#FF00CC&amp;quot;,&amp;quot;#FF00FF&amp;quot;,&amp;quot;#005555&amp;quot;,&amp;quot;#005599&amp;quot;,&amp;quot;#0055CC&amp;quot;,&amp;quot;#0055FF&amp;quot;,&amp;quot;#55555&amp;quot;,&amp;quot;#555599&amp;quot;,&amp;quot;#5555CC&amp;quot;,&amp;quot;#5555FF&amp;quot;,&amp;quot;#995555&amp;quot;,&amp;quot;#995599&amp;quot;,&amp;quot;#9955CC&amp;quot;,&amp;quot;#9955FF&amp;quot;,&amp;quot;#CC5555&amp;quot;,&amp;quot;#CC5599&amp;quot;,&amp;quot;#CC55CC&amp;quot;,&amp;quot;#CC55FF&amp;quot;,&amp;quot;#FF5500&amp;quot;,&amp;quot;#FF5555&amp;quot;,&amp;quot;#FF5599&amp;quot;,&amp;quot;#FF55CC&amp;quot;,&amp;quot;#FF55FF&amp;quot;} end&lt;br /&gt;
   local claim={};local nextcolor=1 -- keeps track of the colors assigned to specific nkeys throughout the loop&lt;br /&gt;
       ---- Begin the output and graphics files&lt;br /&gt;
   local output&lt;br /&gt;
   local tlegend=&amp;quot;&amp;quot; -- legend for top row entries only, shown above table&lt;br /&gt;
   if tableoutput==&amp;quot;collapsed&amp;quot; then output=[[{| class=&amp;quot;wikitable mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;width:]].. width .. [[px;&amp;quot;]] .. &amp;quot;\n&amp;quot; .. [[!colspan=4|List of protein features]] .. &amp;quot;\n&amp;quot; .. [[|-]] else if tableoutput==&amp;quot;collapsible&amp;quot; then output=[[{| class=&amp;quot;wikitable collapsible&amp;quot; style=&amp;quot;width:]].. width .. [[px;&amp;quot;]] .. &amp;quot;\n&amp;quot; .. [[!colspan=4|List of protein features]] .. &amp;quot;\n&amp;quot; .. [[|-]] else output=[[{| class=&amp;quot;wikitable&amp;quot;]] end end&lt;br /&gt;
   local graphics=[[&amp;lt;div style=&amp;quot;position:relative;background-color:]].. background .. [[;width:]] .. width .. [[px;height:]] .. height .. [[px;&amp;quot;&amp;gt;]]&lt;br /&gt;
    ---- MAIN LOOP ----&lt;br /&gt;
    ---- this goes through features one by one and marks them down in &amp;quot;output&amp;quot; (legend/table) and &amp;quot;graphics&amp;quot; (protein box and vertical annotation)&lt;br /&gt;
    ---- Note that this does NOT create an array of features to sort, but is purely once through.&lt;br /&gt;
    ---- This means, for example, that there is no easy way to reposition adjacent motifs left and right to fit automatically.&lt;br /&gt;
    ---- You could, of course, array the output and retroactively process it ... maybe even turn this into a sortable array of function tail calls???  (My head hurts)&lt;br /&gt;
   for feature, range in mw.ustring.gmatch(file,&amp;quot;#|(.-)|#&amp;quot;) do&lt;br /&gt;
       local t=mw.ustring.match(feature,&amp;quot;^(%a)&amp;quot;) -- S or R placed in previous find/replace&lt;br /&gt;
       local s=mw.ustring.match(feature,&amp;quot;(%d+)&amp;quot;) -- first number is the beginning of site or region&lt;br /&gt;
       local e=mw.ustring.match(feature,&amp;quot;^.%s-%d+%.%.(%d+)&amp;quot;) or s -- second number in xx..yy range ; this needs updating!&lt;br /&gt;
 &lt;br /&gt;
       if s then&lt;br /&gt;
           ---- decide on the name to be used for the motif and annotation&lt;br /&gt;
          local n,c&lt;br /&gt;
          if t==&amp;quot;R&amp;quot; then n=mw.ustring.match(feature,[[/region_name=%&amp;quot;(.-)%&amp;quot;]]) end&lt;br /&gt;
          if t==&amp;quot;S&amp;quot; then n=mw.ustring.match(feature,[[/site_type=%&amp;quot;(.-)%&amp;quot;]]) end&lt;br /&gt;
          n=tostring(n)&lt;br /&gt;
          if tusenotes[n] then n=mw.ustring.match(feature,[[/note=%&amp;quot;(.-)%&amp;quot;]]) or n end&lt;br /&gt;
          n=tostring(n)&lt;br /&gt;
          n=mw.ustring.match(n,&amp;quot;^%s+(.+)%s+$&amp;quot;) or n -- kill white space&lt;br /&gt;
          n=mw.ustring.gsub(n,&amp;quot;\n&amp;quot;,&amp;quot; &amp;quot;) or n -- remove line feeds&lt;br /&gt;
          n=tostring(n) -- am I paranoid?&lt;br /&gt;
          if tsubstitute[n] then n=tostring(tsubstitute[n]) end&lt;br /&gt;
          n = mw.ustring.match(n,&amp;quot;(.+)%.&amp;quot;) or n -- Don&amp;#039;t need the ubiquitous final periods&lt;br /&gt;
           ---- from the name (n) pull out an nkey that excludes parenthesized stuff&lt;br /&gt;
           ---- each unique nkey can claim its own color to use from here on out&lt;br /&gt;
          local nkey=mw.ustring.match(n,&amp;quot;(.+)[%.;,%(%[]&amp;quot;) or n&lt;br /&gt;
          local newcolor=false; -- is this a new color (if so, then if it is toprow, then add to legend for those)&lt;br /&gt;
          if claim[nkey] then c=claim[nkey] else c=color[nextcolor];claim[nkey]=c;nextcolor=nextcolor+1;newcolor=true end&lt;br /&gt;
          local cstyle=[[style=&amp;quot;color:]] .. c .. [[;&amp;quot;|]]&lt;br /&gt;
           ---- decide whether to show the motif, and crop it to the CDS&lt;br /&gt;
          local showthismotif=true&lt;br /&gt;
          s=tonumber(s);e=tonumber(e)&lt;br /&gt;
          if s&amp;lt;cdsstart then s=cdsstart end&lt;br /&gt;
          if e&amp;gt;cdsend then e=cdsend end&lt;br /&gt;
          if s==cdsstart and e==cdsend then showthismotif=nil end&lt;br /&gt;
          if include then if not (tinclude[n]) then showthismotif=nil end end -- if include is set, and n isn&amp;#039;t in it, don&amp;#039;t add to table or graphic&lt;br /&gt;
          if exclude then if texclude[n] then showthismotif=nil end end -- if exclude is set and n is in it don&amp;#039;t add&lt;br /&gt;
          if showthismotif then&lt;br /&gt;
              ---- update the table output for the legend&lt;br /&gt;
             if tostring(t)==&amp;quot;R&amp;quot; then output = output .. &amp;quot;\n|&amp;quot; .. cstyle .. &amp;quot;region\n|&amp;quot; else output = output .. &amp;quot;\n|&amp;quot; .. cstyle .. &amp;quot;site\n|&amp;quot; end&lt;br /&gt;
             output = output .. cstyle .. tostring(s) .. &amp;quot;\n|&amp;quot; .. cstyle .. tostring(e) .. &amp;quot;\n|&amp;quot; .. cstyle .. n .. &amp;quot;\n|-&amp;quot;&lt;br /&gt;
              ---- update the graphic display: first determine if the block is large to be displayed full height and annotated inside itself&lt;br /&gt;
             nkey=mw.ustring.sub(nkey,1,vtext) -- for graphics purposes, truncate the string (default 25 characters)&lt;br /&gt;
             local large&lt;br /&gt;
             local boxleft=math.floor(width*tonumber(s)/cdswidth)&lt;br /&gt;
             local boxwidth=math.floor(width*tonumber(e)/cdswidth)-boxleft&lt;br /&gt;
             if boxwidth&amp;gt;8*tonumber(mw.ustring.len(nkey)) then large=true else large=nil end&lt;br /&gt;
              ---- then work out the horizontal or vertical display&lt;br /&gt;
             local vertical -- height substring of the drawn block&lt;br /&gt;
             local annot=&amp;quot;&amp;quot; -- text contents of a large block&lt;br /&gt;
             if ttoprow[n] then&lt;br /&gt;
                vertical=tostring(toprowheight)&lt;br /&gt;
                if newcolor then tlegend=tlegend..[[&amp;lt;span style=&amp;quot;background-color:]] .. c .. [[;&amp;quot;&amp;gt;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;/span&amp;gt; ]] .. nkey .. &amp;quot;\n&amp;quot; end&lt;br /&gt;
                nkey=&amp;quot;&amp;quot;&lt;br /&gt;
             else&lt;br /&gt;
                if large then&lt;br /&gt;
                    vertical=tostring(height-toprowheight)&lt;br /&gt;
                    if toprow then vertical=vertical .. &amp;quot;px;top:&amp;quot; .. tostring(toprowheight) end&lt;br /&gt;
                    annot=&amp;quot;&amp;#039;&amp;#039;&amp;#039;&amp;quot; .. nkey ..&amp;quot;&amp;#039;&amp;#039;&amp;#039;&amp;quot;&lt;br /&gt;
                    nkey=&amp;quot;&amp;quot; -- no vertical text display&lt;br /&gt;
                else vertical=tostring(math.floor(height) - toprowheight - largeonlyregion) .. &amp;quot;px;top:&amp;quot; .. tostring(toprowheight + largeonlyregion)&lt;br /&gt;
                    nkey=mw.ustring.gsub(nkey,&amp;quot;(.)&amp;quot;,&amp;quot;%1&amp;lt;br /&amp;gt;&amp;quot;) -- verticalize the text &lt;br /&gt;
                end&lt;br /&gt;
             end&lt;br /&gt;
             local z=10000-1*boxwidth --- smaller elements in front of larger ones&lt;br /&gt;
             if not(large) then z=z+10000 end --- large elements reliably to the back&lt;br /&gt;
               -- draw graphics within the protein rectangle&lt;br /&gt;
             graphics = graphics .. [[&amp;lt;div style=&amp;quot;position:absolute;overflow:hidden;z-index:]] .. z .. [[;left:]] .. boxleft .. [[px;border-top:0px;border-bottom:0px;border-left:1px;border-right:1px;border-style:solid;border-color:]].. c .. [[;background-color:]].. c .. [[;width:]] .. boxwidth .. [[px;height:]] .. vertical .. [[px;text-align:center;&amp;quot;&amp;gt;]] .. annot .. [[&amp;lt;/div&amp;gt;]]&lt;br /&gt;
               -- draw annotations vertically below it&lt;br /&gt;
               -- don&amp;#039;t do at all if no text (nkey==&amp;quot;&amp;quot;, such as on the top row)&lt;br /&gt;
             if not (nkey==&amp;quot;&amp;quot;) then&lt;br /&gt;
                  -- first decide if in a replaceregion - if so, don&amp;#039;t draw&lt;br /&gt;
                local toreplace;local ri=1&lt;br /&gt;
                while treplaceregion.s[ri] do&lt;br /&gt;
                   local rs=treplaceregion.s[ri]&lt;br /&gt;
                   local re=treplaceregion.e[ri]&lt;br /&gt;
                   if s&amp;gt;=rs and e&amp;lt;=re then toreplace=true;break end&lt;br /&gt;
                   ri=ri+1&lt;br /&gt;
                end          &lt;br /&gt;
                if not toreplace and not large then &lt;br /&gt;
                    --- center vt in the feature; then claim pixels one by one around it.&lt;br /&gt;
                    --- Don&amp;#039;t draw in a claimed pixel, but file a protest at bottom.&lt;br /&gt;
                   local vt=math.floor(boxleft+boxwidth/2 - 2) -- vertical text&amp;#039;s horizontal position&lt;br /&gt;
                   if not vclaim[vt] then&lt;br /&gt;
                      for i = vt-vwidth,vt+vwidth,1 do&lt;br /&gt;
                          vclaim[i]=true&lt;br /&gt;
                      end&lt;br /&gt;
                      graphics = graphics .. [[&amp;lt;span style=&amp;quot;position:absolute;text-align:center;line-height:90%;font-size:85%;overflow:visible;z-index:100;left:]] .. vt .. [[px;top:]] .. math.floor(height+5) .. [[px;&amp;quot;&amp;gt;]] .. nkey .. [[&amp;lt;/span&amp;gt;]]&lt;br /&gt;
                      else vprotest=vprotest .. s .. &amp;quot;-&amp;quot; .. e .. &amp;quot; &amp;quot;&lt;br /&gt;
                   end -- (if not ttoprow[n])&lt;br /&gt;
                end -- (if not vclaim)&lt;br /&gt;
             end -- (if not toreplace)&lt;br /&gt;
          end -- (if showthismotif)&lt;br /&gt;
       end -- (if s)&lt;br /&gt;
   end -- for feature, range&lt;br /&gt;
    --- we&amp;#039;re out of the loop - now draw annotations for the chosen replace regions based on user text&lt;br /&gt;
   local ri=1&lt;br /&gt;
      while treplaceregion.s[ri] do&lt;br /&gt;
         local rs=treplaceregion.s[ri]&lt;br /&gt;
         local re=treplaceregion.e[ri]&lt;br /&gt;
         local rt=mw.ustring.gsub(mw.ustring.sub(treplaceregion.t[ri],1,vtext),&amp;quot;(.)&amp;quot;,&amp;quot;%1&amp;lt;br /&amp;gt;&amp;quot;) -- verticalize the text&lt;br /&gt;
         local boxleft=math.floor(width*tonumber(rs)/cdswidth)&lt;br /&gt;
         local boxwidth=math.floor(width*tonumber(re)/cdswidth)-boxleft&lt;br /&gt;
         local vt = math.floor(boxleft+boxwidth/2 -2) -- this formula should be synchronized with above, but defining constants seems silly.&lt;br /&gt;
          -- this ignores vclaim - it&amp;#039;s a user input, therefore repositionable field&lt;br /&gt;
         graphics = graphics .. [[&amp;lt;span style=&amp;quot;position:absolute;text-align:center;line-height:90%;font-size:85%;overflow:visible;z-index:100;left:]] .. vt .. [[px;top:]] .. math.floor(height+5) .. [[px;&amp;quot;&amp;gt;]] .. rt .. [[&amp;lt;/span&amp;gt;]]&lt;br /&gt;
         ri=ri+1&lt;br /&gt;
      end&lt;br /&gt;
   if not(tableoutput) then output = &amp;quot;&amp;quot; end&lt;br /&gt;
   if tlegend == &amp;quot;&amp;quot; then else tlegend = [[&amp;lt;div style=&amp;quot;width:]]..width..[[;&amp;quot;&amp;gt;]] .. [[&amp;#039;&amp;#039;Top row:&amp;#039;&amp;#039; ]] .. tlegend .. [[&amp;lt;/div&amp;gt;]] end&lt;br /&gt;
   if vprotest == &amp;quot;&amp;quot; then else vprotest = &amp;quot;&amp;#039;&amp;#039;Overlapping vertical annotations not shown above: &amp;quot; .. vprotest .. &amp;quot;&amp;#039;&amp;#039;&amp;quot; end&lt;br /&gt;
   if debuglog == &amp;quot;|}|}&amp;quot; then debuglog=&amp;quot;&amp;quot; else debuglog = debuglog .. &amp;quot;\n&amp;quot; end&lt;br /&gt;
   if vtext&amp;gt;2 then vtext=vtext-2 end -- make up for extra return required to start a table at the end there.&lt;br /&gt;
   local output = [=[{| style=&amp;quot;width:]=]..width..[[px;&amp;quot;]] .. &amp;quot;\n|&amp;quot;.. graphics .. [[&amp;lt;/div&amp;gt;&amp;lt;div style=&amp;quot;line-height:90%;font-size:85%;&amp;quot;&amp;gt;]] .. mw.ustring.rep(&amp;quot;\n&amp;quot;,vtext) .. &amp;quot;&amp;lt;/div&amp;gt;&amp;quot; .. tlegend .. vprotest .. &amp;quot;\n&amp;quot; .. output .. &amp;quot;\n|}\n&amp;quot; .. debuglog .. &amp;quot;|}\n&amp;quot;&lt;br /&gt;
   if nowiki then output = frame.preprocess(frame,&amp;quot;&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&amp;quot;..output..&amp;quot;&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&amp;quot;) end&lt;br /&gt;
   return output&lt;br /&gt;
&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>imported&gt;Jonesey95</name></author>
	</entry>
</feed>