UNPKG

@rcsb/rcsb-saguaro-3d

Version:
75 lines 2.44 kB
import { RcsbFv3DCustom } from "../../RcsbFv3D/RcsbFv3DCustom"; import { RcsbRepresentationPreset } from "./TrajectoryPreset"; import { fvConfig1, fvConfig2 } from "./FeatureViewerConfig"; import { LoadMethod } from "../../RcsbFvStructure/StructureViewers/MolstarViewer/MolstarActionManager"; const block = { blockId: "MyBlock_1", featureViewConfig: [fvConfig1, fvConfig2] }; const customConfig = { blockConfig: [block] }; const sequenceConfig = { title: "Single chain example", subtitle: "PDB entry with single chain", config: customConfig }; const molstarConfig = { loadConfig: [{ loadMethod: LoadMethod.loadPdbId, loadParams: { entryId: "1ash", reprProvider: 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: LoadMethod.loadPdbId, loadParams: { entryId: "101m", reprProvider: 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({ elementId: "pfv", structurePanelConfig: molstarConfig, sequencePanelConfig: sequenceConfig, cssConfig: { structurePanel: { minWidth: 800, minHeight: 800 }, sequencePanel: { minWidth: 800 } } }); panel3d.render(); }); //# sourceMappingURL=index.js.map