跳转到内容

模板:Clade/doc:修订间差异

来自MalacoKnowledge
template>IznoRepeat
→‎Inclusion in books:​phab:T337149#8953569, replaced: [// → [https://
 
导入1个版本
 
(没有差异)

2024年1月19日 (五) 08:28的最新版本

{{#ifeq:doc |doc

    | 

{{#ifeq:show |show

         | 模板:Mbox
        }}{{#if: |
         |   {{#ifexist:模板:Clade
                  | [[Category:{{#switch:模板 |Template=Template |Module=Module |User=User |#default=Wikipedia}} documentation pages]]
                  | 
                 }}
        }}
    | 
   }}

模块:TNT第159行Lua错误:Missing JsonConfig extension; Cannot load https://commons.wikimedia.org/wiki/Data:I18n/Uses TemplateStyles.tab

This template is used for drawing branching trees with the node and base labels being clickable links. Such diagrams are especially suited to represent evolutionary trees (cladograms).

Basic features

Usage

<syntaxhighlight lang="wikitext">

Base

Node

</syntaxhighlight>

produces

Base

Node

<syntaxhighlight lang="wikitext">

Subtree1

Leaf1

Subtree2

Leaf2

</syntaxhighlight>

produces

Subtree1 

Leaf1

Subtree2 

Leaf2

<syntaxhighlight lang="wikitext">

Subtree1

Leaf1

Subtree2

Leaf2

</syntaxhighlight>

produces

Subtree1

Leaf1

Subtree2

Leaf2

Note that the order of the parameters does not matter. Exactly the same output is produced by <syntaxhighlight lang="wikitext">

Subtree1

Leaf1

Subtree2

Leaf2

</syntaxhighlight>

Subtree1

Leaf1

Subtree2

Leaf2

Technical background

The clade template has many features for customising the appearance. Using them optimally requires some understanding of how the template works. The cladogram is constructed using nested HTML tables and the lines of the cladogram are borders of the cells (<td> tags). Each clade template creates an HTML table with the elements show as follows:

Description Table cell structure Cladogram Code using clade template

A simple clade structure with a single child node (or leaf).

This is an HTML table with two rows and two columns. The cells of the righthand column are merged using the rowspan attribute.

labelA

Leaf A

sublabelA
labelA

LeafA

sublabelA
<syntaxhighlight lang="wikitext">
labelA

LeafA

sublabelA
</syntaxhighlight>

Replace LeafA with another clade structure.

A second HTML table is placed inside a the right-hand cell of the outer table.

labelA
label1 leaf1
sublabel1
label2 leaf2
sublabel2
sublabelA
labelA
label1

leaf1

sublabel1
label2

leaf2

sublabel2
sublabelA
<syntaxhighlight lang="wikitext">
labelA
label1

leaf1

sublabel1
label2

leaf2

sublabel2
sublabelA
</syntaxhighlight>

Styling brackets and branches

The appearance of the cladogram can be customised by changing the border attributes of the HTML cell elements, using the parameters |{{SAFESUBST:#if:state|state=}}, |{{SAFESUBST:#if:color|color=}} and |{{SAFESUBST:#if:thickness|thickness=}} as shown below:

Description Template code Resulting output
Styling brackets

The thickness, colour and state (solid, dashed, etc.) of bracket lines can be changed using the thickness=, |color= and |state= parameters.

<syntaxhighlight lang="wikitext">
Bracket styling
thickness

I

J

K

color

A

B

C

state

X

Y

Z

(no suffix)

</syntaxhighlight>

Bracket styling
thickness

I

J

K

color

A

B

C

state

X

Y

Z

(no suffix)
Styling individual branches

The thickness, colour and state of individual branch lines can be changed using the thicknessN=, |colorN= and |stateN= parameters, where N is the number of the branch to be styled.

<syntaxhighlight lang="wikitext">
Branch styling
thicknessN

1 (default)

2

3

colorN

black (default)

red

blue

 #00ff00

stateN

solid (default)

dotted

dashed

none

double

(append branch number)

</syntaxhighlight>


Branch styling
thicknessN

1 (default)

2

3

colorN

black (default)

red

blue

 #00ff00

stateN

solid (default)

dotted

dashed

none

double

(append branch number)

Reverse clade

The cladograms can also be generated right to left using {{cladeR}}, as shown below.

CodeOutput

<syntaxhighlight lang="wikitext">

snow leopard

tiger

jaguar

lion

leopard

Panthera
</syntaxhighlight>

snow leopard

tiger

jaguar

lion

leopard

Panthera

While this has limited value in English Wikipedia, it can be useful for presenting alternative phylogenies, e.g. as in the following example:

Panthera

snow leopard

tiger

jaguar

lion

leopard

 

 

 

 

 

 
alternative topology


Data in Newick format

A common method of presenting phylogenetic data is to use the Newick format. Many published papers provide data in Newick format in their supplementary materials and several taxonomic and phyogenetic websites provide downloads (e.g. Open Tree of Life). These Newick strings can be used to generate cladograms in several ways.

Newick strings as a resource

Firstly, the Newick format data can be used to generate the clade structure markup using a text editor or one of several tools.

The phylogenetic tree shown to the right is represented by the following Newick and {{Clade}} code

  • Newick format: ((a,b),(c,d))
  • Clade code: {{clade |1={{clade |1=a |2=b}} |2={{clade |1=c |2=d }} }} }}

The manual procedure for conversion in a text editor is

  1. Replace "(" with "{{clade|"
  2. Replace ")" with "}}"
  3. Edit to replace commas with pipes and numbers
  4. Edit clade labels if needed

Fortunately, there are a number of methods for automating this task.

  1. One method is to use the NewickConverter template (see instructions therein).
  2. 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.
  3. Example of a Perl script to automate the conversion:
<syntaxhighlight lang="perl">

use constant N=>"\n"; use constant T=>"\t";

my $tree='((a,b),(c,d));'; # get sequence $tree=~s/[\n\r]//g; # loose those spaces $tree=~ s/\:[\.\d]+//g; # loose those lengths while ($tree=~ m/\(/) { foreach my $clade ($tree=~ m/\(([^\(\)]+)\)/g) { my @branches=split /\,/,$clade; s/(\t+)/$1\t/g for @branches; die 'ERROR: degenerate/empty node!'.N if $#branches<1; $tree=~ s/\(\Q$clade\E\)/${\join(,'模板:Clade',N,map(T.'')}/; # substitute } pos($tree)=0; } $tree=~s/(\t*)\t\}\}/$1\}\}/g; # lazy fix

print $tree; </syntaxhighlight>

Using Newick strings directly

The Newick format data can also be added using the |{{SAFESUBST:#if:newickN|newickN=}}, where N refers to the child node (as with other parameters).

For instance, the following Newick string

<syntaxhighlight lang="wikitext">((lion,jaguar,leopard),((siberian,bengal)tiger,snow leopard))panthera</syntaxhighlight>

can be put in the clade code as in the following example:

DescriptionCodeOutputComment
Simple use of Newick strings

<syntaxhighlight lang="wikitext">

Label
big cats

clouded leopards

panthera

lion

jaguar

leopard

tiger

siberian

bengal

snow leopard

</syntaxhighlight>
big cats

clouded leopards

panthera

lion

jaguar

leopard

tiger

siberian

bengal

snow leopard

  • Note that |{{SAFESUBST:#if:newick2|newick2=}} causes |{{SAFESUBST:#if:2|2=}} to be ignored.
  • The red shaded area shows the part of the cladogram generated from the Newick string

The Newick format data provided Open Tree of Life and other sources typically has extraneous encoding data. This can be removed using the |{{SAFESUBST:#if:newickN-pattern|newickN-pattern=}} and |{{SAFESUBST:#if:newickN-replace|newickN-replace=}} parameters which supply a Lua pattern (similar to Regex) and replacement. The following code uses Newick format data for the genus Prionailurus downloaded from using Open Tree of Life (source data): <syntaxhighlight lang="wikitext">

P. 

P. planiceps

P. b. 

P. b. chinensis

P. b. euptilurus

P. b. b.

P. b. rabori

P. iriomotensis

P. viverrinus

P. rubiginosus

}}</syntaxhighlight>

produces

Prionailurus 

P. planiceps

P. bengalensis 

P. b. chinensis

P. b. euptilurus

P. b. bengalensis

P. b. rabori

P. iriomotensis

P. viverrinus

P. rubiginosus

Using a box

You can nest the templates and use links around the text. You may use non-breaking spaces (&nbsp;) to obtain spaces or to have labels that have spaces.

The entire cladogram can be placed in a box so that text flows nicely around it. You can use {{Cladogram}} to produce the box.

{{#if:Example| {{#if: | {{#if:Sample of {{Cladogram}}|
left = margin:0.2em 1em 0.2em 0; float:left; clear:left; centre = margin:0.2em auto; none = #default = margin:0.2em 0 0.2em 1em; float:right; clear:right;

}} "

Example

}}

Neornithes  
Paleognathae

 

 Neognathae 
 

Other birds

Galloanserae 

Anseriformes

    

Galliformes

Craciformes

}}

Sample of {{Cladogram}}

}}

<syntaxhighlight lang="wikitext">

{{#if:Example| {{#if: | {{#if:Sample of {{Cladogram}}|
left = margin:0.2em 1em 0.2em 0; float:left; clear:left; centre = margin:0.2em auto; none = #default = margin:0.2em 0 0.2em 1em; float:right; clear:right;

}} "

Example

}}

