local.html 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. <html lang="en">
  2. <head>
  3. <script src="../dist/build/rcsb-saguaro-3d.js" type="text/javascript"></script>
  4. <title>Saguaro 3D</title>
  5. </head>
  6. <body>
  7. <div id="pfv" style="margin-top: 200px;" ></div>
  8. <script type="text/javascript">
  9. function getJsonFromUrl(url) {
  10. if(!url) url = location.search;
  11. var query = url.substr(1);
  12. var result = {};
  13. query.split("&").forEach(function(part) {
  14. var item = part.split("=");
  15. result[item[0]] = decodeURIComponent(item[1]);
  16. });
  17. return result;
  18. }
  19. const args = getJsonFromUrl();
  20. const structurePanelConfig = {
  21. loadConfig:{
  22. method:"loadPdbId",
  23. pdbId: args.entryId
  24. }
  25. };
  26. /*const sequencePanelConfig = {
  27. type: "assembly",
  28. blockConfig: {
  29. entryId:args.entryId
  30. }
  31. };*/
  32. const sequencePanelConfig = {
  33. type: "custom",
  34. config: {
  35. boardConfig: {
  36. range: {
  37. min: 1,
  38. max: 110
  39. },
  40. trackWidth: 940,
  41. rowTitleWidth: 60,
  42. includeAxis: true
  43. },
  44. rowConfig: [{
  45. trackId: "blockTrack",
  46. trackHeight: 20,
  47. trackColor: "#F9F9F9",
  48. displayType: "block",
  49. displayColor: "#FF0000",
  50. rowTitle: "BLOCK",
  51. trackData: [{
  52. begin: 30,
  53. end: 60,
  54. gaps:[{
  55. begin:40,
  56. end:50
  57. }]
  58. },{
  59. begin: 80,
  60. end: 90,
  61. openEnd: true
  62. }]
  63. }]
  64. }
  65. };
  66. const fv = new RcsbFv3D.Create(structureConfig, sequenceConfig);
  67. fv.render();
  68. </script>
  69. </body>
  70. </html>