Skip to content

Commit 7db811e

Browse files
committed
Merge branch 'master' of github.com:d-callan/TidyTree
2 parents 707bfc5 + efa3570 commit 7db811e

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
@@ -683,7 +683,7 @@ <h5 class="modal-title" id="exportModalLabel">Export</h5>
683683
type: d3.select("#type").node().value,
684684
colorOptions:
685685
{
686-
colorMode: "none",
686+
colorMode: "list",
687687
defaultColor: d3.select("#defaultColor").node().value,
688688
highlightColor: d3.select("#highlightColor").node().value,
689689
},
@@ -759,6 +759,9 @@ <h5 class="modal-title" id="exportModalLabel">Export</h5>
759759
});
760760

761761
d3.select("#highlightColor").on("input", function() {
762+
if (!d3.select("#highlightLeaves").property("checked")) {
763+
d3.select("#highlightLeaves").property("checked",true);
764+
}
762765
tree.setColorOptions({
763766
colorMode: d3.select("#highlightLeaves").node().value ? "list" : "none",
764767
defaultColor: d3.select("#defaultColor").node().value,
@@ -768,8 +771,8 @@ <h5 class="modal-title" id="exportModalLabel">Export</h5>
768771
});
769772

770773
d3.select("#highlightLeaves").on("input", function() {
771-
console.log("tree", tree.getNodeGUIDs(true));
772-
if (this.value) {
774+
// console.log("tree", tree.getNodeGUIDs(this.value));
775+
if (d3.select("#highlightLeaves").property("checked")) {
773776
tree.setColorOptions({
774777
colorMode: "list",
775778
defaultColor: d3.select("#defaultColor").node().value,
@@ -780,7 +783,8 @@ <h5 class="modal-title" id="exportModalLabel">Export</h5>
780783
tree.setColorOptions({
781784
colorMode: "none",
782785
defaultColor: d3.select("#defaultColor").node().value,
783-
highlightColor: d3.select("#highlightColor").node().value
786+
highlightColor: d3.select("#highlightColor").node().value,
787+
nodeList: tree.getNodeGUIDs(false)
784788
})
785789
}
786790
});

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
@@ -381,7 +381,7 @@ function findNodeColor(node, colorOptions) {
381381

382382
let nodeList = colorOptions.nodeList;
383383

384-
if (nodeList.includes(node.data._guid)) {
384+
if (nodeList && nodeList.includes(node.data._guid)) {
385385
// charcoal
386386
return colorOptions.highlightColor ?? "#feb640";
387387
} else {

0 commit comments

Comments
 (0)