Neornithes  
Paleognathae

 

 Neognathae 
 

Other birds

Galloanserae 

Anseriformes

    

Galliformes

Craciformes

}}

Sample of {{Cladogram}}

}}

</syntaxhighlight>

Controlling the layout of sisters

When one sister is represented as a leaf node and the other as a labelled subclade, they do not appear to be at the same level. Consider this cladogram: 分配用于运行脚本的时间已到期。 Although Banksia subser. Sphaerocarpae and Banksia subser. Leptophyllae are sisters, their names are not aligned in the cladogram. If this is considered undesirable, one solution is to use a label in both cases, as shown hereafter, which now shows the sisters at the same level. 分配用于运行脚本的时间已到期。 Another 'trick' is to introduce a dummy clade. The red line in the following example shows where an extra clade has been inserted: 分配用于运行脚本的时间已到期。

To achieve this, instead of <syntaxhighlight lang="wikitext"> 分配用于运行脚本的时间已到期。 </syntaxhighlight> which displays as: 分配用于运行脚本的时间已到期。 use <syntaxhighlight lang="wikitext"> 分配用于运行脚本的时间已到期。 </syntaxhighlight> which displays as: 分配用于运行脚本的时间已到期。

Bracketting and labelling nodes

Adding vertical bars and brackets

To insert a coloured 'bracket' around a set of leaf nodes which follow one another in the generated cladogram:

  • Add barbeginN=colour for the first leaf node, where N is the order of that leaf node within its clade, and colour is the required colour.
  • Add barN=colour for the remaining nodes other than the last (note that N must be the order of that node within its clade).
  • Add barendN=colour for the last node.

