Skip to content

Commit

Permalink
rename trackSelectorType conf var to trackSelector.type
Browse files Browse the repository at this point in the history
  • Loading branch information
rbuels committed Jun 5, 2012
1 parent 3e8f2c2 commit 450c553
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 13 deletions.
22 changes: 16 additions & 6 deletions jbrowse_conf.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
// JBrowse JSON-format configuration file
{
trackSelectorType: 'Faceted',
trackMetadata: { sources: [] },
trackSelector: {
displayColumns: ['key', 'organism', 'technique', 'target', 'factor', 'developmental-stage','principal_investigator','submission' ],
renameFacets: { 'developmental-stage': 'Conditions', submission: 'Submission ID' }
}

// uncomment the lines below to configure a faceted track selector
// trackSelector: {
// type: 'Faceted',
// displayColumns: ['key', 'organism', 'technique', 'target', 'factor', 'developmental-stage','principal_investigator','submission' ],
// renameFacets: { 'developmental-stage': 'Conditions', submission: 'Submission ID' }
// },
// trackMetadata: {
// filterFacets: [ 'category', 'organism','target','technique','principal_investigator','factor','developmental-stage','strain','cell-line','tissue','compound','temperature' ],
// sources: [
// { url: 'sample_data/json/modencode/modencodeMetaData.json', 'class': 'JBrowse.Model.modEncodeTrackMetadata' }
// ]
// },

// the variable below does nothing
placeholder: 1
}
11 changes: 5 additions & 6 deletions js/Browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -502,14 +502,13 @@ Browser.prototype.createTrackList = function() {

// find the tracklist class to use
var resolved_tl_class = function() {
var tl_class = this.config.show_tracklist == 0 ? 'Null' :
this.config.trackSelectorType ? this.config.trackSelectorType :
'Simple';
tl_class.replace(/[^\.\w\d]/g, ''); // sanitize tracklist class for security
return JBrowse.View.TrackList[tl_class] || eval( tl_class );
var tl_class = this.config.show_tracklist == 0 ? 'Null' :
(this.config.trackSelector||{}).type ? this.config.trackSelector.type :
'Simple';
return JBrowse.View.TrackList[tl_class] || eval( tl_class.replace(/[^\.\w\d]/g, '') ); // sanitize tracklist class for a little security
}.call(this);
if( !resolved_tl_class ) {
console.error("configured trackSelectorType "+tl_class+" not found, falling back to JBrowse.View.TrackList.Simple");
console.error("configured trackSelector.type "+tl_class+" not found, falling back to JBrowse.View.TrackList.Simple");
resolved_tl_class = JBrowse.View.TrackList.Simple;
}

Expand Down
2 changes: 1 addition & 1 deletion sample_data/json/modencode/trackList.json

Large diffs are not rendered by default.

0 comments on commit 450c553

Please sign in to comment.