|
@@ -1,11 +1,9 @@
|
|
|
import {
|
|
|
CustomViewInterface,
|
|
|
- FeatureBlockInterface,
|
|
|
FeatureViewInterface
|
|
|
} from "../RcsbFvSequence/SequenceViews/CustomView/CustomView";
|
|
|
import {
|
|
|
RcsbFv,
|
|
|
- RcsbFvDisplayTypes,
|
|
|
RcsbFvRowConfigInterface,
|
|
|
RcsbFvTrackDataElementInterface
|
|
|
} from "@rcsb/rcsb-saguaro";
|
|
@@ -38,13 +36,6 @@ export type TmFvConfigParams = {
|
|
|
};
|
|
|
export async function createFeatureViewerConfing(params: TmFvConfigParams) {
|
|
|
|
|
|
- const modelId = `${params.pdbEntry}_model`;
|
|
|
-
|
|
|
- const fvConfig: FeatureViewInterface<LoadMolstarInterface<unknown,unknown>,LoadMolstarReturnType> =
|
|
|
- params.fvConfigData.blockConfig[0].featureViewConfig[0];
|
|
|
-
|
|
|
- setFvConfigCallbacks(fvConfig, modelId, params.labelAsymId);
|
|
|
-
|
|
|
const customConfig: CustomViewInterface<LoadMolstarInterface<unknown,unknown>,LoadMolstarReturnType> =
|
|
|
params.fvConfigData;
|
|
|
|
|
@@ -75,7 +66,18 @@ export async function createFeatureViewerConfing(params: TmFvConfigParams) {
|
|
|
|
|
|
updateSiteColors(params.side1 as any);
|
|
|
|
|
|
- setExternalRowTitleComponent(fvConfig.rowConfig, structureRowClickHandler);
|
|
|
+ // set callbacks and external row title components
|
|
|
+ const modelId = `${params.pdbEntry}_model`;
|
|
|
+ params.fvConfigData.blockConfig.forEach((block: any) => block.featureViewConfig.forEach((featureViewConfig: any, index: number) => {
|
|
|
+ const fvConfig: FeatureViewInterface<LoadMolstarInterface<unknown,unknown>,LoadMolstarReturnType> = featureViewConfig;
|
|
|
+
|
|
|
+ if (index == 0) {
|
|
|
+ setFvConfigCallbacks(fvConfig, modelId, params.labelAsymId);
|
|
|
+ } else {
|
|
|
+ emptyFvConfigCallbacks(fvConfig);
|
|
|
+ }
|
|
|
+ setExternalRowTitleComponent(fvConfig.rowConfig, structureRowClickHandler);
|
|
|
+ }));
|
|
|
|
|
|
return { sequenceConfig: sequenceConfig, molstarConfig: molstarConfig };
|
|
|
}
|
|
@@ -136,6 +138,20 @@ function setFvConfigCallbacks(fvConfig: FeatureViewInterface<LoadMolstarInterfac
|
|
|
|
|
|
}
|
|
|
|
|
|
+function emptyFvConfigCallbacks(fvConfig: FeatureViewInterface<LoadMolstarInterface<unknown,unknown>,LoadMolstarReturnType>) {
|
|
|
+ fvConfig.sequenceSelectionChangeCallback = (plugin: StructureViewerPublicInterface<LoadMolstarInterface<unknown,unknown>,LoadMolstarReturnType>, stateManager: RcsbFvStateManager, sequenceRegion: Array<RcsbFvTrackDataElementInterface>) => {
|
|
|
+ };
|
|
|
+ fvConfig.sequenceElementClickCallback = (plugin: StructureViewerPublicInterface<LoadMolstarInterface<unknown,unknown>,LoadMolstarReturnType>, stateManager: RcsbFvStateManager, d: RcsbFvTrackDataElementInterface) => {
|
|
|
+ };
|
|
|
+ fvConfig.sequenceHoverCallback = (plugin: StructureViewerPublicInterface<LoadMolstarInterface<unknown,unknown>,LoadMolstarReturnType>, stateManager: RcsbFvStateManager, elements: Array<RcsbFvTrackDataElementInterface>) => {
|
|
|
+ };
|
|
|
+ fvConfig.structureSelectionCallback = (plugin: StructureViewerPublicInterface<LoadMolstarInterface<unknown,unknown>,LoadMolstarReturnType>, pfv: RcsbFv, stateManager: RcsbFvStateManager) => {
|
|
|
+ };
|
|
|
+ fvConfig.structureHoverCallback = (plugin: StructureViewerPublicInterface<LoadMolstarInterface<unknown,unknown>,LoadMolstarReturnType>, pfv: RcsbFv, stateManager: RcsbFvStateManager) => {
|
|
|
+ };
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
function setExternalRowTitleComponent(rows: RcsbFvRowConfigInterface[], titleClick: (e: React.MouseEvent) => void) {
|
|
|
rows.forEach(track => {
|
|
|
if (track.externalRowTitle && (track.externalRowTitle.rowTitleComponent as unknown) == "TmRowTitleComponent") {
|