分配用于运行脚本的时间已到期。

Note the using of the non-breaking space ( ) to move the vertical bar from the leaf text.

The horizontal lines can be omitted by using |barN=colour throughout. Thus the following produces simple vertical bars:

分配用于运行脚本的时间已到期。

Specifying bracket colours

You can use any of the ways in which colours can be specified in HTML; e.g. the standard colour names, the three or six hex digit notations, such as #FC3 or #F3C630, or the rgb() notation.

Adding text labels to brackets

Accessibility guidelines require pages not to rely on colour alone, so it's particularly important to add labels if you have more than one bracket/bar and need to refer to them separately. A couple of methods are available.

  1. Text labels for each bracket/bar can be added using {{Barlabel}} (see instructions at template page).
  2. Use the |{{SAFESUBST:#if:grouplabelN|grouplabelN=}} parameter. This adds a label to the right of the righthand bracket or bar, as shown in the following example. The right hand column illustrates how |{{SAFESUBST:#if:grouplabel|grouplabel=}} adds an HTML cell to the right of the terminal leaf.

分配用于运行脚本的时间已到期。

In the example above grouplabel was used to label a bar marking the entire clade. It provided an alternative to labelA. However, if the bar is only applied to some terminals, |{{SAFESUBST:#if:grouplabelN|grouplabelN=}} can be used to mark paraphyletic groups. The following example also demonstrates the use of |{{SAFESUBST:#if:grouplabelstyleN|grouplabelstyleN=}} to apply CSS styling to the grouplabel, in this case the color.

分配用于运行脚本的时间已到期。

The |{{SAFESUBST:#if:grouplabel|grouplabel=}} parameter can be used to add multiple labels with the aid of the {{clade labels}} template. This template uses absolute CSS positioning to determine the placement of the label. When applied to a |{{SAFESUBST:#if:grouplabel1|grouplabel1=}} parameter on the outer clade it behaves very similarly to {{barlabel}}. A simple example to label two groups is shown below:

分配用于运行脚本的时间已到期。

The |{{SAFESUBST:#if:grouplabel|grouplabel=}} parameter can contain any Wikitext or allowed HTML content and this offers a lot of flexibility in customising cladograms. The following example uses |{{SAFESUBST:#if:grouplabel|grouplabel=}} to add an alternative topology using {{cladeR}}:

分配用于运行脚本的时间已到期。</syntaxhighlight> |output1=分配用于运行脚本的时间已到期。 }}

Debugging

If your cladogram doesn't display brackets/bars as you expected, check that:

  • You understand the numbering system for the parameters barN, etc. The N must be the same as the number of the child within its clade. Thus typically you should write |N=label for leaf|barN=colour for bar, e.g. |2=[[Passeridae]]|bar2=midnightblue.
  • You have only attempted to apply brackets/bars to leaf nodes.

Limitations

Label length

Labels produced by |labelN=, where N 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 |N=.) To avoid problems:

  • 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.
  • Line breaks (i.e. <br/>) should not be used.

Browser differences

文件:Cladograms - browser variation.png
Browser variation: left – most browsers; right – Safari

Cladograms are drawn by generating hidden tables. The horizontal and vertical lines making up the tree are actually the edges of table cells. The tables are then drawn by the browser or user agent using its internal algorithms. As these differ from browser to browser, the trees produced will not look the same on all browsers.

In particular, {{#if: | {{{alt}}} | {{#if:||{{#if:{{safesubst:#switch:

|no
|n
|f
|false
|off
|0        = 
|         = 
|¬        = 
|yes
|y
|t
|true
|on
|1        = yes
|#default = yes

}}|{{#if: {{safesubst:#switch: yes

|no
|n
|f
|false
|off
|0        = 
|         = 
|¬        = 
|yes
|y
|t
|true
|on
|1        = yes
|#default = yes

}} | s | S }}ince | {{#if: {{safesubst:#switch: yes

|no
|n
|f
|false
|off
|0        = 
|         = 
|¬        = 
|yes
|y
|t
|true
|on
|1        = yes
|#default = yes

}} | a | A }}s of}}}} {{#if:|{{{pre}}} }}{{#if: | {{#ifeq:|us|{{#if:January|{{#switch:{{#if:January

|{{#switch:january
 |january|jan=1
 |february|feb=2
 |march|mar=3
 |apr|april=4
 |may=5
 |june|jun=6
 |july|jul=7
 |august|aug=8
 |september|sep|sept=9
 |october|oct=10
 |november|nov=11
 |december|dec=12
 |{{#ifexpr:January<0
  |{{#ifexpr:((January)round 0)!=(January)
   |{{#expr:12-(((0.5-(January))round 0)mod 12)}}
   |{{#expr:12-(((11.5-(January))round 0)mod 12)}}
  }}
 |{{#expr:(((10.5+January)round 0)mod 12)+1}}
 }}
}}
|Missing required parameter 1=month!

}}|1=January|2=February|3=March|4=April|5=May|6=June|7=July|8=August|9=September|10=October|11=November|12=December|Incorrect required parameter 1=month!}}|Missing required parameter 1=month!}} {{#expr:{{{3}}}}}, |{{#expr:{{{3}}}}} {{#if:January|{{#switch:{{#if:January

|{{#switch:january
 |january|jan=1
 |february|feb=2
 |march|mar=3
 |apr|april=4
 |may=5
 |june|jun=6
 |july|jul=7
 |august|aug=8
 |september|sep|sept=9
 |october|oct=10
 |november|nov=11
 |december|dec=12
 |{{#ifexpr:January<0
  |{{#ifexpr:((January)round 0)!=(January)
   |{{#expr:12-(((0.5-(January))round 0)mod 12)}}
   |{{#expr:12-(((11.5-(January))round 0)mod 12)}}
  }}
 |{{#expr:(((10.5+January)round 0)mod 12)+1}}
 }}
}}
|Missing required parameter 1=month!

}}|1=January|2=February|3=March|4=April|5=May|6=June|7=July|8=August|9=September|10=October|11=November|12=December|Incorrect required parameter 1=month!}}|Missing required parameter 1=month!}} }}2017|{{#if: January |{{#if:January|{{#switch:{{#if:January

|{{#switch:january
 |january|jan=1
 |february|feb=2
 |march|mar=3
 |apr|april=4
 |may=5
 |june|jun=6
 |july|jul=7
 |august|aug=8
 |september|sep|sept=9
 |october|oct=10
 |november|nov=11
 |december|dec=12
 |{{#ifexpr:January<0
  |{{#ifexpr:((January)round 0)!=(January)
   |{{#expr:12-(((0.5-(January))round 0)mod 12)}}
   |{{#expr:12-(((11.5-(January))round 0)mod 12)}}
  }}
 |{{#expr:(((10.5+January)round 0)mod 12)+1}}
 }}
}}
|Missing required parameter 1=month!

}}|1=January|2=February|3=March|4=April|5=May|6=June|7=July|8=August|9=September|10=October|11=November|12=December|Incorrect required parameter 1=month!}}|Missing required parameter 1=month!}} }}2017}}}}{{#if:|{{{post}}}}}{{#ifeq:{{ safesubst:#if: 分配用于运行脚本的时间已到期。

 | {{ safesubst:#titleparts:{{ safesubst:#if:|{{{1}}}|模板:Clade/doc}}|1}}
 | {{ safesubst:#if:|{{{1}}}|模板:Clade/doc}}

}}|Wikipedia:Template messages||{{#ifexpr:{{#if:模板|0|1}}+{{#ifeq:yes|yes|0|1}}

|{{#if:{{#if: {{#ifexpr: 2017 = 1 }} |{{#ifexpr:{{#time:U|2017}} > {{#time:U}} | the future | {{#ifexpr: {{#time:Y|2017}} > 2004 | 2017 | {{#ifexpr: {{#time:Y|2017}} > 1989 | {{#time:Y|2017}} | before 1990 }}}}}} |{{#ifexpr: 2017 > 2004 | {{#ifexpr:{{#time:U|{{#if:January | {{#if:January|{{#switch:{{#if:January
|{{#switch:january
 |january|jan=1
 |february|feb=2
 |march|mar=3
 |apr|april=4
 |may=5
 |june|jun=6
 |july|jul=7
 |august|aug=8
 |september|sep|sept=9
 |october|oct=10
 |november|nov=11
 |december|dec=12
 |{{#ifexpr:January<0
  |{{#ifexpr:((January)round 0)!=(January)
   |{{#expr:12-(((0.5-(January))round 0)mod 12)}}
   |{{#expr:12-(((11.5-(January))round 0)mod 12)}}
  }}
 |{{#expr:(((10.5+January)round 0)mod 12)+1}}
 }}
}}
|Missing required parameter 1=month!

}}|1=January|2=February|3=March|4=April|5=May|6=June|7=July|8=August|9=September|10=October|11=November|12=December|Incorrect required parameter 1=month!}}|Missing required parameter 1=month!}}}} 2017}} > {{#time:U}} | the future| {{#if:January | {{#if:January|{{#switch:{{#if:January

|{{#switch:january
 |january|jan=1
 |february|feb=2
 |march|mar=3
 |apr|april=4
 |may=5
 |june|jun=6
 |july|jul=7
 |august|aug=8
 |september|sep|sept=9
 |october|oct=10
 |november|nov=11
 |december|dec=12
 |{{#ifexpr:January<0
  |{{#ifexpr:((January)round 0)!=(January)
   |{{#expr:12-(((0.5-(January))round 0)mod 12)}}
   |{{#expr:12-(((11.5-(January))round 0)mod 12)}}
  }}
 |{{#expr:(((10.5+January)round 0)mod 12)+1}}
 }}
}}
|Missing required parameter 1=month!

}}|1=January|2=February|3=March|4=April|5=May|6=June|7=July|8=August|9=September|10=October|11=November|12=December|Incorrect required parameter 1=month!}}|Missing required parameter 1=month!}} }} 2017}} | {{#ifexpr:2017 > 1989 | 2017 | before 1990 }}}}}}

 |[[Category:Articles containing potentially dated statements from {{#if: {{#ifexpr: 2017 = 1 }} |{{#ifexpr:{{#time:U|2017}} > {{#time:U}} | the future | {{#ifexpr: {{#time:Y|2017}} > 2004 | 2017 | {{#ifexpr: {{#time:Y|2017}} > 1989 | {{#time:Y|2017}} | before 1990 }}}}}} |{{#ifexpr: 2017 > 2004 | {{#ifexpr:{{#time:U|{{#if:January | {{#if:January|{{#switch:{{#if:January
|{{#switch:january
 |january|jan=1
 |february|feb=2
 |march|mar=3
 |apr|april=4
 |may=5
 |june|jun=6
 |july|jul=7
 |august|aug=8
 |september|sep|sept=9
 |october|oct=10
 |november|nov=11
 |december|dec=12
 |{{#ifexpr:January<0
  |{{#ifexpr:((January)round 0)!=(January)
   |{{#expr:12-(((0.5-(January))round 0)mod 12)}}
   |{{#expr:12-(((11.5-(January))round 0)mod 12)}}
  }}
 |{{#expr:(((10.5+January)round 0)mod 12)+1}}
 }}
}}
|Missing required parameter 1=month!

}}|1=January|2=February|3=March|4=April|5=May|6=June|7=July|8=August|9=September|10=October|11=November|12=December|Incorrect required parameter 1=month!}}|Missing required parameter 1=month!}}}} 2017}} > {{#time:U}} | the future| {{#if:January | {{#if:January|{{#switch:{{#if:January

|{{#switch:january
 |january|jan=1
 |february|feb=2
 |march|mar=3
 |apr|april=4
 |may=5
 |june|jun=6
 |july|jul=7
 |august|aug=8
 |september|sep|sept=9
 |october|oct=10
 |november|nov=11
 |december|dec=12
 |{{#ifexpr:January<0
  |{{#ifexpr:((January)round 0)!=(January)
   |{{#expr:12-(((0.5-(January))round 0)mod 12)}}
   |{{#expr:12-(((11.5-(January))round 0)mod 12)}}
  }}
 |{{#expr:(((10.5+January)round 0)mod 12)+1}}
 }}
}}
|Missing required parameter 1=month!

}}|1=January|2=February|3=March|4=April|5=May|6=June|7=July|8=August|9=September|10=October|11=November|12=December|Incorrect required parameter 1=month!}}|Missing required parameter 1=month!}} }} 2017}} | {{#ifexpr:2017 > 1989 | 2017 | before 1990 }}}}}}]]{{#ifexist:Category:Articles containing potentially dated statements from {{#if: {{#ifexpr: 2017 = 1 }} |{{#ifexpr:{{#time:U|2017}} > {{#time:U}} | the future | {{#ifexpr: {{#time:Y|2017}} > 2004 | 2017 | {{#ifexpr: {{#time:Y|2017}} > 1989 | {{#time:Y|2017}} | before 1990 }}}}}} |{{#ifexpr: 2017 > 2004 | {{#ifexpr:{{#time:U|{{#if:January | {{#if:January|{{#switch:{{#if:January

|{{#switch:january
 |january|jan=1
 |february|feb=2
 |march|mar=3
 |apr|april=4
 |may=5
 |june|jun=6
 |july|jul=7
 |august|aug=8
 |september|sep|sept=9
 |october|oct=10
 |november|nov=11
 |december|dec=12
 |{{#ifexpr:January<0
  |{{#ifexpr:((January)round 0)!=(January)
   |{{#expr:12-(((0.5-(January))round 0)mod 12)}}
   |{{#expr:12-(((11.5-(January))round 0)mod 12)}}
  }}
 |{{#expr:(((10.5+January)round 0)mod 12)+1}}
 }}
}}
|Missing required parameter 1=month!

}}|1=January|2=February|3=March|4=April|5=May|6=June|7=July|8=August|9=September|10=October|11=November|12=December|Incorrect required parameter 1=month!}}|Missing required parameter 1=month!}}}} 2017}} > {{#time:U}} | the future| {{#if:January | {{#if:January|{{#switch:{{#if:January

|{{#switch:january
 |january|jan=1
 |february|feb=2
 |march|mar=3
 |apr|april=4
 |may=5
 |june|jun=6
 |july|jul=7
 |august|aug=8
 |september|sep|sept=9
 |october|oct=10
 |november|nov=11
 |december|dec=12
 |{{#ifexpr:January<0
  |{{#ifexpr:((January)round 0)!=(January)
   |{{#expr:12-(((0.5-(January))round 0)mod 12)}}
   |{{#expr:12-(((11.5-(January))round 0)mod 12)}}
  }}
 |{{#expr:(((10.5+January)round 0)mod 12)+1}}
 }}
}}
|Missing required parameter 1=month!

}}|1=January|2=February|3=March|4=April|5=May|6=June|7=July|8=August|9=September|10=October|11=November|12=December|Incorrect required parameter 1=month!}}|Missing required parameter 1=month!}} }} 2017}} | {{#ifexpr:2017 > 1989 | 2017 | before 1990 }}}}}}

   ||}}
 |[[Category:{{#if:
              ||Articles containing potentially dated statements}}]]}}{{#if:All articles containing potentially dated statements
     |}}}}}}分配用于运行脚本的时间已到期。, there are two algorithms for laying out tables with empty cells, used by two groups of browsers. Most browsers now use the algorithm that produces cladograms like the two on the left in the diagram. Safari (under both MacOS and iOS) uses another algorithm, producing cladograms like the two on the right in the diagram.

