Template:Clade/doc

From Project: Jotunnheim
Jump to navigation Jump to search

__EXPECTED_UNCONNECTED_PAGE__

Lua error in Module:TNT at line 159: 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 <syntaxhighlight lang="wikitext" inline style="display: none;" />|state=, <syntaxhighlight lang="wikitext" inline style="display: none;" />|color= and <syntaxhighlight lang="wikitext" inline style="display: none;" />|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

Navigation menu