வார்ப்புரு:Barlabel/doc
{{tl|cladex}} என்ற வார்ப்புருவைப் பயன்படுத்தி, வரும் உயிரின கிளை வரைபடத்தில், குறியீடுகளும், தலைப்புகளும் இணைக்கப்பட, இந்த வார்ப்புரு பயன்படுகிறது.
 
 ==பயன்பாடுகள்==
 
 # First create a cladogram using {{tl|cladex}} and {{tl|clade}}, as appropriate.
 # Then embed the cladogram in this template as the value of {{para|cladogram}}.
 
 ===Example===
 
 Suppose you have created the cladogram shown below.
 
 {{cladex|style=width:auto
 |label1=GM
 |1={{cladex
    |1=A1
    |2=A2|barbegin2=green|state2=double
    |3=A3|bar3=green
    |label4=M
    |4={{cladex
       |1=C1|barend1=green
       |label2=C2
       |2={{cladex
          |1=G1&amp;nbsp;|barbegin1=purple
          |2=G2|barend2=purple
          |3=G3
          }}
       }}
    }}
 }}
 To provide labels for the two groups identified in the cladogram:
 * Count the number of leaf nodes in the cladogram; here there are 7. The parameter &lt;tt&gt;size&lt;/tt&gt; will be set to 7.
 * Decide against which leaf nodes you want the labels to go. To centre the labels, the label for the green group should be opposite leaf node 3; the label for the purple group should be between leaf nodes 5 and 6, i.e. opposite leaf node &quot;5.5&quot;. The &lt;tt&gt;at&lt;/tt&gt; parameters of the template are set to these values.
 
 The full expression required is shown below (excluding the code to create the cladogram).
 &lt;pre&gt;&lt;nowiki&gt;
 {{Barlabel
 |size=7
 |at1=3|label1=Group 1|bar1=green
 |at2=5.5|label2=Group 2|bar2=purple
 |cladogram=...
 }}&lt;/nowiki&gt;&lt;/pre&gt;
 This produces
 {{Barlabel
 |size=7
 |at1=3|label1=Group 1|bar1=green
 |at2=5.5|label2=Group 2|bar2=purple
 |cladogram={{cladex|style=width:auto
 |label1=GM
 |1={{cladex
    |1=A1
    |2=A2|barbegin2=green|state2=double
    |3=A3|bar3=green
    |label4=M
    |4={{cladex
       |1=C1|barend1=green
       |label2=C2
       |2={{cladex
          |1=G1&amp;nbsp;|barbegin1=purple
          |2=G2|barend2=purple
          |3=G3
          }}
       }}
    }}
 }}
 }}
 To reduce the font size of the cladogram and its labels, use the &lt;tt&gt;style&lt;/tt&gt; parameter. Thus
 &lt;pre&gt;&lt;nowiki&gt;
 {{Barlabel
 |style=font-size:85%
 |size=7
 |at1=3|label1=Group 1|bar1=green
 |at2=5.5|label2=Group 2|bar2=purple
 |cladogram=...
 }}&lt;/nowiki&gt;&lt;/pre&gt;
 produces
 {{Barlabel
 |style=font-size:85%
 |size=7
 |at1=3|label1=Group 1|bar1=green
 |at2=5.5|label2=Group 2|bar2=purple
 |cladogram={{cladex|style=width:auto
 |label1=GM
 |1={{cladex
    |1=A1
    |2=A2|barbegin2=green|state2=double
    |3=A3|bar3=green
    |label4=M
    |4={{cladex
       |1=C1|barend1=green
       |label2=C2
       |2={{cladex
          |1=G1&amp;nbsp;|barbegin1=purple
          |2=G2|barend2=purple
          |3=G3
          }}
       }}
    }}
 }}
 }}
 
 The cladogram can be aligned to the right, with text flowing around it to the left, but in this case you must specify the space allowed for the labels using the parameter &lt;tt&gt;labelwidth&lt;/tt&gt;, otherwise the labels will appear off the right of the page. Trial and error may be needed, but about 60% of the number of characters in the longest label is usually a good starting point. Thus
 &lt;pre&gt;&lt;nowiki&gt;
 {{Barlabel
 |style=font-size:85%|align=right|labelwidth=4.5
 |size=7
 |at1=3|label1=Group 1|bar1=green
 |at2=5.5|label2=Group 2|bar2=purple
 |cladogram=...
 }}&lt;/nowiki&gt;&lt;/pre&gt;
 produces the cladogram on the right below.{{Barlabel
 |style=font-size:85%|align=right|labelwidth=4.5
 |size=7
 |at1=3|label1=Group 1|bar1=green
 |at2=5.5|label2=Group 2|bar2=purple
 |cladogram={{cladex|style=width:auto
 |label1=GM
 |1={{cladex
    |1=A1
    |2=A2|barbegin2=green|state2=double
    |3=A3|bar3=green
    |label4=M
    |4={{cladex
       |1=C1|barend1=green
       |label2=C2
       |2={{cladex
          |1=G1&amp;nbsp;|barbegin1=purple
          |2=G2|barend2=purple
          |3=G3
          }}
       }}
    }}
 }}
 }}
 
 The cladogram can be placed centrally on the page by specifying &lt;tt&gt;|align=center&lt;/tt&gt; or &lt;tt&gt;|align=centre&lt;/tt&gt;. The &lt;tt&gt;labelwidth&lt;/tt&gt; parameter is needed to ensure the cladogram is centred; if it is omitted, the labels will be ignored in determining the placement. Thus
 &lt;pre style=&quot;width:60%&quot;&gt;&lt;nowiki&gt;
 {{Barlabel
 |style=font-size:85%|align=center|labelwidth=4.5
 |size=7
 |at1=3|label1=Group 1|bar1=green
 |at2=5.5|label2=Group 2|bar2=purple
 |cladogram=...
 }}&lt;/nowiki&gt;&lt;/pre&gt;
 produces
 {{Barlabel
 |style=font-size:85%|align=center
 |size=7
 |at1=3|label1=Group 1|bar1=green
 |at2=5.5|label2=Group 2|bar2=purple
 |cladogram={{cladex|style=width:auto
 |label1=GM
 |1={{cladex
    |1=A1
    |2=A2|barbegin2=green|state2=double
    |3=A3|bar3=green
    |label4=M
    |4={{cladex
       |1=C1|barend1=green
       |label2=C2
       |2={{cladex
          |1=G1&amp;nbsp;|barbegin1=purple
          |2=G2|barend2=purple
          |3=G3
          }}
       }}
    }}
 }}
 }}
 
 The cladogram can also be aligned left with text flowing around it to the right by using &lt;tt&gt;|align=left&lt;/tt&gt;. Again the &lt;tt&gt;labelwidth&lt;/tt&gt; parameter is needed, otherwise the labels will overlap the text.
 
 (The template can be used to align cladograms without brackets/bars and labels, although {{tl|cladogram}} offers more options for doing this.)
 &lt;br style=&quot;clear:both;&quot;&gt;
 
 ===Parameters===
 
 * &lt;tt&gt;size&lt;/tt&gt; must be set to the total number of leaf nodes in the cladogram, e.g. &lt;tt&gt;|size=23&lt;/tt&gt;.
 
 Up to five labels can be provided. They are identified by the digit in the name of the parameter. Each label requires three parameters, e.g. &lt;tt&gt;at2&lt;/tt&gt;, &lt;tt&gt;label2&lt;/tt&gt; and &lt;tt&gt;bar2&lt;/tt&gt; for the second label. ''There is no connection between these numbers and the numbers used to identify child nodes in {{tl|clade}} or {{tl|cladex}}.'' The &quot;1&quot; can be omitted, i.e. &lt;tt&gt;at&lt;/tt&gt;, &lt;tt&gt;label&lt;/tt&gt; and &lt;tt&gt;bar&lt;/tt&gt; are equivalent to &lt;tt&gt;at1&lt;/tt&gt;, &lt;tt&gt;label1&lt;/tt&gt; and &lt;tt&gt;bar1&lt;/tt&gt;.
 
 * &lt;tt&gt;atN&lt;/tt&gt; defines the position of label N in terms of position of the leaf node in the whole cladogram, starting from 1 and ending at the value of &lt;tt&gt;size&lt;/tt&gt;. The label is placed opposite the chosen leaf node. For a label between two leaf nodes, use the average. Thus to place the first label opposite leaf node 6, use &lt;tt&gt;|at1=6&lt;/tt&gt;; to place the third label opposite a point between leaf nodes 6 and 7, use &lt;tt&gt;|at3=6.5&lt;/tt&gt;.
 * &lt;tt&gt;labelN&lt;/tt&gt; defines the text of label N. Thus to give the third label the text &quot;Group 3&quot;, use &lt;tt&gt;|label3=Group 3&lt;/tt&gt;.
 * &lt;tt&gt;barN&lt;/tt&gt; defines the colour of label N. Thus to put the second label in green text, use &lt;tt&gt;|bar3=green&lt;/tt&gt;. (The name &lt;tt&gt;bar&lt;/tt&gt; is consistent with {{tl|cladex}}; however &lt;tt&gt;colourN&lt;/tt&gt; or &lt;tt&gt;colorN&lt;/tt&gt; can be used instead.)
 * &lt;tt&gt;style&lt;/tt&gt; The size of the text used in the cladogram and labels can be altered by using the &lt;tt&gt;style&lt;/tt&gt; parameter, e.g. &lt;tt&gt;|style=font-size:85%&lt;/tt&gt;. ''Do not alter the font size in the {{tl|cladex}} or {{tl|clade}} templates!'' If you do, the cladogram and the labels will not align correctly as they will be of different sizes.
 * &lt;tt&gt;align&lt;/tt&gt; The cladogram can be aligned centrally by specifying &lt;tt&gt;|align=center&lt;/tt&gt; or &lt;tt&gt;|align=centre&lt;/tt&gt;, or to the right or left by specifying &lt;tt&gt;|align=right&lt;/tt&gt; or &lt;tt&gt;|align=left&lt;/tt&gt;. The last two allow text to flow around the side of the cladogram, i.e. it is embedded in the text.
 * &lt;tt&gt;labelwidth&lt;/tt&gt; When using &lt;tt&gt;|align=&lt;/tt&gt;, you must also specify the space allowed for the labels using &lt;tt&gt;labelwidth=''number''&lt;/tt&gt;, otherwise the space occupied by the labels will be ignored in placing the cladogram. Trial and error may be needed, but about 60% of the number of characters in the longest label is usually a good starting point.
 
 ==Limitations, debugging==
 
 The template works by constructing a hidden table. Different browsers (user agents) have different algorithms for laying out tables, so the precise alignment of the labels differs between browsers and platforms, and is not always exactly opposite the chosen leaf node. Although it's possible to 'tweak' the alignment for one browser/platform combination (e.g. by using fractional positions other than 0.5), this won't work across combinations.
 
 The template does not check the ranges of the parameters supplied, so make sure that the values of the &lt;tt&gt;atN&lt;/tt&gt; parameters are less or equal to the value of the &lt;tt&gt;size&lt;/tt&gt; parameters. Label N will only be displayed if &lt;tt&gt;size&lt;/tt&gt;, &lt;tt&gt;atN&lt;/tt&gt; and &lt;tt&gt;labelN&lt;/tt&gt; are defined. The colour of the text of the label (defined by &lt;tt&gt;barN&lt;/tt&gt;, &lt;tt&gt;colorN&lt;/tt&gt; or &lt;tt&gt;colourN&lt;/tt&gt;) defaults to black.
 
 Setting &lt;tt&gt;labelwidth&lt;/tt&gt; is needed whenever the cladogram is aligned to the centre, right or left. This includes placing &lt;tt&gt;&lt;nowiki&gt;{{barlabel}}&lt;/nowiki&gt;&lt;/tt&gt; inside {{tl|cladogram}} and aligning it to the right via that template.
 
 &lt;includeonly&gt;
 &lt;!-- Categories and interwikis go here: --&gt;
 
 [[Category:Genealogy formatting templates|{{PAGENAME}}]]
 [[Category:Wikipedia formatting and function templates|{{PAGENAME}}]]