Change default settings, avoid flickering on startup

This commit is contained in:
guerler
2017-02-15 11:44:04 -05:00
parent 48639028df
commit c390da3cbd
6 changed files with 60 additions and 1651 deletions
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -45,6 +45,24 @@ define( [], function() {
{ label : 'Unitcell', value : 'unitcell' } ]
}
},
radius: {
name : 'radius',
label : 'Radius',
help : 'Select a number providing a fixed radius used for rendering the representation.',
type : 'float',
min : 0.001,
max : 10.0,
value : 0.05
},
scale: {
name : 'scale',
label : 'Scale',
help : 'Select a number that scales the value defined by the *radius* parameter.',
type : 'float',
min : 0.001,
max : 10.0,
value : 0.7
},
colorscheme : {
label : 'Color Scheme',
help : 'Select color scheme of the molecule scene.',
@@ -88,24 +106,6 @@ define( [], function() {
value : false,
data : [ { label : 'On', value : true }, { label : 'Off', value : false } ]
},
radius: {
name : 'radius',
label : 'Radius',
help : 'Select a number providing a fixed radius used for rendering the representation.',
type : 'float',
min : 0.001,
max : 10.0,
value : 0.7
},
scale: {
name : 'scale',
label : 'Scale',
help : 'Select a number that scales the value defined by the *radius* parameter.',
type : 'float',
min : 0.001,
max : 10.0,
value : 0.7
},
assembly : {
label : 'Assembly',
help : 'Select a name of an assembly object.',
@@ -21,12 +21,16 @@ define( [ 'utilities/utils', "plugins/ngl/viewer" ], function( Utils, ngl ) {
opacity: settings.get( 'opacity' )
};
stage_parameters = { ext: dataset.extension, name: dataset.name, defaultRepresentation: true };
stage.loadFile( dataset.download_url, stage_parameters ).then( function( component ) {
component.addRepresentation( viewer_options.mode, representation_parameters );
component.centerView();
options.chart.state( 'ok', 'Chart drawn.' );
try {
stage.loadFile( dataset.download_url, stage_parameters ).then( function( component ) {
component.addRepresentation( viewer_options.mode, representation_parameters );
options.chart.state( 'ok', 'Chart drawn.' );
options.process.resolve();
} );
} catch( e ) {
options.chart.state( 'failed', 'Could not load PDB file.' );
options.process.resolve();
} );
}
stage.setQuality( settings.get( 'quality' ) );
if( settings.get( 'spin' ) === true || settings.get( 'spin' ) === 'true' ) {
stage.setSpin( [ 0, 1, 0 ], 0.01 );