bioinsilico 4 jaren geleden
bovenliggende
commit
b5dd3d3215

+ 1 - 1
package.json

@@ -1,6 +1,6 @@
 {
   "name": "@rcsb/rcsb-saguaro-3d",
-  "version": "0.0.14",
+  "version": "0.0.15",
   "description": "RCSB Molstar/Saguaro Web App",
   "main": "build/dist/RcsbFv3DBuilder.js",
   "files": [

+ 5 - 5
src/RcsbFvSequence/SequenceViews/AssemblyView.tsx

@@ -58,20 +58,20 @@ export class AssemblyView extends AbstractView<AssemblyViewInterface & AbstractV
                 const x = e.begin;
                 const y = e.end ?? e.begin;
                 if(e.isEmpty){
+                    this.props.plugin.focusPositions(this.currentModelId, this.currentLabelAsymId, [x,y]);
                     const componentId: string = this.currentLabelAsymId +":"+ ((x === y) ? x.toString() : x.toString()+","+y.toString());
                     this.props.plugin.createComponentFromSet(
                         componentId,
                         this.currentModelId,
                         [{asymId: this.currentLabelAsymId, position: x}, {asymId: this.currentLabelAsymId, position: y}],
                         'ball-and-stick'
-                    )
-                    this.props.plugin.focusPositions(this.currentModelId, this.currentLabelAsymId, [x,y]);
+                    );
                 }else{
-                    const componentId: string = this.currentLabelAsymId +":"+ (x === y ? x.toString() : x.toString()+"-"+y.toString());
+                    this.props.plugin.focusRange(this.currentModelId, this.currentLabelAsymId, x, y);
                     if((y-x)<this.createComponentThreshold){
-                        this.props.plugin.createComponentFromRange(componentId, this.currentModelId, this.currentLabelAsymId, x, y, 'ball-and-stick')
+                        const componentId: string = this.currentLabelAsymId +":"+ (x === y ? x.toString() : x.toString()+"-"+y.toString());
+                        this.props.plugin.createComponentFromRange(componentId, this.currentModelId, this.currentLabelAsymId, x, y, 'ball-and-stick');
                     }
-                    this.props.plugin.focusRange(this.currentModelId, this.currentLabelAsymId, x, y);
                 }
             },
             selectionChangeCallBack:(selection: Array<SelectionInterface>)=>{

+ 2 - 3
src/RcsbFvStructure/StructurePlugins/MolstarPlugin.ts

@@ -177,9 +177,8 @@ export class MolstarPlugin extends AbstractPlugin implements SaguaroPluginInterf
 
 
     public createComponentFromSet(componentId: string, modelId:string, residues: Array<{asymId: string; position: number;}>, representationType: 'ball-and-stick' | 'spacefill' | 'gaussian-surface' | 'cartoon'): Promise<void> {
-        return this.plugin.createComponentFromSet(componentId, this.getModelId(modelId), residues, representationType).then(()=>{
-            this.componentSet.add(componentId);
-        });
+        this.componentSet.add(componentId);
+        return this.plugin.createComponentFromSet(componentId, this.getModelId(modelId), residues, representationType);
     }
 
     public isComponent(componentId: string): boolean{