@rcsb/rcsb-saguaro-3d
Version:
RCSB Molstar/Saguaro Web App
77 lines (76 loc) • 2.64 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const RcsbFv3DCustom_1 = require("../../RcsbFv3D/RcsbFv3DCustom");
const TrajectoryPreset_1 = require("./TrajectoryPreset");
const FeatureViewerConfig_1 = require("./FeatureViewerConfig");
const MolstarActionManager_1 = require("../../RcsbFvStructure/StructureViewers/MolstarViewer/MolstarActionManager");
const block = {
blockId: "MyBlock_1",
featureViewConfig: [FeatureViewerConfig_1.fvConfig1, FeatureViewerConfig_1.fvConfig2]
};
const customConfig = {
blockConfig: [block]
};
const sequenceConfig = {
title: "Single chain example",
subtitle: "PDB entry with single chain",
config: customConfig
};
const molstarConfig = {
loadConfig: [{
loadMethod: MolstarActionManager_1.LoadMethod.loadPdbId,
loadParams: {
entryId: "1ash",
reprProvider: TrajectoryPreset_1.RcsbRepresentationPreset,
params: {
id: "structure_1",
modelMap: new Map(),
mapStructure: function (key, structure) {
this.modelMap.set(key, structure.data.units[0].model.id);
},
getMap: function () {
return this.modelMap;
}
}
}
}, {
loadMethod: MolstarActionManager_1.LoadMethod.loadPdbId,
loadParams: {
entryId: "101m",
reprProvider: TrajectoryPreset_1.RcsbRepresentationPreset,
params: {
id: "structure_2",
modelMap: new Map(),
mapStructure: function (key, structure) {
this.modelMap.set(key, structure.data.units[0].model.id);
},
getMap: function () {
return this.modelMap;
}
}
}
}],
structureViewerConfig: {
viewerProps: {
showImportControls: true,
showSessionControls: false
}
}
};
document.addEventListener("DOMContentLoaded", function (event) {
const panel3d = new RcsbFv3DCustom_1.RcsbFv3DCustom({
elementId: "pfv",
structurePanelConfig: molstarConfig,
sequencePanelConfig: sequenceConfig,
cssConfig: {
structurePanel: {
minWidth: 800,
minHeight: 800
},
sequencePanel: {
minWidth: 800
}
}
});
panel3d.render();
});