ソースを参照

method to load multiple pdbIds

Alexander Rose 4 年 前
コミット
7111b56f86
1 ファイル変更7 行追加0 行削除
  1. 7 0
      src/structure-viewer/index.ts

+ 7 - 0
src/structure-viewer/index.ts

@@ -151,6 +151,13 @@ export class StructureViewer {
         }
     }
 
+    async loadPdbIds(args: { pdbId: string, props?: PresetProps, matrix?: Mat4 }[]) {
+        for (const { pdbId, props, matrix } of args) {
+            await this.loadPdbId(pdbId, props, matrix);
+        }
+        this.resetCamera(0);
+    }
+
     async loadUrl(url: string, props?: PresetProps, matrix?: Mat4) {
         await this.customState.modelLoader.load({ fileOrUrl: url, format: 'cif', }, props, matrix)
     }