No automated "fix" for these differences exists at present.

If there is a choice over the ordering of the terminal nodes (leaves) of the tree, cladograms look best in a Safari-like browser if as much branching as possible is at the bottom of the cladogram. Typically this is produced by arranging the terminal nodes downwards on the page in order of their evolutionary divergence. Compare the bottom row of the diagram to the top row.

Inclusion in books

There are many known bugs in rendering tables in the software which produces Wikipedia books; see the book tool feedback page. {{#if: | {{{alt}}} | {{#if:||{{#if:{{safesubst:#switch:

|no
|n
|f
|false
|off
|0        = 
|         = 
|¬        = 
|yes
|y
|t
|true
|on
|1        = yes
|#default = yes

}}|{{#if: {{safesubst:#switch:

|no
|n
|f
|false
|off
|0        = 
|         = 
|¬        = 
|yes
|y
|t
|true
|on
|1        = yes
|#default = yes

}} | s | S }}ince | {{#if: {{safesubst:#switch:

|no
|n
|f
|false
|off
|0        = 
|         = 
|¬        = 
|yes
|y
|t
|true
|on
|1        = yes
|#default = yes

}} | a | A }}s of}}}} {{#if:|{{{pre}}} }}{{#if: | {{#ifeq:|us|{{#if:July|{{#switch:{{#if:July

|{{#switch:july
 |january|jan=1
 |february|feb=2
 |march|mar=3
 |apr|april=4
 |may=5
 |june|jun=6
 |july|jul=7
 |august|aug=8
 |september|sep|sept=9
 |october|oct=10
 |november|nov=11
 |december|dec=12
 |{{#ifexpr:July<0
  |{{#ifexpr:((July)round 0)!=(July)
   |{{#expr:12-(((0.5-(July))round 0)mod 12)}}
   |{{#expr:12-(((11.5-(July))round 0)mod 12)}}
  }}
 |{{#expr:(((10.5+July)round 0)mod 12)+1}}
 }}
}}
|Missing required parameter 1=month!

}}|1=January|2=February|3=March|4=April|5=May|6=June|7=July|8=August|9=September|10=October|11=November|12=December|Incorrect required parameter 1=month!}}|Missing required parameter 1=month!}} {{#expr:}}, |{{#expr:}} {{#if:July|{{#switch:{{#if:July

|{{#switch:july
 |january|jan=1
 |february|feb=2
 |march|mar=3
 |apr|april=4
 |may=5
 |june|jun=6
 |july|jul=7
 |august|aug=8
 |september|sep|sept=9
 |october|oct=10
 |november|nov=11
 |december|dec=12
 |{{#ifexpr:July<0
  |{{#ifexpr:((July)round 0)!=(July)
   |{{#expr:12-(((0.5-(July))round 0)mod 12)}}
   |{{#expr:12-(((11.5-(July))round 0)mod 12)}}
  }}
 |{{#expr:(((10.5+July)round 0)mod 12)+1}}
 }}
}}
|Missing required parameter 1=month!

}}|1=January|2=February|3=March|4=April|5=May|6=June|7=July|8=August|9=September|10=October|11=November|12=December|Incorrect required parameter 1=month!}}|Missing required parameter 1=month!}} }}2011|{{#if: July |{{#if:July|{{#switch:{{#if:July

|{{#switch:july
 |january|jan=1
 |february|feb=2
 |march|mar=3
 |apr|april=4
 |may=5
 |june|jun=6
 |july|jul=7
 |august|aug=8
 |september|sep|sept=9
 |october|oct=10
 |november|nov=11
 |december|dec=12
 |{{#ifexpr:July<0
  |{{#ifexpr:((July)round 0)!=(July)
   |{{#expr:12-(((0.5-(July))round 0)mod 12)}}
   |{{#expr:12-(((11.5-(July))round 0)mod 12)}}
  }}
 |{{#expr:(((10.5+July)round 0)mod 12)+1}}
 }}
}}
|Missing required parameter 1=month!

}}|1=January|2=February|3=March|4=April|5=May|6=June|7=July|8=August|9=September|10=October|11=November|12=December|Incorrect required parameter 1=month!}}|Missing required parameter 1=month!}} }}2011}}}}{{#if:|{{{post}}}}}{{#ifeq:{{ safesubst:#if: 分配用于运行脚本的时间已到期。

 | {{ safesubst:#titleparts:{{ safesubst:#if:|{{{1}}}|模板:Clade/doc}}|1}}
 | {{ safesubst:#if:|{{{1}}}|模板:Clade/doc}}

}}|Wikipedia:Template messages||{{#ifexpr:{{#if:模板|0|1}}+{{#ifeq:yes|yes|0|1}}

|{{#if:{{#if: {{#ifexpr: 2011 = 1 }} |{{#ifexpr:{{#time:U|2011}} > {{#time:U}} | the future | {{#ifexpr: {{#time:Y|2011}} > 2004 | 2011 | {{#ifexpr: {{#time:Y|2011}} > 1989 | {{#time:Y|2011}} | before 1990 }}}}}} |{{#ifexpr: 2011 > 2004 | {{#ifexpr:{{#time:U|{{#if:July | {{#if:July|{{#switch:{{#if:July
|{{#switch:july
 |january|jan=1
 |february|feb=2
 |march|mar=3
 |apr|april=4
 |may=5
 |june|jun=6
 |july|jul=7
 |august|aug=8
 |september|sep|sept=9
 |october|oct=10
 |november|nov=11
 |december|dec=12
 |{{#ifexpr:July<0
  |{{#ifexpr:((July)round 0)!=(July)
   |{{#expr:12-(((0.5-(July))round 0)mod 12)}}
   |{{#expr:12-(((11.5-(July))round 0)mod 12)}}
  }}
 |{{#expr:(((10.5+July)round 0)mod 12)+1}}
 }}
}}
|Missing required parameter 1=month!

}}|1=January|2=February|3=March|4=April|5=May|6=June|7=July|8=August|9=September|10=October|11=November|12=December|Incorrect required parameter 1=month!}}|Missing required parameter 1=month!}}}} 2011}} > {{#time:U}} | the future| {{#if:July | {{#if:July|{{#switch:{{#if:July

|{{#switch:july
 |january|jan=1
 |february|feb=2
 |march|mar=3
 |apr|april=4
 |may=5
 |june|jun=6
 |july|jul=7
 |august|aug=8
 |september|sep|sept=9
 |october|oct=10
 |november|nov=11
 |december|dec=12
 |{{#ifexpr:July<0
  |{{#ifexpr:((July)round 0)!=(July)
   |{{#expr:12-(((0.5-(July))round 0)mod 12)}}
   |{{#expr:12-(((11.5-(July))round 0)mod 12)}}
  }}
 |{{#expr:(((10.5+July)round 0)mod 12)+1}}
 }}
}}
|Missing required parameter 1=month!

}}|1=January|2=February|3=March|4=April|5=May|6=June|7=July|8=August|9=September|10=October|11=November|12=December|Incorrect required parameter 1=month!}}|Missing required parameter 1=month!}} }} 2011}} | {{#ifexpr:2011 > 1989 | 2011 | before 1990 }}}}}}

 |[[Category:Articles containing potentially dated statements from {{#if: {{#ifexpr: 2011 = 1 }} |{{#ifexpr:{{#time:U|2011}} > {{#time:U}} | the future | {{#ifexpr: {{#time:Y|2011}} > 2004 | 2011 | {{#ifexpr: {{#time:Y|2011}} > 1989 | {{#time:Y|2011}} | before 1990 }}}}}} |{{#ifexpr: 2011 > 2004 | {{#ifexpr:{{#time:U|{{#if:July | {{#if:July|{{#switch:{{#if:July
|{{#switch:july
 |january|jan=1
 |february|feb=2
 |march|mar=3
 |apr|april=4
 |may=5
 |june|jun=6
 |july|jul=7
 |august|aug=8
 |september|sep|sept=9
 |october|oct=10
 |november|nov=11
 |december|dec=12
 |{{#ifexpr:July<0
  |{{#ifexpr:((July)round 0)!=(July)
   |{{#expr:12-(((0.5-(July))round 0)mod 12)}}
   |{{#expr:12-(((11.5-(July))round 0)mod 12)}}
  }}
 |{{#expr:(((10.5+July)round 0)mod 12)+1}}
 }}
}}
|Missing required parameter 1=month!

}}|1=January|2=February|3=March|4=April|5=May|6=June|7=July|8=August|9=September|10=October|11=November|12=December|Incorrect required parameter 1=month!}}|Missing required parameter 1=month!}}}} 2011}} > {{#time:U}} | the future| {{#if:July | {{#if:July|{{#switch:{{#if:July

|{{#switch:july
 |january|jan=1
 |february|feb=2
 |march|mar=3
 |apr|april=4
 |may=5
 |june|jun=6
 |july|jul=7
 |august|aug=8
 |september|sep|sept=9
 |october|oct=10
 |november|nov=11
 |december|dec=12
 |{{#ifexpr:July<0
  |{{#ifexpr:((July)round 0)!=(July)
   |{{#expr:12-(((0.5-(July))round 0)mod 12)}}
   |{{#expr:12-(((11.5-(July))round 0)mod 12)}}
  }}
 |{{#expr:(((10.5+July)round 0)mod 12)+1}}
 }}
}}
|Missing required parameter 1=month!

}}|1=January|2=February|3=March|4=April|5=May|6=June|7=July|8=August|9=September|10=October|11=November|12=December|Incorrect required parameter 1=month!}}|Missing required parameter 1=month!}} }} 2011}} | {{#ifexpr:2011 > 1989 | 2011 | before 1990 }}}}}}]]{{#ifexist:Category:Articles containing potentially dated statements from {{#if: {{#ifexpr: 2011 = 1 }} |{{#ifexpr:{{#time:U|2011}} > {{#time:U}} | the future | {{#ifexpr: {{#time:Y|2011}} > 2004 | 2011 | {{#ifexpr: {{#time:Y|2011}} > 1989 | {{#time:Y|2011}} | before 1990 }}}}}} |{{#ifexpr: 2011 > 2004 | {{#ifexpr:{{#time:U|{{#if:July | {{#if:July|{{#switch:{{#if:July

|{{#switch:july
 |january|jan=1
 |february|feb=2
 |march|mar=3
 |apr|april=4
 |may=5
 |june|jun=6
 |july|jul=7
 |august|aug=8
 |september|sep|sept=9
 |october|oct=10
 |november|nov=11
 |december|dec=12
 |{{#ifexpr:July<0
  |{{#ifexpr:((July)round 0)!=(July)
   |{{#expr:12-(((0.5-(July))round 0)mod 12)}}
   |{{#expr:12-(((11.5-(July))round 0)mod 12)}}
  }}
 |{{#expr:(((10.5+July)round 0)mod 12)+1}}
 }}
}}
|Missing required parameter 1=month!

}}|1=January|2=February|3=March|4=April|5=May|6=June|7=July|8=August|9=September|10=October|11=November|12=December|Incorrect required parameter 1=month!}}|Missing required parameter 1=month!}}}} 2011}} > {{#time:U}} | the future| {{#if:July | {{#if:July|{{#switch:{{#if:July

|{{#switch:july
 |january|jan=1
 |february|feb=2
 |march|mar=3
 |apr|april=4
 |may=5
 |june|jun=6
 |july|jul=7
 |august|aug=8
 |september|sep|sept=9
 |october|oct=10
 |november|nov=11
 |december|dec=12
 |{{#ifexpr:July<0
  |{{#ifexpr:((July)round 0)!=(July)
   |{{#expr:12-(((0.5-(July))round 0)mod 12)}}
   |{{#expr:12-(((11.5-(July))round 0)mod 12)}}
  }}
 |{{#expr:(((10.5+July)round 0)mod 12)+1}}
 }}
}}
|Missing required parameter 1=month!

}}|1=January|2=February|3=March|4=April|5=May|6=June|7=July|8=August|9=September|10=October|11=November|12=December|Incorrect required parameter 1=month!}}|Missing required parameter 1=month!}} }} 2011}} | {{#ifexpr:2011 > 1989 | 2011 | before 1990 }}}}}}

   ||}}
 |[[Category:{{#if:
              ||Articles containing potentially dated statements}}]]}}{{#if:All articles containing potentially dated statements
     |}}}}}}分配用于运行脚本的时间已到期。 these result in the lines in cladograms not displaying in books. (Cladograms are implemented as HTML tables, which allows complex but hard-to-convert formatting. For an alternative

way to include book cladograms, try images.)

