icn3d 3.42.0 → 3.43.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/icn3d.js CHANGED
@@ -14470,6 +14470,7 @@ class SetDialog {
14470
14470
 
14471
14471
  html += me.htmlCls.divStr + "dl_video' class='" + dialogClass + "'>";
14472
14472
  html += this.addNotebookTitle('dl_video', 'Save canvas changes in a video');
14473
+ html += "State file: " + me.htmlCls.inputFileStr + "id='" + me.pre + "state'><br/>";
14473
14474
  html += me.htmlCls.buttonStr + "video_start' style='margin-top: 6px;'>Video Start</button>";
14474
14475
  html += me.htmlCls.buttonStr + "video_end' style='margin: 6px 0px 0px 30px;'>Video End</button>";
14475
14476
  html += "</div>";
@@ -20251,9 +20252,9 @@ class Html {
20251
20252
  this.MENU_WIDTH = 750;
20252
20253
  //The width (in px) that was left empty by the 3D viewer. The default is 20px.
20253
20254
  this.LESSWIDTH = 20;
20254
- this.LESSWIDTH_RESIZE = 20;
20255
+ this.LESSWIDTH_RESIZE = 30; //20;
20255
20256
  //The height (in px) that was left empty by the 3D viewer. The default is 20px.
20256
- this.LESSHEIGHT = 20;
20257
+ this.LESSHEIGHT = (me.cfg.showlogo) ? 60 : 20; //20; // NCBI log is 40px high
20257
20258
 
20258
20259
  // size of 2D cartoons
20259
20260
  this.width2d = 200;
@@ -61564,7 +61565,8 @@ class ParserUtils {
61564
61565
  ic.rmsd_supr = me.rmsdSuprCls.getRmsdSuprCls(coordsFrom, coordsTo, n);
61565
61566
 
61566
61567
  // apply matrix for each atom
61567
- if(ic.rmsd_supr.rot !== undefined && ic.rmsd_supr.rmsd < 0.1) {
61568
+ // if(ic.rmsd_supr.rot !== undefined && ic.rmsd_supr.rmsd < 0.1) {
61569
+ if(ic.rmsd_supr.rot !== undefined && ic.rmsd_supr.rmsd < 1) { // 6M17 has some coordinates change and rmsd is 0.3
61568
61570
  let rot = ic.rmsd_supr.rot;
61569
61571
  let centerFrom = ic.rmsd_supr.trans1;
61570
61572
  let centerTo = ic.rmsd_supr.trans2;
@@ -61840,6 +61842,10 @@ class ParserUtils {
61840
61842
  if(me.cfg.closepopup || me.cfg.imageonly) {
61841
61843
  ic.resizeCanvasCls.closeDialogs();
61842
61844
  }
61845
+
61846
+ if(!me.cfg.showlogo) {
61847
+ $("#ncbi_logo").hide();
61848
+ }
61843
61849
  }
61844
61850
  else {
61845
61851
  ic.hlUpdateCls.updateHlAll();
@@ -70712,6 +70718,10 @@ class LoadScript {
70712
70718
  ic.resizeCanvasCls.resizeCanvas(me.htmlCls.WIDTH, me.htmlCls.HEIGHT, true);
70713
70719
  }
70714
70720
 
70721
+ if(!me.cfg.showlogo) {
70722
+ $("#ncbi_logo").hide();
70723
+ }
70724
+
70715
70725
  // an extra render to remove artifacts in transparent surface
70716
70726
  if(ic.bTransparentSurface && ic.bRender) ic.drawCls.render();
70717
70727
 
@@ -80468,7 +80478,7 @@ class ShareLink {
80468
80478
  let shortName = strArray[strArray.length - 1];
80469
80479
  ic.saveFileCls.saveFile(inputid + '-' + shortName + '.png', 'png');
80470
80480
  let text = '<div style="float:left; border: solid 1px #0000ff; padding: 5px; margin: 10px; text-align:center;">';
80471
- text += '<a href="https://www.ncbi.nlm.nih.gov/Structure/icn3d/share.html?' + shortName + '" target="_blank">';
80481
+ text += '<a href="https://www.ncbi.nlm.nih.gov/Structure/icn3d/share2.html?' + shortName + '" target="_blank">';
80472
80482
  text += '<img style="height:300px" src ="' + inputid + '-' + shortName + '.png"><br>\n';
80473
80483
  text += '<!--Start of your comments==================-->\n';
80474
80484
  let yournote =(ic.yournote) ? ': ' + ic.yournote.replace(/\n/g, "<br>").replace(/; /g, ", ") : '';
@@ -80483,13 +80493,14 @@ class ShareLink {
80483
80493
  if(bPngHtml && data.shortLink === undefined) {
80484
80494
  ic.saveFileCls.saveFile(inputid + '_icn3d_loadable.png', 'png');
80485
80495
  }
80486
-
80496
+ /*
80487
80497
  //shorturl: https://icn3d.page.link/NvbAh1Vmiwc4bgX87
80488
80498
  let urlArray = shorturl.split('page.link/');
80489
- //if(urlArray.length == 2) shorturl = me.htmlCls.baseUrl + 'icn3d/share.html?' + urlArray[1];
80490
80499
  // When the baseURL is structure.ncbi.nlm.nih.gov, mmcifparser.cgi has a problem to pass posted data in Mac/iphone
80491
80500
  // So the base URL is still www.ncbi.nlm.nih.gov/Structure,just use short URL here
80492
80501
  if(urlArray.length == 2) shorturl = 'https://www.ncbi.nlm.nih.gov/Structure/icn3d/share.html?' + urlArray[1];
80502
+ */
80503
+ shorturl = 'https://www.ncbi.nlm.nih.gov/Structure/icn3d/share2.html?' + shorturl;
80493
80504
 
80494
80505
  $("#" + ic.pre + "short_url").val(shorturl);
80495
80506
  $("#" + ic.pre + "short_url_title").val(shorturl + '&t=' + ic.yournote);
@@ -80508,6 +80519,7 @@ class ShareLink {
80508
80519
  }
80509
80520
 
80510
80521
  getShareLinkPrms(url, bPngHtml) { let ic = this.icn3d, me = ic.icn3dui;
80522
+ /*
80511
80523
  //https://firebase.google.com/docs/dynamic-links/rest
80512
80524
  //Web API Key: AIzaSyBxl9CgM0dY5lagHL4UOhEpLWE1fuwdnvc
80513
80525
  let fdlUrl = "https://firebasedynamiclinks.googleapis.com/v1/shortLinks?key=AIzaSyBxl9CgM0dY5lagHL4UOhEpLWE1fuwdnvc";
@@ -80531,6 +80543,26 @@ class ShareLink {
80531
80543
  }
80532
80544
  });
80533
80545
  });
80546
+ */
80547
+
80548
+ let serviceUrl = "https://icn3d.link/?longurl=" + encodeURIComponent(url);
80549
+ return new Promise(function(resolve, reject) {
80550
+ $.ajax({
80551
+ url: serviceUrl,
80552
+ dataType: 'json',
80553
+ cache: true,
80554
+ success: function(data) {
80555
+ resolve(data);
80556
+ },
80557
+ error : function(xhr, textStatus, errorThrown ) {
80558
+ let shorturl = 'Problem in getting shortened URL';
80559
+ $("#" + ic.pre + "ori_url").val(url);
80560
+ $("#" + ic.pre + "short_url").val(shorturl);
80561
+ $("#" + ic.pre + "short_url_title").val(shorturl + '&t=' + ic.yournote);
80562
+ if(!bPngHtml) me.htmlCls.dialogCls.openDlg('dl_copyurl', 'Copy a Share Link URL');
80563
+ }
80564
+ });
80565
+ });
80534
80566
  }
80535
80567
 
80536
80568
  shareLinkUrl(bAllCommands, bOutputCmd, bStatefile) { let ic = this.icn3d, me = ic.icn3dui;
@@ -80557,6 +80589,7 @@ class ShareLink {
80557
80589
  if(key === 'height' && value === '100%') continue;
80558
80590
 
80559
80591
  if(key === 'resize' && value === true) continue;
80592
+ if(key === 'showlogo' && value === true) continue;
80560
80593
  if(key === 'showmenu' && value === true) continue;
80561
80594
  if(key === 'showtitle' && value === true) continue;
80562
80595
  if(key === 'showcommand' && value === true) continue;
@@ -83650,7 +83683,7 @@ class iCn3DUI {
83650
83683
  //even when multiple iCn3D viewers are shown together.
83651
83684
  this.pre = this.cfg.divid + "_";
83652
83685
 
83653
- this.REVISION = '3.42.0';
83686
+ this.REVISION = '3.43.0';
83654
83687
 
83655
83688
  // In nodejs, iCn3D defines "window = {navigator: {}}"
83656
83689
  this.bNode = (Object.keys(window).length < 2) ? true : false;
@@ -83659,6 +83692,7 @@ class iCn3DUI {
83659
83692
  if(this.cfg.width === undefined) this.cfg.width = '100%';
83660
83693
  if(this.cfg.height === undefined) this.cfg.height = '100%';
83661
83694
  if(this.cfg.resize === undefined) this.cfg.resize = true;
83695
+ if(this.cfg.showlogo === undefined) this.cfg.showlogo = true;
83662
83696
  if(this.cfg.showmenu === undefined) this.cfg.showmenu = true;
83663
83697
  if(this.cfg.showtitle === undefined) this.cfg.showtitle = true;
83664
83698
  if(this.cfg.showcommand === undefined) this.cfg.showcommand = true;
@@ -84079,8 +84113,12 @@ iCn3DUI.prototype.show3DStructure = async function(pdbStr) { let me = this;
84079
84113
  }
84080
84114
  else if(me.cfg.align !== undefined) {
84081
84115
  // ic.bNCBI = true;
84082
-
84116
+ if(me.cfg.align.indexOf('185055,') != -1) {
84117
+ me.cfg.align = me.cfg.align.replace('185055,', '199731,'); //the mmdbid of PDB 6M17 was changed from 185055 to 199731
84118
+ }
84119
+
84083
84120
  let alignArray = me.cfg.align.split(','); // e.g., 6 IDs: 103701,1,4,68563,1,167 [mmdbid1,biounit,molecule,mmdbid2,biounit,molecule], or 2IDs: 103701,68563 [mmdbid1,mmdbid2]
84121
+
84084
84122
  if(alignArray.length === 6) {
84085
84123
  ic.inputid = alignArray[0] + "_" + alignArray[3];
84086
84124
  }