Difference between revisions of "Template:Clade/doc/common"
Jump to navigation
Jump to search
imported>Nnemo (Accessibility, nicer word) |
imported>Gadget850 (update obsolete HTML <tt>) |
||
| Line 5: | Line 5: | ||
-->{{#ifeq:{{{1|}}}|cladex|'''Use {{tlf|Clade}} unless the extra features of {{tlf|Cladex}} are needed.''' | -->{{#ifeq:{{{1|}}}|cladex|'''Use {{tlf|Clade}} unless the extra features of {{tlf|Cladex}} are needed.''' | ||
}}<!-- ===== END OF FOR cladex ONLY--> | }}<!-- ===== END OF FOR cladex ONLY--> | ||
| − | === Usage === | + | ===Usage=== |
<pre> | <pre> | ||
| Line 111: | Line 111: | ||
}} | }} | ||
| − | To replace a solid line leading to the ''N''th child with a dashed line, use < | + | To replace a solid line leading to the ''N''th child with a dashed line, use <code>|stateN=dashed</code>. |
<pre> | <pre> | ||
<nowiki> | <nowiki> | ||
| Line 138: | Line 138: | ||
-->{{#ifeq:{{{1|}}}|cladex| | -->{{#ifeq:{{{1|}}}|cladex| | ||
| − | '''{{tlf|Cladex}} only.''' To replace a single line leading to the ''N''th child by a double line, use < | + | '''{{tlf|Cladex}} only.''' To replace a single line leading to the ''N''th child by a double line, use <code>{{!}}stateN=double</code>. Notice that {{tlf|Cladex}} has only been used for the (sub)clade where the double line is wanted. The outermost clade should always be specified with {{tlf|Clade}} unless its style is altered — see further. |
<pre> | <pre> | ||
<nowiki> | <nowiki> | ||
| Line 164: | Line 164: | ||
}} | }} | ||
}}<!-- ===== END OF FOR cladex ONLY--> | }}<!-- ===== END OF FOR cladex ONLY--> | ||
| − | === Tips === | + | ===Tips=== |
An easy way of creating larger cladograms is to use the Newick format and proceed to edit it using a suitable text editor to produce the markup. | An easy way of creating larger cladograms is to use the Newick format and proceed to edit it using a suitable text editor to produce the markup. | ||
| Line 174: | Line 174: | ||
# Edit clade labels if needed | # Edit clade labels if needed | ||
| − | Alternatively, one can easily generate required clade code by downloading the free Windows utility, 'Claded', via link at http://code.google.com/p/claded, 'Claded' allowing editing of Cladograms using a tree control. | + | Alternatively, one can easily generate required clade code by downloading the free Windows utility, 'Claded', via link at http://code.google.com/p/claded, 'Claded' allowing editing of Cladograms using a tree control. |
<pre> | <pre> | ||
| Line 332: | Line 332: | ||
'''{{tlf|Cladex}} only.''' To insert a coloured 'bracket' around a set of leaf nodes which follow one another in the generated cladogram: | '''{{tlf|Cladex}} only.''' To insert a coloured 'bracket' around a set of leaf nodes which follow one another in the generated cladogram: | ||
| − | * Add < | + | * Add <code>barbeginN=''colour''</code> for the first leaf node, where N is the order of that leaf node within its clade, and ''colour'' is the required colour. |
| − | * Add < | + | * Add <code>barN=''colour''</code> for the remaining nodes other than the last (note that N must be the order of that node within its clade). |
| − | * Add < | + | * Add <code>barendN=''colour''</code> for the last node. |
| − | Either the outermost clade must be specified by {{tlf|Clade}} or if {{tlf|Cladex}} is needed there, < | + | Either the outermost clade must be specified by {{tlf|Clade}} or if {{tlf|Cladex}} is needed there, <code>{{!}}style=width:auto</code> must be present. |
<pre> | <pre> | ||
| Line 348: | Line 348: | ||
|1=Leaf D|barend1=green | |1=Leaf D|barend1=green | ||
|2=Leaf E | |2=Leaf E | ||
| − | |3=Leaf F|barbegin3=purple | + | |3=Leaf F|barbegin3=purple |
|4={{cladex | |4={{cladex | ||
|1=Leaf G|bar1=purple | |1=Leaf G|bar1=purple | ||
| Line 368: | Line 368: | ||
|1=Leaf D|barend1=green | |1=Leaf D|barend1=green | ||
|2=Leaf E | |2=Leaf E | ||
| − | |3=Leaf F|barbegin3=purple | + | |3=Leaf F|barbegin3=purple |
|4={{cladex | |4={{cladex | ||
|1=Leaf G|bar1=purple | |1=Leaf G|bar1=purple | ||
| Line 377: | Line 377: | ||
}} | }} | ||
| − | The horizontal lines can be omitted by using < | + | The horizontal lines can be omitted by using <code>{{!}}barN=''colour''</code> throughout. Thus the following (note the use of <code>{{!}}style=width:auto</code> since the outermost clade uses the extra features of {{tlf|Cladex}}): |
<pre> | <pre> | ||
| Line 387: | Line 387: | ||
|2=Leaf C|bar2=midnightblue | |2=Leaf C|bar2=midnightblue | ||
}} | }} | ||
| − | |3=Leaf D|bar3=midnightblue | + | |3=Leaf D|bar3=midnightblue |
}}</nowiki> | }}</nowiki> | ||
</pre> | </pre> | ||
| Line 398: | Line 398: | ||
|2=Leaf C|bar2=midnightblue | |2=Leaf C|bar2=midnightblue | ||
}} | }} | ||
| − | |3=Leaf D|bar3=midnightblue | + | |3=Leaf D|bar3=midnightblue |
}} | }} | ||
| Line 420: | Line 420: | ||
===Specifying colours=== | ===Specifying colours=== | ||
| − | You can use any of the ways in which colours can be specified in [[HTML]]; e.g. the standard [http://www.w3schools.com/html/html_colornames.asp colour names], the three or six hex digit notations, such as #FC3 or #F3C630, or the < | + | You can use any of the ways in which colours can be specified in [[HTML]]; e.g. the standard [http://www.w3schools.com/html/html_colornames.asp colour names], the three or six hex digit notations, such as #FC3 or #F3C630, or the <code>rgb()</code> notation. |
===Supplying text labels=== | ===Supplying text labels=== | ||
| Line 429: | Line 429: | ||
If your cladogram doesn't display brackets/bars as you expected, check that: | If your cladogram doesn't display brackets/bars as you expected, check that: | ||
| − | * You understand the numbering system for the parameters < | + | * You understand the numbering system for the parameters <code>barN<code>, etc. The N must be the same as the number of the child within its clade. Thus typically you should write <code>{{!}}N=''label for leaf''{{!}}barN=''colour for bar''</code>, e.g. <code>{{!}}2=<nowiki>[[Passeridae]]</nowiki>{{!}}bar2=midnightblue</code>. |
* You have only attempted to apply brackets/bars to ''leaf'' nodes. | * You have only attempted to apply brackets/bars to ''leaf'' nodes. | ||
| − | * Either the outermost clade uses {{tlf|Clade}} or if it has to use {{tlf|Cladex}}, then < | + | * Either the outermost clade uses {{tlf|Clade}} or if it has to use {{tlf|Cladex}}, then <code>{{!}}style=width:auto</code> is present. |
}}<!-- | }}<!-- | ||
===== END OF FOR cladex ONLY--> | ===== END OF FOR cladex ONLY--> | ||
| Line 437: | Line 437: | ||
===Label length=== | ===Label length=== | ||
| − | Labels produced by < | + | Labels produced by <code>|labelN=</code>, where <code>N</code> is 1, 2, ..., can lead to poor layout of the resulting cladogram. (This does not apply to the text of leaves, i.e. text produced by <code>|N=</code>.) To avoid problems: |
* Labels should be kept as short as possible, ideally a single word | * Labels should be kept as short as possible, ideally a single word | ||
* Any necessary spaces in labels should be represented as &nbsp; not as actual spaces. | * Any necessary spaces in labels should be represented as &nbsp; not as actual spaces. | ||
| Line 457: | Line 457: | ||
There are limitations on the size and complexity of the cladograms which can be drawn: | There are limitations on the size and complexity of the cladograms which can be drawn: | ||
* A maximum of 17 children is allowed per node. It may seem that this could easily be increased by editing the template, but see the next point. | * A maximum of 17 children is allowed per node. It may seem that this could easily be increased by editing the template, but see the next point. | ||
| − | * Cladograms can only be expanded up to a certain level of complexity because the MediaWiki software limits the resources available for template expansion. The cladogram at [[ | + | * Cladograms can only be expanded up to a certain level of complexity because the MediaWiki software limits the resources available for template expansion. The cladogram at [[APG III system#Phylogeny]] has had to be broken into three parts, because the entire cladogram exhausts the allowed resources (in this case the allowed expansion depth). ''Any change to the template could result in large cladograms failing to display correctly.'' In general, don't exceed a depth of 19, i.e. don't nest one {{#ifeq:{{{1|}}}|cladex|cladex|clade}} template inside another more than 19 times. |
===Inclusion in books=== | ===Inclusion in books=== | ||
Revision as of 11:09, 8 April 2015
50px Template documentation
This is the common part of the documentation for the two templates {{Clade}} and {{Cladex}}. Set the first parameter to "clade" or "cladex" to select which version is shown.
| Editors can experiment in this template's sandbox (create | mirror) and testcases (create) pages. Subpages of this template. |