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 +46 -8
- package/icn3d.min.js +3 -3
- package/icn3d.module.js +46 -8
- package/package.json +1 -1
package/icn3d.module.js
CHANGED
|
@@ -15371,6 +15371,7 @@ class SetDialog {
|
|
|
15371
15371
|
|
|
15372
15372
|
html += me.htmlCls.divStr + "dl_video' class='" + dialogClass + "'>";
|
|
15373
15373
|
html += this.addNotebookTitle('dl_video', 'Save canvas changes in a video');
|
|
15374
|
+
html += "State file: " + me.htmlCls.inputFileStr + "id='" + me.pre + "state'><br/>";
|
|
15374
15375
|
html += me.htmlCls.buttonStr + "video_start' style='margin-top: 6px;'>Video Start</button>";
|
|
15375
15376
|
html += me.htmlCls.buttonStr + "video_end' style='margin: 6px 0px 0px 30px;'>Video End</button>";
|
|
15376
15377
|
html += "</div>";
|
|
@@ -21152,9 +21153,9 @@ class Html {
|
|
|
21152
21153
|
this.MENU_WIDTH = 750;
|
|
21153
21154
|
//The width (in px) that was left empty by the 3D viewer. The default is 20px.
|
|
21154
21155
|
this.LESSWIDTH = 20;
|
|
21155
|
-
this.LESSWIDTH_RESIZE = 20;
|
|
21156
|
+
this.LESSWIDTH_RESIZE = 30; //20;
|
|
21156
21157
|
//The height (in px) that was left empty by the 3D viewer. The default is 20px.
|
|
21157
|
-
this.LESSHEIGHT = 20;
|
|
21158
|
+
this.LESSHEIGHT = (me.cfg.showlogo) ? 60 : 20; //20; // NCBI log is 40px high
|
|
21158
21159
|
|
|
21159
21160
|
// size of 2D cartoons
|
|
21160
21161
|
this.width2d = 200;
|
|
@@ -62465,7 +62466,8 @@ class ParserUtils {
|
|
|
62465
62466
|
ic.rmsd_supr = me.rmsdSuprCls.getRmsdSuprCls(coordsFrom, coordsTo, n);
|
|
62466
62467
|
|
|
62467
62468
|
// apply matrix for each atom
|
|
62468
|
-
|
|
62469
|
+
// if(ic.rmsd_supr.rot !== undefined && ic.rmsd_supr.rmsd < 0.1) {
|
|
62470
|
+
if(ic.rmsd_supr.rot !== undefined && ic.rmsd_supr.rmsd < 1) { // 6M17 has some coordinates change and rmsd is 0.3
|
|
62469
62471
|
let rot = ic.rmsd_supr.rot;
|
|
62470
62472
|
let centerFrom = ic.rmsd_supr.trans1;
|
|
62471
62473
|
let centerTo = ic.rmsd_supr.trans2;
|
|
@@ -62741,6 +62743,10 @@ class ParserUtils {
|
|
|
62741
62743
|
if(me.cfg.closepopup || me.cfg.imageonly) {
|
|
62742
62744
|
ic.resizeCanvasCls.closeDialogs();
|
|
62743
62745
|
}
|
|
62746
|
+
|
|
62747
|
+
if(!me.cfg.showlogo) {
|
|
62748
|
+
$("#ncbi_logo").hide();
|
|
62749
|
+
}
|
|
62744
62750
|
}
|
|
62745
62751
|
else {
|
|
62746
62752
|
ic.hlUpdateCls.updateHlAll();
|
|
@@ -71613,6 +71619,10 @@ class LoadScript {
|
|
|
71613
71619
|
ic.resizeCanvasCls.resizeCanvas(me.htmlCls.WIDTH, me.htmlCls.HEIGHT, true);
|
|
71614
71620
|
}
|
|
71615
71621
|
|
|
71622
|
+
if(!me.cfg.showlogo) {
|
|
71623
|
+
$("#ncbi_logo").hide();
|
|
71624
|
+
}
|
|
71625
|
+
|
|
71616
71626
|
// an extra render to remove artifacts in transparent surface
|
|
71617
71627
|
if(ic.bTransparentSurface && ic.bRender) ic.drawCls.render();
|
|
71618
71628
|
|
|
@@ -81369,7 +81379,7 @@ class ShareLink {
|
|
|
81369
81379
|
let shortName = strArray[strArray.length - 1];
|
|
81370
81380
|
ic.saveFileCls.saveFile(inputid + '-' + shortName + '.png', 'png');
|
|
81371
81381
|
let text = '<div style="float:left; border: solid 1px #0000ff; padding: 5px; margin: 10px; text-align:center;">';
|
|
81372
|
-
text += '<a href="https://www.ncbi.nlm.nih.gov/Structure/icn3d/
|
|
81382
|
+
text += '<a href="https://www.ncbi.nlm.nih.gov/Structure/icn3d/share2.html?' + shortName + '" target="_blank">';
|
|
81373
81383
|
text += '<img style="height:300px" src ="' + inputid + '-' + shortName + '.png"><br>\n';
|
|
81374
81384
|
text += '<!--Start of your comments==================-->\n';
|
|
81375
81385
|
let yournote =(ic.yournote) ? ': ' + ic.yournote.replace(/\n/g, "<br>").replace(/; /g, ", ") : '';
|
|
@@ -81384,13 +81394,14 @@ class ShareLink {
|
|
|
81384
81394
|
if(bPngHtml && data.shortLink === undefined) {
|
|
81385
81395
|
ic.saveFileCls.saveFile(inputid + '_icn3d_loadable.png', 'png');
|
|
81386
81396
|
}
|
|
81387
|
-
|
|
81397
|
+
/*
|
|
81388
81398
|
//shorturl: https://icn3d.page.link/NvbAh1Vmiwc4bgX87
|
|
81389
81399
|
let urlArray = shorturl.split('page.link/');
|
|
81390
|
-
//if(urlArray.length == 2) shorturl = me.htmlCls.baseUrl + 'icn3d/share.html?' + urlArray[1];
|
|
81391
81400
|
// When the baseURL is structure.ncbi.nlm.nih.gov, mmcifparser.cgi has a problem to pass posted data in Mac/iphone
|
|
81392
81401
|
// So the base URL is still www.ncbi.nlm.nih.gov/Structure,just use short URL here
|
|
81393
81402
|
if(urlArray.length == 2) shorturl = 'https://www.ncbi.nlm.nih.gov/Structure/icn3d/share.html?' + urlArray[1];
|
|
81403
|
+
*/
|
|
81404
|
+
shorturl = 'https://www.ncbi.nlm.nih.gov/Structure/icn3d/share2.html?' + shorturl;
|
|
81394
81405
|
|
|
81395
81406
|
$("#" + ic.pre + "short_url").val(shorturl);
|
|
81396
81407
|
$("#" + ic.pre + "short_url_title").val(shorturl + '&t=' + ic.yournote);
|
|
@@ -81409,6 +81420,7 @@ class ShareLink {
|
|
|
81409
81420
|
}
|
|
81410
81421
|
|
|
81411
81422
|
getShareLinkPrms(url, bPngHtml) { let ic = this.icn3d, me = ic.icn3dui;
|
|
81423
|
+
/*
|
|
81412
81424
|
//https://firebase.google.com/docs/dynamic-links/rest
|
|
81413
81425
|
//Web API Key: AIzaSyBxl9CgM0dY5lagHL4UOhEpLWE1fuwdnvc
|
|
81414
81426
|
let fdlUrl = "https://firebasedynamiclinks.googleapis.com/v1/shortLinks?key=AIzaSyBxl9CgM0dY5lagHL4UOhEpLWE1fuwdnvc";
|
|
@@ -81432,6 +81444,26 @@ class ShareLink {
|
|
|
81432
81444
|
}
|
|
81433
81445
|
});
|
|
81434
81446
|
});
|
|
81447
|
+
*/
|
|
81448
|
+
|
|
81449
|
+
let serviceUrl = "https://icn3d.link/?longurl=" + encodeURIComponent(url);
|
|
81450
|
+
return new Promise(function(resolve, reject) {
|
|
81451
|
+
$.ajax({
|
|
81452
|
+
url: serviceUrl,
|
|
81453
|
+
dataType: 'json',
|
|
81454
|
+
cache: true,
|
|
81455
|
+
success: function(data) {
|
|
81456
|
+
resolve(data);
|
|
81457
|
+
},
|
|
81458
|
+
error : function(xhr, textStatus, errorThrown ) {
|
|
81459
|
+
let shorturl = 'Problem in getting shortened URL';
|
|
81460
|
+
$("#" + ic.pre + "ori_url").val(url);
|
|
81461
|
+
$("#" + ic.pre + "short_url").val(shorturl);
|
|
81462
|
+
$("#" + ic.pre + "short_url_title").val(shorturl + '&t=' + ic.yournote);
|
|
81463
|
+
if(!bPngHtml) me.htmlCls.dialogCls.openDlg('dl_copyurl', 'Copy a Share Link URL');
|
|
81464
|
+
}
|
|
81465
|
+
});
|
|
81466
|
+
});
|
|
81435
81467
|
}
|
|
81436
81468
|
|
|
81437
81469
|
shareLinkUrl(bAllCommands, bOutputCmd, bStatefile) { let ic = this.icn3d, me = ic.icn3dui;
|
|
@@ -81458,6 +81490,7 @@ class ShareLink {
|
|
|
81458
81490
|
if(key === 'height' && value === '100%') continue;
|
|
81459
81491
|
|
|
81460
81492
|
if(key === 'resize' && value === true) continue;
|
|
81493
|
+
if(key === 'showlogo' && value === true) continue;
|
|
81461
81494
|
if(key === 'showmenu' && value === true) continue;
|
|
81462
81495
|
if(key === 'showtitle' && value === true) continue;
|
|
81463
81496
|
if(key === 'showcommand' && value === true) continue;
|
|
@@ -84551,7 +84584,7 @@ class iCn3DUI {
|
|
|
84551
84584
|
//even when multiple iCn3D viewers are shown together.
|
|
84552
84585
|
this.pre = this.cfg.divid + "_";
|
|
84553
84586
|
|
|
84554
|
-
this.REVISION = '3.
|
|
84587
|
+
this.REVISION = '3.43.0';
|
|
84555
84588
|
|
|
84556
84589
|
// In nodejs, iCn3D defines "window = {navigator: {}}"
|
|
84557
84590
|
this.bNode = (Object.keys(window).length < 2) ? true : false;
|
|
@@ -84560,6 +84593,7 @@ class iCn3DUI {
|
|
|
84560
84593
|
if(this.cfg.width === undefined) this.cfg.width = '100%';
|
|
84561
84594
|
if(this.cfg.height === undefined) this.cfg.height = '100%';
|
|
84562
84595
|
if(this.cfg.resize === undefined) this.cfg.resize = true;
|
|
84596
|
+
if(this.cfg.showlogo === undefined) this.cfg.showlogo = true;
|
|
84563
84597
|
if(this.cfg.showmenu === undefined) this.cfg.showmenu = true;
|
|
84564
84598
|
if(this.cfg.showtitle === undefined) this.cfg.showtitle = true;
|
|
84565
84599
|
if(this.cfg.showcommand === undefined) this.cfg.showcommand = true;
|
|
@@ -84980,8 +85014,12 @@ iCn3DUI.prototype.show3DStructure = async function(pdbStr) { let me = this;
|
|
|
84980
85014
|
}
|
|
84981
85015
|
else if(me.cfg.align !== undefined) {
|
|
84982
85016
|
// ic.bNCBI = true;
|
|
84983
|
-
|
|
85017
|
+
if(me.cfg.align.indexOf('185055,') != -1) {
|
|
85018
|
+
me.cfg.align = me.cfg.align.replace('185055,', '199731,'); //the mmdbid of PDB 6M17 was changed from 185055 to 199731
|
|
85019
|
+
}
|
|
85020
|
+
|
|
84984
85021
|
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]
|
|
85022
|
+
|
|
84985
85023
|
if(alignArray.length === 6) {
|
|
84986
85024
|
ic.inputid = alignArray[0] + "_" + alignArray[3];
|
|
84987
85025
|
}
|