Fixes for Trackster and Circster, mostly around preference selection and usage.

This commit is contained in:
Jeremy Goecks
2014-07-01 18:27:15 -04:00
parent 8f52bfffa2
commit 46d9937ff5
4 changed files with 14 additions and 8 deletions
+4 -4
View File
@@ -32,7 +32,7 @@ var ConfigSetting = Backbone.Model.extend({
* Cast and set value. This should be instead of
* setting.set('value', new_value)
*/
set_value: function(value) {
set_value: function(value, options) {
var type = this.get('type');
if (type === 'float') {
@@ -43,7 +43,7 @@ var ConfigSetting = Backbone.Model.extend({
}
// TODO: handle casting from string to bool?
this.set('value', value);
this.set({value: value}, options);
}
}, {
// This is a master list of default settings for known settings.
@@ -101,10 +101,10 @@ var ConfigSettingCollection = Backbone.Collection.extend({
/**
* Set value for a setting.
*/
set_value: function(key, value) {
set_value: function(key, value, options) {
var s = this.get(key);
if (s) {
return s.set_value(value);
return s.set_value(value, options);
}
return undefined;
+7 -2
View File
@@ -620,8 +620,13 @@ var CircsterTrackView = Backbone.View.extend({
$.when(track.get('data_manager').get_genome_wide_data(this.genome)).then(function(genome_wide_data) {
// Set bounds.
self.data_bounds = self.get_data_bounds(genome_wide_data);
track.get('config').set_value('min_value', self.data_bounds[0]);
track.get('config').set_value('max_value', self.data_bounds[1]);
// Set min, max value in config so that they can be adjusted. Make this silent
// because these attributes are watched for changes and the viz is updated
// accordingly (set up in initialize). Because we are setting up, we don't want
// the watch to trigger events here.
track.get('config').set_value('min_value', self.data_bounds[0], {silent: true});
track.get('config').set_value('max_value', self.data_bounds[1], {silent: true});
// Merge chroms layout with data.
layout_and_data = _.zip(chrom_arcs, genome_wide_data),
+2 -1
View File
@@ -994,7 +994,8 @@ var TracksterView = Backbone.View.extend({
};
}));
});
}
},
minLength: 2
});
});
if (this.vis_id !== undefined) {
+1 -1
View File
@@ -894,7 +894,7 @@ var BackboneTrack = Backbone.Model.extend(CustomToJSON).extend({
// -- Set up config settings. --
var models = [
{ key: 'name', value: this.get('dataset').get('name') },
{ key: 'name', default_value: this.get('dataset').get('name') },
{ key: 'color' },
{ key: 'min_value', label: 'Min Value', type: 'float', default_value: 0 },
{ key: 'max_value', label: 'Max Value', type: 'float', default_value: 1 }