bioinsilico 4 роки тому
батько
коміт
371127d8d5

+ 0 - 73
examples/local.html

@@ -1,73 +0,0 @@
-<html lang="en">
-<head>
-    <script src="../dist/build/rcsb-saguaro-3d.js" type="text/javascript"></script>
-    <title>Saguaro 3D</title>
-</head>
-<body>
-
-<div id="pfv" style="margin-top: 200px;" ></div>
-<script type="text/javascript">
-    function getJsonFromUrl(url) {
-        if(!url) url = location.search;
-        var query = url.substr(1);
-        var result = {};
-        query.split("&").forEach(function(part) {
-            var item = part.split("=");
-            result[item[0]] = decodeURIComponent(item[1]);
-        });
-        return result;
-    }
-    const args = getJsonFromUrl();
-    const structurePanelConfig = {
-        loadConfig:{
-            method:"loadPdbId",
-            pdbId: args.entryId
-        }
-    };
-    /*const sequencePanelConfig = {
-        type: "assembly",
-        blockConfig: {
-            entryId:args.entryId
-        }
-    };*/
-    const sequencePanelConfig = {
-        type: "custom",
-        config: {
-            boardConfig: {
-                range: {
-                    min: 1,
-                    max: 110
-                },
-                trackWidth: 940,
-                rowTitleWidth: 60,
-                includeAxis: true
-            },
-            rowConfig: [{
-                trackId: "blockTrack",
-                trackHeight: 20,
-                trackColor: "#F9F9F9",
-                displayType: "block",
-                displayColor: "#FF0000",
-                rowTitle: "BLOCK",
-                trackData: [{
-                    begin: 30,
-                    end: 60,
-                    gaps:[{
-                        begin:40,
-                        end:50
-                    }]
-                },{
-                    begin: 80,
-                    end: 90,
-                    openEnd: true
-                }]
-            }]
-        }
-    };
-    const fv = new RcsbFv3D.Create(structureConfig, sequenceConfig);
-    fv.render();
-</script>
-
-
-</body>
-</html>

+ 1 - 1
src/RcsbFvSequence/SequenceViews/AbstractView.tsx

@@ -36,7 +36,7 @@ export abstract class AbstractView<P,S> extends React.Component <P & AbstractVie
 
     componentDidMount() {
         this.props.plugin.selectCallback(this.structureSelectionCallback.bind(this));
-        this.props.plugin.objectChangeCallback(this.objectChangeCallback.bind(this));
+        this.props.plugin.setObjectChangeCallback(this.objectChangeCallback.bind(this));
         window.addEventListener('resize', this.updatePfvDimensions.bind(this));
     }
 

+ 4 - 4
src/RcsbFvStructure/StructurePlugins/MolstarPlugin.ts

@@ -48,7 +48,7 @@ export class MolstarPlugin extends AbstractPlugin implements SaguaroPluginInterf
     private plugin: Viewer;
     private localSelectionFlag: boolean = false;
     private loadingFlag: boolean = false;
-    private _objectChangeCallback: ()=>void;
+    private objectChangeCallback: ()=>void;
     private modelMap: Map<string,string|undefined> = new Map<string, string>();
 
     constructor(props: RcsbFvSelection) {
@@ -87,7 +87,7 @@ export class MolstarPlugin extends AbstractPlugin implements SaguaroPluginInterf
         }
         this.loadingFlag = false;
         this.mapModels(loadConfig.params);
-        this._objectChangeCallback();
+        this.objectChangeCallback();
     }
 
     private static checkLoadData(loadConfig: LoadMolstarInterface): boolean{
@@ -167,8 +167,8 @@ export class MolstarPlugin extends AbstractPlugin implements SaguaroPluginInterf
         this.plugin.pluginCall(f);
     }
 
-    public objectChangeCallback(f:()=>void){
-        this._objectChangeCallback = f;
+    public setObjectChangeCallback(f:()=>void){
+        this.objectChangeCallback = f;
         this.plugin.getPlugin().state.events.object.updated.subscribe((o)=>{
             if(this.loadingFlag)
                 return;

+ 1 - 1
src/RcsbFvStructure/StructurePlugins/SaguaroPluginInterface.ts

@@ -10,7 +10,7 @@ export interface SaguaroPluginInterface {
     selectCallback: ( g:()=>void)=>void;
     clear: () => void;
     getChains: () => Map<string,{entryId: string; chains:Array<{label:string, auth:string}>;}>;
-    objectChangeCallback: (f:()=>void)=>void;
+    setObjectChangeCallback: (f:()=>void)=>void;
 }
 
 export interface SaguaroPluginPublicInterface {

+ 3 - 3
src/examples/custom-panel/example.tsx

@@ -26,7 +26,7 @@ const structureConfig:StructureViewInterface = {
             pdbId: "101m",
             id:"model_1"
         },{
-            pdbId: "1ash",
+            pdbId: "1xxx",
             id:"model_2"
         }]
     }
@@ -115,8 +115,8 @@ const fv2: FeatureViewInterface = {
     },
     rowConfig: rowConfig2,
     sequenceSelectionCallback: (plugin: SaguaroPluginPublicInterface, selection: RcsbFvSelection, d: RcsbFvTrackDataElementInterface) => {
-        selection.setSelectionFromRegion("model_2", "A", {begin:d.begin, end:d.end??d.begin});
-        plugin.select("model_2", "A", d.begin, d.end??d.begin);
+        selection.setSelectionFromRegion("model_2", "B", {begin:d.begin, end:d.end??d.begin});
+        plugin.select("model_2", "B", d.begin, d.end??d.begin);
     },
     structureSelectionCallback: (pfv: RcsbFv, selection: RcsbFvSelection) => {
         const sel: ChainSelectionInterface | undefined = selection.getSelectionWithCondition("model_2", "A");