@@ -182,6 +182,8 @@ $(function() {
182182 smoothing : false ,
183183 bp_shift : false ,
184184 hide : false ,
185+ hide_forward : false ,
186+ hide_reverse : false ,
185187 files_loaded : 0 ,
186188 secondary_color : null ,
187189
@@ -487,101 +489,36 @@ $(function() {
487489 . on ( "mouseup" , function ( ) { $ ( row . node ( ) ) . settings_row ( "toggle_draggable" , true ) } )
488490 . on ( "mousedown" , function ( ) { $ ( row . node ( ) ) . settings_row ( "toggle_draggable" , false ) } )
489491
490- positive = hide_strand_col . append ( "div" )
491- . attr ( "title" , "positive " )
492+ forward = hide_strand_col . append ( "div" )
493+ . attr ( "title" , "forward " )
492494 . style ( "float" , "left" )
493495 . style ( "margin-right" , "15px" )
494- positive . append ( "label" )
495- . text ( "Positive:" )
496- let positive_open = positive . append ( "div" )
497- . attr ( "title" , "Hide" )
498- . style ( "display" , "inline" )
499- . append ( "svg" )
500- . classed ( "hide-icon" , true )
501- . classed ( "eye-open" , true )
502- . attr ( "baseProfile" , "full" )
503- . attr ( "viewBox" , "-100 -100 200 200" )
504- . attr ( "version" , "1.1" )
505- . attr ( "xmlns" , "http://www.w3.org/2000/svg" )
506- . on ( "click" , function ( ) { $ ( row . node ( ) ) . settings_row ( "toggle_positive" , true ) } )
507- . append ( "g" ) ;
508- positive_open . append ( "path" )
509- . attr ( "d" , "M-100 0C-50 60 50 60 100 0C50 -60 -50 -60 -100 0" )
510- . attr ( "fill" , "none" )
511- . attr ( "stroke" , "black" )
512- . attr ( "stroke-width" , 3 ) ;
513- positive_open . append ( "circle" )
514- . attr ( "cx" , 0 )
515- . attr ( "cy" , 0 )
516- . attr ( "r" , 30 )
517- . attr ( "fill" , "black" )
518- . attr ( "stroke" , "none" ) ;
519- let positive_closed = positive . append ( "div" )
520- . attr ( "title" , "Show" )
521- . append ( "svg" )
522- . classed ( "hide-icon" , true )
523- . classed ( "eye-closed" , true )
524- . attr ( "title" , "Show" )
525- . attr ( "baseProfile" , "full" )
526- . attr ( "viewBox" , "-100 -100 200 200" )
527- . attr ( "version" , "1.1" )
528- . attr ( "xmlns" , "http://www.w3.org/2000/svg" )
529- . style ( "display" , "none" )
530- . on ( "click" , function ( ) { $ ( row . node ( ) ) . settings_row ( "toggle_positive" , false ) } )
531- . append ( "g" ) ;
532- positive_closed . append ( "path" )
533- . attr ( "d" , "M-100 0C-50 60 50 60 100 0M-66.77 27.7L-74.21 40.78M-24.62 42.82L-27.26 57.58M24.62 42.82L27.26 57.58M66.77 27.7L74.21 40.78" )
534- . attr ( "fill" , "none" )
535- . attr ( "stroke" , "black" )
536- . attr ( "stroke-width" , 3 ) ;
496+ forward . append ( "label" )
497+ . text ( "Show forward:" )
498+ forward . append ( "input" )
499+ . attr ( "type" , "checkbox" )
500+ . classed ( "direction_checkbox" , true )
501+ . style ( "transform" , "scale(1.2)" )
502+ . on ( "input" , function ( ) {
503+ self . toggle_forward ( ! d3 . select ( this ) . property ( "checked" ) ) ;
504+ } )
505+
506+
537507
538- negative = hide_strand_col . append ( "div" )
539- . attr ( "title" , "negative " )
540- negative . append ( "label" )
541- . text ( "Negative :" )
508+ reverse = hide_strand_col . append ( "div" )
509+ . attr ( "title" , "reverse " )
510+ reverse . append ( "label" )
511+ . text ( "Show reverse :" )
542512 . style ( "display" , "inline" )
543-
544- let negative_open = negative . append ( "div" )
545- . attr ( "title" , "Hide Negative" )
546- . style ( "display" , "inline" )
547- . append ( "svg" )
548- . classed ( "hide-icon" , true )
549- . classed ( "eye-open" , true )
550- . attr ( "baseProfile" , "full" )
551- . attr ( "viewBox" , "-100 -100 200 200" )
552- . attr ( "version" , "1.1" )
553- . attr ( "xmlns" , "http://www.w3.org/2000/svg" )
554- . on ( "click" , function ( ) { $ ( row . node ( ) ) . settings_row ( "toggle_positive" , true ) } )
555- . append ( "g" ) ;
556- negative_open . append ( "path" )
557- . attr ( "d" , "M-100 0C-50 60 50 60 100 0C50 -60 -50 -60 -100 0" )
558- . attr ( "fill" , "none" )
559- . attr ( "stroke" , "black" )
560- . attr ( "stroke-width" , 3 ) ;
561- negative_open . append ( "circle" )
562- . attr ( "cx" , 0 )
563- . attr ( "cy" , 0 )
564- . attr ( "r" , 30 )
565- . attr ( "fill" , "black" )
566- . attr ( "stroke" , "none" ) ;
567- let negative_closed = negative . append ( "div" )
568- . attr ( "title" , "Show" )
569- . append ( "svg" )
570- . classed ( "hide-icon" , true )
571- . classed ( "eye-closed" , true )
572- . attr ( "title" , "Show" )
573- . attr ( "baseProfile" , "full" )
574- . attr ( "viewBox" , "-100 -100 200 200" )
575- . attr ( "version" , "1.1" )
576- . attr ( "xmlns" , "http://www.w3.org/2000/svg" )
577- . style ( "display" , "none" )
578- . on ( "click" , function ( ) { $ ( row . node ( ) ) . settings_row ( "toggle_positive" , false ) } )
579- . append ( "g" ) ;
580- negative_closed . append ( "path" )
581- . attr ( "d" , "M-100 0C-50 60 50 60 100 0M-66.77 27.7L-74.21 40.78M-24.62 42.82L-27.26 57.58M24.62 42.82L27.26 57.58M66.77 27.7L74.21 40.78" )
582- . attr ( "fill" , "none" )
583- . attr ( "stroke" , "black" )
584- . attr ( "stroke-width" , 3 ) ;
513+ reverse . append ( "input" )
514+ . attr ( "type" , "checkbox" )
515+ . classed ( "direction_checkbox" , true )
516+ . style ( "transform" , "scale(1.2)" )
517+ . on ( "input" , function ( ) {
518+ self . toggle_reverse ( ! d3 . select ( this ) . property ( "checked" ) ) ;
519+ } )
520+
521+ self . toggle_direction_checkboxes ( false ) ;
585522
586523 reset_col . append ( "input" )
587524 . attr ( "type" , "button" )
@@ -591,6 +528,35 @@ $(function() {
591528 . on ( "click" , function ( ) { $ ( row . node ( ) ) . settings_row ( "reset" ) } ) ;
592529 } ,
593530
531+ toggle_direction_checkboxes : function ( hide ) {
532+ this . hide_forward = hide ;
533+ this . hide_reverse = hide ;
534+ if ( hide ) {
535+ d3 . select ( this . element . context ) . selectAll ( "input.direction_checkbox" )
536+ . attr ( "disabled" , true )
537+ . property ( 'checked' , false ) ;
538+ d3 . select ( this . element . context ) . selectAll ( "td.hide-strand-col" )
539+ . style ( "opacity" , ".5" ) ;
540+ } else {
541+ d3 . select ( this . element . context ) . selectAll ( "input.direction_checkbox" )
542+ . attr ( "disabled" , null )
543+ . property ( 'checked' , true ) ;
544+ d3 . select ( this . element . context ) . selectAll ( "td.hide-strand-col" )
545+ . style ( "opacity" , "1" ) ;
546+ }
547+ this . plot_composite ( ) ;
548+ } ,
549+
550+ toggle_forward : function ( hide ) {
551+ this . hide_forward = hide ;
552+ this . plot_composite ( ) ;
553+ } ,
554+
555+ toggle_reverse : function ( hide ) {
556+ this . hide_reverse = hide ;
557+ this . plot_composite ( )
558+ } ,
559+
594560 // Remove the row
595561 _destroy : function ( ) {
596562 d3 . select ( this . element . context ) . remove ( )
@@ -732,7 +698,7 @@ $(function() {
732698 // Plot composite data
733699 plot_composite : function ( ) {
734700 if ( this . files_loaded ) {
735- $ ( "#main-plot" ) . main_plot ( "plot_composite" , this . xmin , this . xmax , this . sense , this . anti , this . scale , this . options . color , this . options . separate_color && this . secondary_color , this . options . idx , this . opacity , this . smoothing , this . bp_shift , this . hide )
701+ $ ( "#main-plot" ) . main_plot ( "plot_composite" , this . xmin , this . xmax , this . sense , this . anti , this . scale , this . options . color , this . options . separate_color && this . secondary_color , this . options . idx , this . opacity , this . smoothing , this . bp_shift , this . hide , this . hide_forward , this . hide_reverse )
736702 }
737703 } ,
738704
@@ -867,6 +833,7 @@ $(function() {
867833 . style ( "display" , hide ? "none" : null ) ;
868834 hide_col . select ( ".eye-closed" )
869835 . style ( "display" , hide ? null : "none" ) ;
836+ this . toggle_direction_checkboxes ( hide )
870837
871838 if ( plot && this . files_loaded ) {
872839 $ ( "#main-plot" ) . main_plot ( "toggle_hide" , this . options . idx , hide )
0 commit comments