Skip to content

Commit

Permalink
Add mouseover remove test case
Browse files Browse the repository at this point in the history
  • Loading branch information
cmdcolin committed Feb 16, 2018
1 parent ef5cf50 commit 8ff1083
Show file tree
Hide file tree
Showing 4 changed files with 71 additions and 3 deletions.
19 changes: 18 additions & 1 deletion docs/tutorial/data_files/functions.conf
Expand Up @@ -18,4 +18,21 @@ nameViaCallback = function(feature) {
return feature.get('Name')+' (via JS callback)';
}


chromHMM = function(feature) {
if(feature.get('Name')=='1_TssA') { return 'red'; }
else if(feature.get('Name')=='2_TssAFlnk') { return 'lightred'; }
else if(feature.get('Name')=='3_TxFlnk') { return 'purple'; }
else if(feature.get('Name')=='4_Tx') { return 'orange'; }
else if(feature.get('Name')=='5_TxWk') { return 'orange' }
else if(feature.get('Name')=='6_EnhG') { return 'yellow'; }
else if(feature.get('Name')=='7_Enh') { return 'yellow'; }
else if(feature.get('Name')=='8_ZNFRpts') { return 'blue'; }
else if(feature.get('Name')=='9_Het') { return 'darkgreen'; }
else if(feature.get('Name')=='10_TssBiv') { return 'darkgreen'; }
else if(feature.get('Name')=='11_BivFlnk') { return 'lightgreen'; }
else if(feature.get('Name')=='12_EnhBiv') { return 'grey'; }
else if(feature.get('Name')=='13_ReprPC') { return 'lightgrey'; }
else if(feature.get('Name')=='14_ReprPCWk') { return 'lightgrey'; }
else if(feature.get('Name')=='15_Quies') { return 'lightgrey'; }
else return 'black';
}
49 changes: 49 additions & 0 deletions docs/tutorial/data_files/volvox_segment.bed
@@ -0,0 +1,49 @@
ctgA 0 11960 15_Quies
ctgA 11960 12040 1_TssA
ctgA 12040 13620 14_ReprPCWk
ctgA 13620 13940 15_Quies
ctgA 13940 14520 9_Het
ctgA 14520 16280 15_Quies
ctgA 16280 16500 9_Het
ctgA 16500 17620 15_Quies
ctgA 17620 17660 7_Enh
ctgA 17660 17700 5_TxWk
ctgA 17700 17720 7_Enh
ctgA 17720 17860 5_TxWk
ctgA 17860 17880 7_Enh
ctgA 17880 17920 2_TssAFlnk
ctgA 17920 18000 1_TssA
ctgA 18000 18060 10_TssBiv
ctgA 18060 18260 1_TssA
ctgA 18260 18280 2_TssAFlnk
ctgA 18280 18300 1_TssA
ctgA 18300 18320 2_TssAFlnk
ctgA 18320 19560 15_Quies
ctgA 19560 19780 9_Het
ctgA 19780 20960 15_Quies
ctgA 20960 21020 7_Enh
ctgA 21020 22960 15_Quies
ctgA 22960 23000 9_Het
ctgA 23000 23040 15_Quies
ctgA 23040 23080 9_Het
ctgA 23080 23780 15_Quies
ctgA 23780 23860 7_Enh
ctgA 23860 29120 15_Quies
ctgA 29120 29360 5_TxWk
ctgA 29360 29560 4_Tx
ctgA 29560 29740 5_TxWk
ctgA 29740 31540 15_Quies
ctgA 31540 31580 7_Enh
ctgA 31580 34240 15_Quies
ctgA 34240 37560 5_TxWk
ctgA 37560 37580 7_Enh
ctgA 37580 41980 5_TxWk
ctgA 41980 42020 7_Enh
ctgA 42020 42500 15_Quies
ctgA 42500 42540 1_TssA
ctgA 42540 44020 5_TxWk
ctgA 44020 44100 7_Enh
ctgA 44100 45960 15_Quies
ctgA 45960 46000 1_TssA
ctgA 46000 46880 5_TxWk
ctgA 46880 50000 15_Quies
1 change: 1 addition & 0 deletions setup.sh
Expand Up @@ -136,6 +136,7 @@ echo -n "Formatting Volvox example data ...";
cat docs/tutorial/data_files/bookmarks.conf >> sample_data/json/volvox/tracks.conf
bin/add-json.pl '{ "dataset_id": "volvox", "include": [ "../../raw/volvox/functions.conf" ] }' sample_data/json/volvox/trackList.json
bin/add-json.pl '{ "dataset_id": "volvox", "plugins": [ "NeatHTMLFeatures","NeatCanvasFeatures","HideTrackLabels" ] }' sample_data/json/volvox/trackList.json
bin/flatfile-to-json.pl --bed docs/tutorial/data_files/volvox_segment.bed --out sample_data/json/volvox --trackLabel ChromHMM --trackType CanvasFeatures --clientConfig '{"color": "{chromHMM}", "strandArrow": false}' --config '{"displayMode": "collapsed", "removeCollapsedMouseover": false}';
bin/generate-names.pl --safeMode -v --out sample_data/json/volvox;

# also recreate some symlinks used by tests and such
Expand Down
5 changes: 3 additions & 2 deletions src/JBrowse/View/Track/CanvasFeatures.js
Expand Up @@ -117,6 +117,7 @@ return declare(
lang.clone( this.inherited(arguments) ),
{
maxFeatureScreenDensity: 0.5,
removeCollapsedMouseover: true,

// default glyph class to use
glyph: lang.hitch( this, 'guessGlyphType' ),
Expand Down Expand Up @@ -715,7 +716,7 @@ return declare(
var gv = this.browser.view;
var thisB = this;

if( this.displayMode == 'collapsed' ) {
if( this.displayMode == 'collapsed' && this.config.removeCollapsedMouseover) {
if( this._mouseoverEvent ) {
this._mouseoverEvent.remove();
delete this._mouseoverEvent;
Expand All @@ -725,7 +726,7 @@ return declare(
this._mouseoutEvent.remove();
delete this._mouseoutEvent;
}
} else {
} else if( this.displayMode != 'collapsed' || !this.config.removeCollapsedMouseover ) {
if( !this._mouseoverEvent ) {
this._mouseoverEvent = this.own( on( this.staticCanvas, 'mousemove', function( evt ) {
evt = domEvent.fix( evt );
Expand Down

0 comments on commit 8ff1083

Please sign in to comment.