Large cladograms

There are limitations on the size and complexity of the cladograms which can be drawn:

  • A maximum of 20 children is allowed per node.

分配用于运行脚本的时间已到期。

  • The Wikimedia software has certain limits on the processing allowed by templates and modules. Large cladograms can potentially exceed some of these limits.
    • Post-expand include size. Essentially this is the output of all templates, modules and parser calls. Pages with very large or several large cladograms will occasionally exceed this limit, especially on larger pages with many references and other demands on the system.
    • Template expansion depth limit. When a template is used it adds to the expansion depth, once for the template expansion and once for parameter expansion. As a result, template calls can only be nested 20 deep. Because cladograms are built by nesting templates within each other this is a common problem on larger phylogenetic trees. Fortunately there are now ways around this problem (see following section ).

Techniques for building large cladograms.

Because cladograms are build by nesting {{clade}} templates within each other, larger cladograms can exceed the expansion depth allowed by the Wikimedia software. The cladogram on the right fails on the twentieth nested clade template.

There are two methods to get around this limitation:

Using sequential listing of taxa

This approach uses the template {{clade sequential}} to list taxa in a taxonomic sequence. In the following example six taxa are listed sequentially in the template and the cladogram has the first one as the first branch, the second next and so on until the final two are sisters. Because all taxa are added in one template call, this only counts once towards the 20 limit. The downside is that it is not possible to format each level independently.

