@@ -396,7 +396,7 @@ <h5 class="mb-0">
396396 type ="color "
397397 id ="defaultColor "
398398 class ="skip "
399- value ="#243127 "
399+ value ="#4682B4 "
400400 >
401401 </ div >
402402 < div class ="form-group ">
@@ -674,7 +674,12 @@ <h5 class="modal-title" id="exportModalLabel">Export</h5>
674674 layout : d3 . select ( "#layout" ) . node ( ) . value ,
675675 mode : d3 . select ( "#mode" ) . node ( ) . value ,
676676 type : d3 . select ( "#type" ) . node ( ) . value ,
677- colorOptions : { colorMode : d3 . select ( "#colorMode" ) . node ( ) . value } ,
677+ colorOptions :
678+ {
679+ colorMode : d3 . select ( "#colorMode" ) . node ( ) . value ,
680+ defaultColor : d3 . select ( "#defaultColor" ) . node ( ) . value ,
681+ highlightColor : d3 . select ( "#highlightColor" ) . node ( ) . value ,
682+ } ,
678683 leafNodes : d3 . select ( "#leafNodes" ) . node ( ) . checked ,
679684 branchNodes : d3 . select ( "#branchNodes" ) . node ( ) . checked ,
680685 leafLabels : d3 . select ( "#leafLabels" ) . node ( ) . checked ,
@@ -720,11 +725,35 @@ <h5 class="modal-title" id="exportModalLabel">Export</h5>
720725 tree . setAnimation ( cached ) ;
721726 } ) ;
722727
723- // im considering how to change the coloroptions as part of this form
724- // maybe ill make a color section, separate of leaves and branches etc
725- // for now ill do this and let it grow
726728 d3 . select ( "#colorMode" ) . on ( "input" , function ( ) {
727- tree . setColorOptions ( { colorMode : this . value } ) ;
729+ // this could prove annoying, but ill leave it for now
730+ if ( this . value === "list" ) {
731+ d3 . select ( "#defaultColor" ) . node ( ) . value = "#243127" ;
732+ } else {
733+ d3 . select ( "#defaultColor" ) . node ( ) . value = "#4682B4" ;
734+ }
735+
736+ tree . setColorOptions ( {
737+ colorMode : this . value ,
738+ defaultColor : d3 . select ( "#defaultColor" ) . node ( ) . value ,
739+ highlightColor : d3 . select ( "#highlightColor" ) . node ( ) . value
740+ } ) ;
741+ } ) ;
742+
743+ d3 . select ( "#defaultColor" ) . on ( "input" , function ( ) {
744+ tree . setColorOptions ( {
745+ colorMode : d3 . select ( "#colorMode" ) . node ( ) . value ,
746+ defaultColor : this . value ,
747+ highlightColor : d3 . select ( "#highlightColor" ) . node ( ) . value
748+ } ) ;
749+ } ) ;
750+
751+ d3 . select ( "#highlightColor" ) . on ( "input" , function ( ) {
752+ tree . setColorOptions ( {
753+ colorMode : d3 . select ( "#colorMode" ) . node ( ) . value ,
754+ defaultColor : d3 . select ( "#defaultColor" ) . node ( ) . value ,
755+ highlightColor : this . value
756+ } ) ;
728757 } ) ;
729758
730759 d3 . select ( "#branchNodeSize" ) . on ( "input" , function ( ) {
0 commit comments