ncbi / icn3d

web-based protein structure viewer and analysis tool interactively or in batch mode
https://www.ncbi.nlm.nih.gov/Structure/icn3d
Other
154 stars 42 forks source link

JS Widget missing images #78

Closed OtimusOne closed 2 years ago

OtimusOne commented 2 years ago

Hello, I'm using iCn3D as a JS widget, it seems that it is trying to load some missing images from the local file system. By chance I've noticed that one of the images is the cross icon for close buttons.

<link rel="stylesheet" href="https://www.ncbi.nlm.nih.gov/Structure/icn3d/lib/jquery-ui.min.css">
<link rel="stylesheet" href="https://www.ncbi.nlm.nih.gov/Structure/icn3d/icn3d.css">
<script src="https://www.ncbi.nlm.nih.gov/Structure/icn3d/lib/jquery.min.js"></script>
<script src="https://www.ncbi.nlm.nih.gov/Structure/icn3d/lib/jquery-ui.min.js"></script>
<script src="https://www.ncbi.nlm.nih.gov/Structure/icn3d/lib/threeClass.min.js"></script>
<script src="https://www.ncbi.nlm.nih.gov/Structure/icn3d/icn3d.min.js"></script>

<div id="icn3dwrap"></div>

<script type="text/javascript">
    $( document ).ready(function() {
          var cfg = {
              divid: 'icn3dwrap',
              width: '100%',
              height: '100%',
              mmdbid: '1tup',
          };
          var icn3dui = new icn3d.iCn3DUI(cfg);

          $.when(icn3dui.show3DStructure()).then(function() {
               //...
          });
    });
 </script>

icn3d3

jiywang3 commented 2 years ago

At the end of the first paragraph "About iCn3D": The complete package of iCn3D including Three.js and jQuery is in the directory "dist" after you get the source code with the "Code" button. You should get the complete package from the "dist" directory. The images are in the directory "lib/images".

OtimusOne commented 2 years ago

At the end of the first paragraph "About iCn3D": The complete package of iCn3D including Three.js and jQuery is in the directory "dist" after you get the source code with the "Code" button. You should get the complete package from the "dist" directory. The images are in the directory "lib/images".

Well yes, but then the user has to handle the file dependencies, I prefer to use the JS widget but also load the libraries from your end. Could the icons be saved as a base64 string in one of the JS libraries?

jiywang3 commented 2 years ago

I fixed the relative path in the file "setMenu.html". It should be working now.