分配用于运行脚本的时间已到期。

The second example shows that some substructure can be added to each level with normal use of the {{clade}} template.


Using subtrees

This method uses the parameters |{{SAFESUBST:#if:target|target=}} and |{{SAFESUBST:#if:subclade|subclade=}} to "modularise" the phylogenetic tree. Each subtree is processed in parallel so they don't contribute to the expansion depth in an additive manner. The limit applies to each tree, but many subtrees can be used.

The basic arrangement is illustrated below. The main tree has two subclades, A and B, and subclade B calls a third.

{{clade example |decription=|code=|output=

|description1x=Basic tree without subclades |code1=<syntaxhighlight lang="wikitext">分配用于运行脚本的时间已到期。

The encoding relies on a number of conventions.

  • The names of the subclades are in uppercase and enclosed in a single brace. This is not absolutely necessary, as long as the names are unique, but some advanced features (e.g. partial tranclusion) rely on this convention.
  • The parameters |{{SAFESUBST:#if:subcladeA|subcladeA=}}, |{{SAFESUBST:#if:subcladeB|subcladeB=}}, ... |{{SAFESUBST:#if:subcladeZ|subcladeZ=}} contain the subtrees in clade structure that will be substituted into the main tree.
  • The parameters |{{SAFESUBST:#if:targetA|targetA=}}, |{{SAFESUBST:#if:targetB|targetB=}}, ... |{{SAFESUBST:#if:subcladeZ|subcladeZ=}} contain the targets where the subtrees will be substituted. For instance, |{{SAFESUBST:#if:targetA|targetA=}}{SUBCLADE_A} indicates that the target {SUBCLADE_A} will be replaced by the content of |{{SAFESUBST:#if:subcladeA|subcladeA=}}content.
  • The target parameters may be omitted and the default targets are {SUBCLADE_A} and {SUBCLADE_B} for |{{SAFESUBST:#if:subcladeA|subcladeA=}} and |{{SAFESUBST:#if:subcladeB|subcladeB=}}, respectively.
  • The suffixes A-Z were chosen because these parameters don't correspond the other numbered parameters used by the template (e.g. |{{SAFESUBST:#if:1|1=}}, |{{SAFESUBST:#if:label2|label2=}} etc.
  • The subclades can all be listed in the outer clade template or nested within the appropriate tree. For instance, in the example subclade C is listed at the end of the outer clade template but this could have been nested in the clade template attached to subtree B.

An example of a large phylogenetic tree divided into multiple subtrees can be found at {{Phylogeny/APG IV}}.

Add interactivity with collapsible clades

分配用于运行脚本的时间已到期。 Sometimes with large phylogenetic trees it is hard to see the wood for the trees. The cladogram may exceed the screen height making it difficult to see the overall structure and important small clades are too hard to see. A way around this is to collapse the large clades and expand them interactively.

The following example shows a simple example to illustrate the principle:

分配用于运行脚本的时间已到期。

A note of caution. The Wikimedia collapsible elements require javascript and are currently disabled in the mobile view. In such cases the whole cladogram will be shown. As with any large phylogentic trees, editors should decide if having a smaller less inclusive tree makes the point more clearly.

Graphical summary

分配用于运行脚本的时间已到期。