You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+54-2
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
jsPhyloSVG
2
-
==========
2
+
----------
3
3
4
4
jsPhyloSVG is an open-source javascript library specifically built for rendering highly-extensible, customizable phylogenetic trees. jsPhyloSVG can render complex trees, yet offers a simple method to do so. It leverages the recent XML schema definition specified for phylogenetic trees, phyloXML.
5
5
@@ -11,6 +11,58 @@ Future
11
11
======
12
12
I still think it is useful and has potential in other projects as a starting point. So, I am placing the old v1.55 code here, as there was no original public source-managed repository of their code and I couldn't find anyone else with a submission. Hopefully, as the code was released under GPL that is acceptable, and maybe some others will fork and add to the features, I am happy to receive pull requests etc. I intend to use it for a few demo projects of my own and will probably put them in a different branch...
13
13
14
+
### jsPhyloSVG-Color ###
15
+
16
+
17
+
The PhyloXML standard allows adding color to branches and node names
18
+
in the XML. The original `jsphylosvg.js` code ignores the color
19
+
tags. `jsphylosvg-color.js` automatically colors branches and nodes
20
+
according to the PhyloXML standard.
21
+
22
+
#### Coloring branches ####
23
+
24
+
Add the `color` tag like this:
25
+
26
+
```xml
27
+
<clade>
28
+
<name>a</name>
29
+
<branch_length>1.8</branch_length>
30
+
<color>
31
+
<red>255</red>
32
+
<green>0</green>
33
+
<blue>0</blue>
34
+
</color>
35
+
</clade>
36
+
```
37
+
38
+
and the branch connecting to label `a` will be colored red.
39
+
40
+
#### A larger example ####
41
+
42
+
```xml
43
+
<clade>
44
+
<branch_length>2.0</branch_length>
45
+
<confidencetype="bootstrap">75</confidence>
46
+
<propertyref="style:font_color"datatype="xsd:token"applies_to="node">#ff00ff</property> <!-- color the bootstrap label -->
47
+
<color> <!-- to color the branch leading to the bootstrap label -->
48
+
<red>153</red>
49
+
<green>255</green>
50
+
<blue>153</blue>
51
+
</color>
52
+
<clade>
53
+
<name>b</name>
54
+
<branch_length>1.3</branch_length>
55
+
<propertyref="style:font_color"datatype="xsd:token"applies_to="node">#ff9933</property> <!-- color branch label 'b' -->
56
+
</clade>
57
+
</clade>
58
+
```
59
+
60
+
##### Running this example #####
61
+
62
+
See `examples/color` for a working examle. `cd` into that directory
63
+
and run `python -m SimpleHTTPServer` to set up a server. Then navigate
64
+
to the `color.html` page in Firefox (Chrome doesn't want to render the
0 commit comments