ソースを参照

wip, updating to molstar 0.6

Alexander Rose 5 年 前
コミット
40cca9235e

ファイルの差分が大きいため隠しています
+ 630 - 30
package-lock.json


+ 3 - 3
package.json

@@ -37,9 +37,9 @@
     "license": "MIT",
     "devDependencies": {
         "@types/argparse": "^1.0.38",
-        "@types/node": "^13.9.5",
+        "@types/node": "^13.9.8",
         "@types/node-fetch": "^2.5.5",
-        "@types/react": "^16.9.27",
+        "@types/react": "^16.9.29",
         "@types/react-dom": "^16.9.5",
         "@typescript-eslint/eslint-plugin": "^2.26.0",
         "@typescript-eslint/parser": "^2.26.0",
@@ -50,7 +50,7 @@
         "extra-watch-webpack-plugin": "^1.0.3",
         "file-loader": "^6.0.0",
         "mini-css-extract-plugin": "^0.9.0",
-        "molstar": "0.6.0-dev.8",
+        "molstar": "0.6.0-dev.9",
         "node-fetch": "^2.6.0",
         "node-sass": "^4.13.1",
         "raw-loader": "^4.0.0",

+ 1 - 1
src/structure-viewer/helpers/preset.ts

@@ -112,7 +112,7 @@ export const RcsbPreset = TrajectoryHierarchyPresetProvider({
         const modelParams = { modelIndex: p.modelIndex || 0 }
 
         const structureParams: RootStructureDefinition.Params = { name: 'deposited', params: {} }
-        if (p.assemblyId) {
+        if (p.assemblyId && p.assemblyId !== 'deposited' && p.assemblyId !== '0') {
             Object.assign(structureParams, {
                 name: 'assembly',
                 params: { id: p.assemblyId }

+ 3 - 2
src/structure-viewer/index.ts

@@ -93,10 +93,11 @@ export class StructureViewer {
                     view: ViewportWrapper,
                 }
             },
+            config: new Map([
+                [PluginConfig.VolumeStreaming.DefaultServer, this.props.volumeServerUrl]
+            ])
         });
 
-        this.plugin.spec.config?.set(PluginConfig.VolumeStreaming.DefaultServer, this.props.volumeServerUrl);
-
         (this.plugin.customState as StructureViewerState) = {
             props: this.props,
             modelLoader: new ModelLoader(this.plugin),

+ 25 - 2
src/structure-viewer/ui/controls.tsx

@@ -9,9 +9,32 @@ import { PluginUIComponent } from 'molstar/lib/mol-plugin-ui/base';
 import { StructureViewerState } from '../types';
 import { Viewport, ViewportControls } from 'molstar/lib/mol-plugin-ui/viewport';
 import { BackgroundTaskProgress } from 'molstar/lib/mol-plugin-ui/task';
-import { LociLabels, DefaultStructureTools } from 'molstar/lib/mol-plugin-ui/controls';
+import { LociLabels, CustomStructureControls } from 'molstar/lib/mol-plugin-ui/controls';
 import { Toasts } from 'molstar/lib/mol-plugin-ui/toast';
 import { OpenFile } from './open';
+import { Icon } from 'molstar/lib/mol-plugin-ui/controls/icons';
+import { StructureSourceControls } from 'molstar/lib/mol-plugin-ui/structure/source';
+import { StructureSelectionControls } from 'molstar/lib/mol-plugin-ui/structure/selection';
+import { StructureMeasurementsControls } from 'molstar/lib/mol-plugin-ui/structure/measurements';
+import { StructureComponentControls } from 'molstar/lib/mol-plugin-ui/structure/components';
+import { VolumeStreamingControls } from 'molstar/lib/mol-plugin-ui/structure/volume';
+
+
+export class StructureTools extends PluginUIComponent {
+    render() {
+        return <>
+            <div className='msp-section-header'><Icon name='tools' />Structure Tools</div>
+
+            <StructureSourceControls />
+            <StructureSelectionControls initiallyCollapsed />
+            <StructureMeasurementsControls initiallyCollapsed />
+            <StructureComponentControls initiallyCollapsed />
+            <VolumeStreamingControls initiallyCollapsed />
+
+            <CustomStructureControls initiallyCollapsed />
+        </>;
+    }
+}
 
 export class ControlsWrapper extends PluginUIComponent {
     get customState() {
@@ -22,7 +45,7 @@ export class ControlsWrapper extends PluginUIComponent {
         const { showOpenFileControls } = this.customState.props
         return <div className='msp-scrollable-container'>
             {showOpenFileControls && <OpenFile initiallyCollapsed={false} />}
-            <DefaultStructureTools />
+            <StructureTools />
         </div>;
     }
 }

この差分においてかなりの量のファイルが変更されているため、一部のファイルを表示していません