Browse Source

Issue #8: viewer-backend integration

* some clean ups and comments
cycle20 3 years ago
parent
commit
7066a24015
1 changed files with 11 additions and 3 deletions
  1. 11 3
      src/apps/viewer/index.html

+ 11 - 3
src/apps/viewer/index.html

@@ -39,7 +39,6 @@
     <body>
         <div id="app"></div>
         <script type="text/javascript" src="./molstar.js"></script>
-        <script type="text/javascript" src="http://localhost:8080/valami/data.js"></script>
         <script type="text/javascript">
             function getParam(name, regex) {
                 var r = new RegExp(name + '=' + '(' + regex + ')[&]?', 'i');
@@ -55,9 +54,18 @@
                 collapseLeftPanel: false
             });
 
+            // Set PDB Id here
+            var pdbtmId = '...';
+            var regionDescriptors = {
+               // insert chain-region and color data here
+            };
+            regionDescriptors.format = 'pdb'
             viewer.loadWithUNITMPMembraneRepresentation(
-                'http://localhost:8080/valami/1a0s.trpdb.cif',
-                pdb
+                // NOTE: Prepare CORS settings appropriately on backend
+                //       or made this index.html accessible from the same
+                //       origin (DOMAIN:PORT values).
+                `https://DOMAIN[:PORT]/api/pdbtm/${pdbtmId}/trpdb`,
+                regionDescriptors
             );
         </script>
     </body>