|
@@ -1,7 +1,5 @@
|
|
|
import { DebugUtil } from "../TmFv3DApp/tmdet-extension/debug-utils";
|
|
|
-import { loadWithUNITMPMembraneRepresentation } from "../TmFv3DApp/UniTmpHelper";
|
|
|
-import * as React from "react";
|
|
|
-import { TmViewer } from "./tmdet-viewer/TmViewer";
|
|
|
+import { TmViewerStandalone } from "./tmdet-viewer/TmViewerStandalone";
|
|
|
import { ViewerProps } from "@rcsb/rcsb-molstar/build/src/viewer";
|
|
|
import { TMDETMembraneOrientation } from "../TmFv3DApp/tmdet-extension/behavior";
|
|
|
import { PluginSpec } from "molstar/lib/mol-plugin/spec";
|
|
@@ -9,19 +7,22 @@ import { PluginLayoutControlsDisplay } from "molstar/lib/mol-plugin/layout";
|
|
|
import { PluginConfig } from "molstar/lib/mol-plugin/config";
|
|
|
import { PluginContext } from "molstar/lib/mol-plugin/context";
|
|
|
|
|
|
-// customElements.define(TmFv1DElement.TagName, TmFv1DElement);
|
|
|
-
|
|
|
const Extensions = {
|
|
|
'tmdet-membrane-orientation': PluginSpec.Behavior(TMDETMembraneOrientation)
|
|
|
};
|
|
|
|
|
|
const viewerParams: Partial<ViewerProps> = {
|
|
|
- layoutIsExpanded: true,
|
|
|
+ layoutIsExpanded: false,
|
|
|
layoutShowControls: true,
|
|
|
layoutControlsDisplay: 'reactive' as PluginLayoutControlsDisplay,
|
|
|
layoutShowSequence: true,
|
|
|
layoutShowLog: true,
|
|
|
|
|
|
+ showImportControls: true,
|
|
|
+ showSessionControls: true,
|
|
|
+ showStructureSourceControls: true,
|
|
|
+
|
|
|
+
|
|
|
viewportShowExpand: PluginConfig.Viewport.ShowExpand.defaultValue,
|
|
|
viewportShowSelectionMode: PluginConfig.Viewport.ShowSelectionMode.defaultValue,
|
|
|
volumeStreamingServer: PluginConfig.VolumeStreaming.DefaultServer.defaultValue,
|
|
@@ -39,7 +40,7 @@ function createTmdetViewer(elementId: string, configParams: any,
|
|
|
(async function(event) {
|
|
|
|
|
|
DebugUtil.enableLog();
|
|
|
- const viewer = new TmViewer(elementId, {
|
|
|
+ const viewer = new TmViewerStandalone(elementId, {
|
|
|
...viewerProps,
|
|
|
layoutShowControls:false,
|
|
|
layoutShowSequence: true,
|
|
@@ -50,7 +51,7 @@ function createTmdetViewer(elementId: string, configParams: any,
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
- await loadWithUNITMPMembraneRepresentation(viewer, configParams);
|
|
|
+ await viewer.loadWithUNITMPMembraneRepresentation(configParams);
|
|
|
if (callBack) {
|
|
|
callBack(viewer.plugin);
|
|
|
}
|
|
@@ -58,7 +59,7 @@ function createTmdetViewer(elementId: string, configParams: any,
|
|
|
});
|
|
|
} else {
|
|
|
DebugUtil.enableLog();
|
|
|
- const viewer = new TmViewer(elementId, {
|
|
|
+ const viewer = new TmViewerStandalone(elementId, {
|
|
|
...viewerProps,
|
|
|
layoutShowControls:false,
|
|
|
layoutShowSequence: true,
|
|
@@ -69,7 +70,7 @@ function createTmdetViewer(elementId: string, configParams: any,
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
- loadWithUNITMPMembraneRepresentation(viewer, configParams);
|
|
|
+ viewer.loadWithUNITMPMembraneRepresentation(configParams);
|
|
|
if (callBack) {
|
|
|
callBack(viewer.plugin);
|
|
|
}
|
|
@@ -77,7 +78,25 @@ function createTmdetViewer(elementId: string, configParams: any,
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+function createMolstarViewer(elementId: string, viewerProps: Partial<ViewerProps> = viewerParams) {
|
|
|
+
|
|
|
+ return new TmViewerStandalone(elementId, {
|
|
|
+ ...viewerProps,
|
|
|
+ layoutShowControls:false,
|
|
|
+ layoutShowSequence: true,
|
|
|
+ showWelcomeToast: false,
|
|
|
+ canvas3d: {
|
|
|
+ multiSample: {
|
|
|
+ mode: 'off'
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ false // with no TmdetViewer behaviour
|
|
|
+ );
|
|
|
+}
|
|
|
+
|
|
|
export {
|
|
|
+ createMolstarViewer,
|
|
|
createTmdetViewer,
|
|
|
DebugUtil
|
|
|
};
|