Skip to content

Commit bf16b40

Browse files
committed
Merge branch 'master' into color-branches
2 parents 9a41cbb + 7db811e commit bf16b40

File tree

4 files changed

+11
-7
lines changed

4 files changed

+11
-7
lines changed

app/index.html

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -690,7 +690,7 @@ <h5 class="modal-title" id="exportModalLabel">Export</h5>
690690
type: d3.select("#type").node().value,
691691
colorOptions:
692692
{
693-
colorMode: "none",
693+
colorMode: "list",
694694
defaultColor: d3.select("#defaultColor").node().value,
695695
highlightColor: d3.select("#highlightColor").node().value,
696696
},
@@ -766,6 +766,9 @@ <h5 class="modal-title" id="exportModalLabel">Export</h5>
766766
});
767767

768768
d3.select("#highlightColor").on("input", function() {
769+
if (!d3.select("#highlightLeaves").property("checked")) {
770+
d3.select("#highlightLeaves").property("checked",true);
771+
}
769772
tree.setColorOptions({
770773
colorMode: d3.select("#highlightLeaves").node().value ? "list" : "none",
771774
defaultColor: d3.select("#defaultColor").node().value,
@@ -775,8 +778,8 @@ <h5 class="modal-title" id="exportModalLabel">Export</h5>
775778
});
776779

777780
d3.select("#highlightLeaves").on("input", function() {
778-
console.log("tree", tree.getNodeGUIDs(true));
779-
if (this.value) {
781+
// console.log("tree", tree.getNodeGUIDs(this.value));
782+
if (d3.select("#highlightLeaves").property("checked")) {
780783
tree.setColorOptions({
781784
colorMode: "list",
782785
defaultColor: d3.select("#defaultColor").node().value,
@@ -787,7 +790,8 @@ <h5 class="modal-title" id="exportModalLabel">Export</h5>
787790
tree.setColorOptions({
788791
colorMode: "none",
789792
defaultColor: d3.select("#defaultColor").node().value,
790-
highlightColor: d3.select("#highlightColor").node().value
793+
highlightColor: d3.select("#highlightColor").node().value,
794+
nodeList: tree.getNodeGUIDs(false)
791795
})
792796
}
793797
});

dist/tidytree.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1628,7 +1628,7 @@ var TidyTree = (function () {
16281628

16291629
let nodeList = colorOptions.nodeList;
16301630

1631-
if (nodeList.includes(node.data._guid)) {
1631+
if (nodeList && nodeList.includes(node.data._guid)) {
16321632
// charcoal
16331633
return colorOptions.highlightColor ?? "#feb640";
16341634
} else {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"version": "0.5.9",
2+
"version": "0.6.0",
33
"description": "Uncompromisingly Flexible Phylogenetic Trees, Powered by D3.js",
44
"name": "tidytree",
55
"main": "dist/tidytree.js",

src/main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,7 @@ function findNodeColor(node, colorOptions) {
387387

388388
let nodeList = colorOptions.nodeList;
389389

390-
if (nodeList.includes(node.data._guid)) {
390+
if (nodeList && nodeList.includes(node.data._guid)) {
391391
// yellowish
392392
return colorOptions.highlightColor ?? "#feb640";
393393
} else {

0 commit comments

Comments
 (0)