Open main menu
Home
Random
Donate
Recent changes
Special pages
Community portal
Preferences
About Stockhub
Disclaimers
Search
User menu
Talk
Contributions
Create account
Log in
Editing
Module:Sandbox/Jts1882/CladeN/doc
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{Module rating |beta<!-- Values: pre-alpha β’ alpha β’ beta β’ release β’ protected -- If a rating not needed/relevant, delete this template call -->}} <!-- Please place categories where indicated at the bottom of this page and interwikis at Wikidata (see [[Wikipedia:Wikidata]]) --> {{uses TemplateStyles|Template:CladeN/styles.css|Template:Clade gallery/styles.css}} This module is designed to be used with the [[User:Jts1882/sandbox/templates/CladeN|CladeN]] template to draw phylogenetic trees or cladograms. The new template-module combination extends the feature available with the [[Template:Clade|clade]] and [[Template:Cladex|cladex]] templates. As it replicates the behaviour of the clade and cladex templates it should be suitable for replacing them. Additionally, the module as the code for a prototype [User:Jts1882/sandbox/templates/NewickConverter|NewickConverter] template, which converts Newick strings into clade structure. This is not to be used in wikipedia articles, but is a utility to help construct cladograms for inclusion in articles. === Usage === <code><nowiki>{{</nowiki>#invoke:{{BASEPAGENAME}}|main|style={{{style}}}}}</code> ===Examples=== Simple examples mimicking the clade template: * [[User:Jts1882/sandbox/templates/Template:Passeroidea]] * [[User:Jts1882/sandbox/templates/Template:Passerida]] Example demonstrating more advanced features of cladeN: * [[User:Jts1882/sandbox/test/Felidae]] Example demonstrating features available: {{User:Jts1882/sandbox/test/Newick tree}} ===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 a table and the lines of the cladogram are borders of the cells. {| class="wikitable" ! Description ! Table cell structure ! Cladogram ! Code using clade template |- | style="width:25%;" |<p>A simple clade structure with a single child node (or leaf).</p><p>This is an HTML table with two rows and two columns. The upper and lower cells in the left column hold the labels provided by {{para|label}} and {{para|sublabel}} parameters, respectively. The the cells of the righthand column are merged using the rowspan attribute.</p> |style="padding:50px" | {| style="line-height:100%;border:1px dotted red;margin:1px;" |- | style="border:1px dotted green;border-bottom:3px solid black;text-align:center;" | labelA | rowspan=2 style="border:1px dotted green;padding:0.1em;" | Leaf A |- | style="border:1px dotted green;" | sublabelA |} |style="padding:20px" | {{cladeN |thickness=3 |label1=labelA |sublabel1=sublabelA |1=LeafA }} |style="padding:20px" |<pre> {{cladeN |thickness=3 |label1=labelA |sublabel1=sublabelA |1=LeafA }}</pre> |- | style="width:20%;" |<p>To build the cladogram, a the text in LeafA can be replaced with another clade structure.</p><p>Hence a second HTML table is placed inside a the right-hand cell of the outer table.</p> |style="padding:50px" | {| style="line-height:100%;border:1px dotted red;margin:1px;" |- | style="border:1px dotted green;border-bottom:3px solid black;text-align:center;" | labelA | rowspan=2 style="border:1px dotted green;padding:0.1em;" | {| class="clade" style="line-height:100%;border:1px dotted red;margin:1px;" |- | style="border:1px dotted green;border-bottom:3px solid black;text-align:center;" | label1 | rowspan=2 style="border:1px dotted green;vertical-align:middle;padding:0 1em;" |leaf1 |- | style="border:1px dotted green;border-left:3px solid black;text-align:center;" | sublabel1 |- | style="border:1px dotted green;border-bottom:3px solid black;border-left:3px solid black;text-align:center;" | label2 | rowspan=2 style="border:1px dotted green;vertical-align:middle;padding:0 1em;" |leaf2 |- | style="border:1px dotted green;text-align:center;" | sublabel2 |} |- | style="border:1px dotted green;text-align:center;" | sublabelA |} |style="padding:20px" | {{cladeN |thickness=3 |label1=labelA |sublabel1=sublabelA |1={{cladeN |thickness=3 |label1=label1 |sublabel1=sublabel1 |1=leaf1 |label2=label2 |sublabel2=sublabel2 |2=leaf2 }} }} |style="padding:20px" |<pre> {{cladeN |thickness=3 |label1=labelA |sublabel1=sublabelA |1={{cladeN |thickness=3 |label1=label1 |sublabel1=sublabel1 |1=leaf1 |label2=label2 |sublabel2=sublabel2 |2=leaf2 }} }}</pre> |} ====Add right hand labels with grouplabel==== {| class="wikitable" ! Description ! Table cell structure ! Cladogram ! Code using clade template |- | style="width:25%;" | <p><span style="white-space:nowrap">Bar adds a solid line to the right</span> of the column containing the leaves.</p> <p>Group label adds an third column to the basic 2x2 clade structure. As with the leaf the two cells are merged using the rowspan attribute.</p> |style="padding:50px" | {| style="line-height:100%;border:1px dotted red;margin:1px;" |- | style="border:1px dotted green;border-bottom:3px solid black;text-align:center;" | labelA | rowspan=2 style="border:1px dotted green;border-right:2px solid blue;padding:0.2em;" | Leaf A | rowspan=2 style="border:1px dotted green;padding:0.2em;" | Grouplabel A |- | style="border:1px dotted green;" | sublabelA |} |style="padding:20px" | {{cladeN |thickness=3 |label1=labelA |sublabel1=sublabelA |1=Leaf A |bar1=blue |grouplabel1=Grouplabel A }} |style="padding:20px" |<pre> {{cladeN |thickness=3 |label1=labelA |sublabel1=sublabelA |1=Leaf A |bar1=blue |grouplabel1=Grouplabel A }}</pre> |- | style="width:20%;" |<p>To build the cladogram, the text in LeafA can be replaced with another clade structure.</p><p>Hence a second HTML table is placed inside a the right-hand cell of the outer table.</p> |style="padding:50px" | {| style="line-height:100%;border:1px dotted red;margin:1px;" |- | style="border:1px dotted green;border-bottom:3px solid black;text-align:center;" | labelA | rowspan=2 style="border:1px dotted green;border-right:2px solid blue; padding:0.2em;" | {| class="clade" style="line-height:100%;border:1px dotted red;margin:1px;" |- | style="border:1px dotted green;border-bottom:3px solid black;text-align:center;" | label1 | rowspan=2 style="border:1px dotted green;vertical-align:middle;padding:0 1em;" |leaf1 |- | style="border:1px dotted green;border-left:3px solid black;text-align:center;" | sublabel1 |- | style="border:1px dotted green;border-bottom:3px solid black;border-left:3px solid black;text-align:center;" | label2 | rowspan=2 style="border:1px dotted green;vertical-align:middle;padding:0 1em;" |leaf2 |- | style="border:1px dotted green;text-align:center;" | sublabel2 |} | rowspan=2 style="border:1px dotted green;padding:0.2em;" | Grouplabel A |- | style="border:1px dotted green;" | sublabelA |} |style="padding:20px" | {{cladeN |thickness=3 |label1=labelA |sublabel1=sublabelA |grouplabel1=Grouplabel A |bar1=blue |1={{cladeN |thickness=3 |label1=label1 |sublabel1=sublabel1 |1= leaf1 |label2=label2 |sublabel2=sublabel2 |2= leaf2 }} }} |style="padding:20px" |<pre> {{cladeN |thickness=3 |label1=labelA |sublabel1=sublabelA |grouplabel1=Grouplabel A |bar1=blue |1={{cladeN |thickness=3 |label1=label1 |sublabel1=sublabel1 |1=leaf1 |label2=label2 |sublabel2=sublabel2 |2=leaf2 }} }}</pre> |- | style="width:20%;" |<p>Grouplabels can be applied at any level.</p> |style="padding:50px" | {| style="line-height:100%;border:1px dotted red;margin:1px;" |- | style="border:1px dotted green;border-bottom:3px solid black;text-align:center;" | labelA | rowspan=2 style="border:1px dotted green;border-right:2px solid blue; padding:0.2em;" | {| class="clade" style="line-height:100%;border:1px dotted red;margin:1px;" |- | style="border:1px dotted green;border-bottom:3px solid black;text-align:center;" | label1 | rowspan=2 style="border:1px dotted green;vertical-align:middle;border-right:2px solid orange;padding:0 2em;" |leaf1 | rowspan=2 style="border:1px dotted green;vertical-align:middle;padding:0 2em;" |GL1 |- | style="border:1px dotted green;border-left:3px solid black;text-align:center;" | sublabel1 |- | style="border:1px dotted green;border-bottom:3px solid black;border-left:3px solid black;text-align:center;" | label2 | rowspan=2 style="border:1px dotted green;vertical-align:middle;border-right:2px solid purple;padding:0 2em;" |leaf2 | rowspan=2 style="border:1px dotted green;vertical-align:middle;padding:0 2em;" |GL2 |- | style="border:1px dotted green;text-align:center;" | sublabel2 |} | rowspan=2 style="border:1px dotted green;padding:0.2em;" | Grouplabel A |- | style="border:1px dotted green;text-align:center;" | sublabelA |} |style="padding:20px" | {{cladeN |thickness=3 |label1=labelA |sublabel1=sublabelA |grouplabel1=Grouplabel A |bar1=blue |1={{cladeN |thickness=3 |label1=label1 |sublabel1=sublabel1 |grouplabel1=GL1 |bar1=orange |1= leaf1 |label2=label2 |sublabel2=sublabel2 |grouplabel2=GL2 |bar2=purple |2= leaf2 }} }} |style="padding:20px" |<pre> {{cladeN |thickness=3 |label1=labelA |sublabel1=sublabelA |grouplabel1=Grouplabel A |bar1=blue |1={{cladeN |thickness=3 |label1=label1 |sublabel1=sublabel1 |grouplabel1=GL1 |bar1=orange |1= leaf1 |label2=label2 |sublabel2=sublabel2 |grouplabel2=GL2 |bar2=purple |2= leaf2 }} }}</pre> |} <includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox | | <!-- Categories below this line, please; interwikis at Wikidata --> }}</includeonly>
Summary:
Please note that all contributions to Stockhub may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Stockhub:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Templates used on this page:
User:Jts1882/sandbox/test/Newick tree
(
edit
)
Template:CladeN
(
edit
)
Template:Module rating
(
edit
)
Template:Para
(
edit
)
Template:Uses TemplateStyles
(
edit
)