icn3d 3.44.0 → 3.44.1
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/README.md +4 -4
- package/css/lib/fonts/la-brands-400.eot +0 -0
- package/css/lib/fonts/la-brands-400.svg +0 -0
- package/css/lib/fonts/la-brands-400.ttf +0 -0
- package/css/lib/fonts/la-brands-400.woff +0 -0
- package/css/lib/fonts/la-brands-400.woff2 +0 -0
- package/css/lib/fonts/la-regular-400.eot +0 -0
- package/css/lib/fonts/la-regular-400.svg +0 -0
- package/css/lib/fonts/la-regular-400.ttf +0 -0
- package/css/lib/fonts/la-regular-400.woff +0 -0
- package/css/lib/fonts/la-regular-400.woff2 +0 -0
- package/css/lib/fonts/la-solid-900.eot +0 -0
- package/css/lib/fonts/la-solid-900.svg +0 -0
- package/css/lib/fonts/la-solid-900.ttf +0 -0
- package/css/lib/fonts/la-solid-900.woff +0 -0
- package/css/lib/fonts/la-solid-900.woff2 +0 -0
- package/css/lib/images/ui-bg_diagonals-thick_18_b81900_40x40.png +0 -0
- package/css/lib/images/ui-bg_diagonals-thick_20_666666_40x40.png +0 -0
- package/css/lib/images/ui-bg_glass_100_f6f6f6_1x400.png +0 -0
- package/css/lib/images/ui-bg_glass_100_fdf5ce_1x400.png +0 -0
- package/css/lib/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- package/css/lib/images/ui-bg_highlight-soft_100_eeeeee_1x100.png +0 -0
- package/css/lib/images/ui-bg_highlight-soft_75_ffe45c_1x100.png +0 -0
- package/css/lib/images/ui-icons_222222_256x240.png +0 -0
- package/css/lib/images/ui-icons_228ef1_256x240.png +0 -0
- package/css/lib/images/ui-icons_ef8c08_256x240.png +0 -0
- package/css/lib/images/ui-icons_ffd27a_256x240.png +0 -0
- package/css/lib/images/ui-icons_ffffff_256x240.png +0 -0
- package/icn3d.js +194 -45
- package/icn3d.min.js +4 -4
- package/icn3d.module.js +194 -45
- package/package.json +1 -1
package/icn3d.module.js
CHANGED
|
@@ -57138,6 +57138,13 @@ class ClickMenu {
|
|
|
57138
57138
|
}
|
|
57139
57139
|
}
|
|
57140
57140
|
}
|
|
57141
|
+
|
|
57142
|
+
//https://stackoverflow.com/questions/105034/how-do-i-create-a-guid-uuid
|
|
57143
|
+
uuidv4() {
|
|
57144
|
+
return "10000000-1000-4000-8000-100000000000".replace(/[018]/g, c =>
|
|
57145
|
+
(+c ^ crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> +c / 4).toString(16)
|
|
57146
|
+
);
|
|
57147
|
+
}
|
|
57141
57148
|
|
|
57142
57149
|
displayShownMenus() { let me = this.icn3dui; me.icn3d;
|
|
57143
57150
|
let html = "<form name='" + me.pre + "selmenu'>";
|
|
@@ -57426,6 +57433,132 @@ class ClickMenu {
|
|
|
57426
57433
|
ic.saveFileCls.saveFile(file_pref + '_statefile.txt', 'command');
|
|
57427
57434
|
});
|
|
57428
57435
|
|
|
57436
|
+
me.myEventCls.onIds("#" + me.pre + "mn1_exportCamera", "click", async function(e) { let ic = me.icn3d; //e.preventDefault();
|
|
57437
|
+
thisClass.setLogCmd("export bcf viewpoint", false);
|
|
57438
|
+
let file_pref = Object.keys(ic.structures).join(',');
|
|
57439
|
+
//ic.saveFileCls.saveFile(file_pref + '_camera.bcf', 'bcf');
|
|
57440
|
+
|
|
57441
|
+
let url = './script/jszip.min.js';
|
|
57442
|
+
await me.getAjaxPromise(url, 'script');
|
|
57443
|
+
|
|
57444
|
+
let data, jszip = new JSZip();
|
|
57445
|
+
|
|
57446
|
+
let uuid1 = thisClass.uuidv4();
|
|
57447
|
+
let uuid2 = thisClass.uuidv4();
|
|
57448
|
+
|
|
57449
|
+
data = '';
|
|
57450
|
+
data += '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\n';
|
|
57451
|
+
data += ' <Version VersionId="3.0"/>\n';
|
|
57452
|
+
|
|
57453
|
+
jszip.file("bcf.version", data);
|
|
57454
|
+
|
|
57455
|
+
data = '';
|
|
57456
|
+
data += '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\n';
|
|
57457
|
+
data += ' <Extensions>\n';
|
|
57458
|
+
data += ' <TopicTypes>\n';
|
|
57459
|
+
data += ' <TopicType>ERROR</TopicType>\n';
|
|
57460
|
+
data += ' <TopicType>WARNING</TopicType>\n';
|
|
57461
|
+
data += ' <TopicType>INFORMATION</TopicType>\n';
|
|
57462
|
+
data += ' <TopicType>CLASH</TopicType>\n';
|
|
57463
|
+
data += ' <TopicType>OTHER</TopicType>\n';
|
|
57464
|
+
data += ' </TopicTypes>\n';
|
|
57465
|
+
data += ' <TopicStatuses>\n';
|
|
57466
|
+
data += ' <TopicStatus>OPEN</TopicStatus>\n';
|
|
57467
|
+
data += ' <TopicStatus>IN_PROGRESS</TopicStatus>\n';
|
|
57468
|
+
data += ' <TopicStatus>SOLVED</TopicStatus>\n';
|
|
57469
|
+
data += ' <TopicStatus>CLOSED</TopicStatus>\n';
|
|
57470
|
+
data += ' </TopicStatuses>\n';
|
|
57471
|
+
data += ' <Priorities>\n';
|
|
57472
|
+
data += ' <Priority>LOW</Priority>\n';
|
|
57473
|
+
data += ' <Priority>MEDIUM</Priority>\n';
|
|
57474
|
+
data += ' <Priority>HIGH</Priority>\n';
|
|
57475
|
+
data += ' <Priority>CRITICAL</Priority>\n';
|
|
57476
|
+
data += ' </Priorities>\n';
|
|
57477
|
+
data += ' <TopicLabels/>\n';
|
|
57478
|
+
data += ' <Users/>\n';
|
|
57479
|
+
data += ' <SnippetTypes/>\n';
|
|
57480
|
+
data += ' <Stages/>\n';
|
|
57481
|
+
data += ' </Extensions>\n';
|
|
57482
|
+
|
|
57483
|
+
jszip.file("extensions.xml", data);
|
|
57484
|
+
|
|
57485
|
+
let folder = jszip.folder(uuid1);
|
|
57486
|
+
|
|
57487
|
+
data = '';
|
|
57488
|
+
data += '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\n';
|
|
57489
|
+
data += ' <Markup>\n';
|
|
57490
|
+
data += ' <Header>\n';
|
|
57491
|
+
data += ' <Files/>\n';
|
|
57492
|
+
data += ' </Header> \n';
|
|
57493
|
+
data += ' <Topic Guid="' + uuid1 + '">\n';
|
|
57494
|
+
data += ' <Title>Perspective camera</Title>\n';
|
|
57495
|
+
|
|
57496
|
+
let now = new Date();
|
|
57497
|
+
const isoString = now.toISOString();
|
|
57498
|
+
|
|
57499
|
+
data += ' <CreationDate>' + isoString + '</CreationDate>\n';
|
|
57500
|
+
data += ' <CreationAuthor>https://www.ncbi.nlm.nih.gov/Structure/icn3d</CreationAuthor>\n';
|
|
57501
|
+
data += ' <DocumentReferences/>\n';
|
|
57502
|
+
data += ' <RelatedTopics/>\n';
|
|
57503
|
+
data += ' <Comments/>\n';
|
|
57504
|
+
data += ' <Viewpoints>\n';
|
|
57505
|
+
data += ' <ViewPoint Guid="' + uuid2 + '">\n';
|
|
57506
|
+
data += ' <Viewpoint>viewpoint-' + uuid2 + '.bcfv</Viewpoint>\n';
|
|
57507
|
+
data += ' <Snapshot>snapshot-' + uuid2 + '.png</Snapshot>\n';
|
|
57508
|
+
data += ' </ViewPoint>\n';
|
|
57509
|
+
data += ' </Viewpoints>\n';
|
|
57510
|
+
data += ' </Topic>\n';
|
|
57511
|
+
data += ' </Markup>\n';
|
|
57512
|
+
|
|
57513
|
+
folder.file("markup.bcf", data);
|
|
57514
|
+
let blob = await ic.saveFileCls.saveFile('any', 'png', undefined, undefined, true);
|
|
57515
|
+
|
|
57516
|
+
folder.file("snapshot-" + uuid2 + ".png", blob);
|
|
57517
|
+
|
|
57518
|
+
data = '';
|
|
57519
|
+
|
|
57520
|
+
data += '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\n';
|
|
57521
|
+
data += ' <VisualizationInfo Guid="' + uuid2 + '">\n';
|
|
57522
|
+
data += ' <Components>\n';
|
|
57523
|
+
data += ' <Selection/>\n';
|
|
57524
|
+
data += ' <Visibility DefaultVisibility="true" />\n';
|
|
57525
|
+
data += ' <Coloring/>\n';
|
|
57526
|
+
data += ' </Components>\n';
|
|
57527
|
+
data += ' <PerspectiveCamera>\n';
|
|
57528
|
+
data += ' <CameraViewPoint>\n';
|
|
57529
|
+
data += ' <X>' + ic.cam.position.x + '</X>\n';
|
|
57530
|
+
data += ' <Y>' + ic.cam.position.y + '</Y>\n';
|
|
57531
|
+
data += ' <Z>' + ic.cam.position.z + '</Z>\n';
|
|
57532
|
+
data += ' </CameraViewPoint>\n';
|
|
57533
|
+
|
|
57534
|
+
let direction = (new Vector3$1(0, 0, -1)).applyQuaternion(ic.cam.quaternion);
|
|
57535
|
+
|
|
57536
|
+
data += ' <CameraDirection>\n';
|
|
57537
|
+
data += ' <X>' + direction.x + '</X>\n';
|
|
57538
|
+
data += ' <Y>' + direction.y + '</Y>\n';
|
|
57539
|
+
data += ' <Z>' + direction.z + '</Z>\n';
|
|
57540
|
+
data += ' </CameraDirection>\n';
|
|
57541
|
+
data += ' <CameraUpVector>\n';
|
|
57542
|
+
data += ' <X>' + ic.cam.up.x + '</X>\n';
|
|
57543
|
+
data += ' <Y>' + ic.cam.up.y + '</Y>\n';
|
|
57544
|
+
data += ' <Z>' + ic.cam.up.z + '</Z>\n';
|
|
57545
|
+
data += ' </CameraUpVector>\n';
|
|
57546
|
+
data += ' <FieldOfView>' + ic.cam.fov + '</FieldOfView>\n'; // 20
|
|
57547
|
+
data += ' <AspectRatio>' + ic.container.whratio + '</AspectRatio>\n';
|
|
57548
|
+
data += ' </PerspectiveCamera>\n';
|
|
57549
|
+
data += ' <Lines/>\n';
|
|
57550
|
+
data += ' <ClippingPlanes/>\n';
|
|
57551
|
+
data += ' <Bitmaps/> \n';
|
|
57552
|
+
data += ' </VisualizationInfo>\n';
|
|
57553
|
+
|
|
57554
|
+
folder.file("viewpoint-" + uuid2 + ".bcfv", data);
|
|
57555
|
+
|
|
57556
|
+
jszip.generateAsync({type:"blob"})
|
|
57557
|
+
.then(function(content) {
|
|
57558
|
+
saveAs(content, file_pref + "_viewpoint.bcf");
|
|
57559
|
+
});
|
|
57560
|
+
});
|
|
57561
|
+
|
|
57429
57562
|
me.myEventCls.onIds("#" + me.pre + "mn1_exportVideo", "click", function(e) { me.icn3d; //e.preventDefault();
|
|
57430
57563
|
thisClass.setLogCmd("export video", false);
|
|
57431
57564
|
me.htmlCls.dialogCls.openDlg('dl_video', 'Save canvas changes in a video');
|
|
@@ -59166,13 +59299,13 @@ class ClickMenu {
|
|
|
59166
59299
|
thisClass.setLogCmd(value, true);
|
|
59167
59300
|
let axis;
|
|
59168
59301
|
if(direction == 'x') {
|
|
59169
|
-
axis = new
|
|
59302
|
+
axis = new Vector3$1(1,0,0);
|
|
59170
59303
|
}
|
|
59171
59304
|
else if(direction == 'y') {
|
|
59172
|
-
axis = new
|
|
59305
|
+
axis = new Vector3$1(0,1,0);
|
|
59173
59306
|
}
|
|
59174
59307
|
else if(direction == 'z') {
|
|
59175
|
-
axis = new
|
|
59308
|
+
axis = new Vector3$1(0,0,1);
|
|
59176
59309
|
}
|
|
59177
59310
|
let angle = 0.5 * Math.PI;
|
|
59178
59311
|
ic.transformCls.setRotation(axis, angle);
|
|
@@ -59483,8 +59616,8 @@ class ClickMenu {
|
|
|
59483
59616
|
if(!ic.quaternion) {
|
|
59484
59617
|
// reset parameters
|
|
59485
59618
|
ic._zoomFactor = 1.0;
|
|
59486
|
-
ic.mouseChange = new
|
|
59487
|
-
ic.quaternion = new
|
|
59619
|
+
ic.mouseChange = new Vector2$1(0,0);
|
|
59620
|
+
ic.quaternion = new Quaternion(0,0,0,1);
|
|
59488
59621
|
}
|
|
59489
59622
|
|
|
59490
59623
|
transformation.factor = ic._zoomFactor;
|
|
@@ -60289,6 +60422,7 @@ class SetMenu {
|
|
|
60289
60422
|
html += this.getLink('mn1_exportKabat', 'Kabat', undefined, 3);
|
|
60290
60423
|
html += this.getLink('mn1_exportImgt', 'IMGT', undefined, 3);
|
|
60291
60424
|
html += "</ul>";
|
|
60425
|
+
html += this.getLink('mn1_exportCamera', 'BCF Viewpoint', undefined, 2);
|
|
60292
60426
|
|
|
60293
60427
|
html += "<li><br/></li>";
|
|
60294
60428
|
|
|
@@ -61503,6 +61637,7 @@ class SetMenu {
|
|
|
61503
61637
|
|
|
61504
61638
|
html += this.getMenuText('mn6_develop', 'Develop', undefined, undefined, 1);
|
|
61505
61639
|
html += "<ul>";
|
|
61640
|
+
html += this.getMenuUrl('dev_contribute', me.htmlCls.baseUrl + "icn3d/icn3d.html#HowToContribute", "Become a Contributor", undefined, 2);
|
|
61506
61641
|
html += this.getMenuUrl('dev_embedicn3d2', me.htmlCls.baseUrl + "icn3d/icn3d.html#HowToUse", "Embed iCn3D", undefined, 2);
|
|
61507
61642
|
html += this.getMenuUrl('dev_urlpara', me.htmlCls.baseUrl + "icn3d/icn3d.html#parameters", "URL Parameters", undefined, 2);
|
|
61508
61643
|
html += this.getMenuUrl('dev_command', me.htmlCls.baseUrl + "icn3d/icn3d.html#commands", "Commands", undefined, 2);
|
|
@@ -63732,9 +63867,9 @@ class SetDialog {
|
|
|
63732
63867
|
|
|
63733
63868
|
group2tpl['IgFN3'] = ['Contactin1_2ee2A_human_FN3-n9', 'IL6Rb_1bquB_human_FN3-n2', 'IL6Rb_1bquB_human_FN3-n3', 'InsulinR_8guyE_human_FN3-n1', 'InsulinR_8guyE_human_FN3-n2', 'Sidekick2_1wf5A_human_FN3-n7'];
|
|
63734
63869
|
|
|
63735
|
-
group2tpl['IgFN3-like'] = ['ASF1A_2iijA_human', 'BArrestin1_4jqiA_rat_n1', 'C3_2qkiD_human_n1', 'MPT63_1lmiA_bacteria', 'NaCaExchanger_2fwuA_dog_n2', 'RBPJ_6py8C_human_Unk-n1', '
|
|
63870
|
+
group2tpl['IgFN3-like'] = ['ASF1A_2iijA_human', 'BArrestin1_4jqiA_rat_n1', 'C3_2qkiD_human_n1', 'MPT63_1lmiA_bacteria', 'NaCaExchanger_2fwuA_dog_n2', 'RBPJ_6py8C_human_Unk-n1', 'TEAD1_3kysC_human'];
|
|
63736
63871
|
|
|
63737
|
-
group2tpl['Other Ig'] = ['CD19_6al5A_human-n1', 'CuZnSuperoxideDismutase_1hl5C_human', 'ECadherin_4zt1A_human_n2', 'LaminAC_1ifrA_human', 'ORF7a_1xakA_virus'];
|
|
63872
|
+
group2tpl['Other Ig'] = ['CD19_6al5A_human-n1', 'CuZnSuperoxideDismutase_1hl5C_human', 'ECadherin_4zt1A_human_n2', 'LaminAC_1ifrA_human', 'ORF7a_1xakA_virus', 'RBPJ_6py8C_human_Unk-n2'];
|
|
63738
63873
|
|
|
63739
63874
|
let tpl2strandsig = {};
|
|
63740
63875
|
tpl2strandsig['ASF1A_2iijA_human'] = "A A' B C C' E F G G+";
|
|
@@ -94945,9 +95080,12 @@ class Domain3d {
|
|
|
94945
95080
|
|
|
94946
95081
|
// let subdomains = result.subdomains;
|
|
94947
95082
|
// let substruct = result.substruct;
|
|
95083
|
+
let jsonStr = '{"data": [';
|
|
94948
95084
|
|
|
94949
95085
|
let residueHash = ic.firstAtomObjCls.getResiduesFromAtoms(atoms);
|
|
94950
95086
|
let residueArray = Object.keys(residueHash);
|
|
95087
|
+
if(residueArray.length == 0) return jsonStr + ']}';
|
|
95088
|
+
|
|
94951
95089
|
let chnid = residueArray[0].substr(0, residueArray[0].lastIndexOf('_'));
|
|
94952
95090
|
|
|
94953
95091
|
// let resid1 = residueArray[0];
|
|
@@ -94998,7 +95136,7 @@ class Domain3d {
|
|
|
94998
95136
|
substruct = this.standardizeSubstruct(chnid, substruct, pos2resi);
|
|
94999
95137
|
|
|
95000
95138
|
// m_domains1: {"data": [ {"ss": [[1,20,30,x,y,z,x,y,z], [2,50,60,x,y,z,x,y,z]], "domain": [[1,43,x,y,z],[2,58,x,y,z], ...]}, {"ss": [[1,20,30,x,y,z,x,y,z], [2,50,60,x,y,z,x,y,z]],"domain": [[1,43,x,y,z],[2,58,x,y,z], ...]} ] }
|
|
95001
|
-
|
|
95139
|
+
|
|
95002
95140
|
//merge all subdomains into one domain
|
|
95003
95141
|
jsonStr += '{"ss": ['; //secondary structure
|
|
95004
95142
|
|
|
@@ -118390,12 +118528,12 @@ class DefinedSets {
|
|
|
118390
118528
|
}
|
|
118391
118529
|
|
|
118392
118530
|
setPredefinedInMenu() { let ic = this.icn3d, me = ic.icn3dui;
|
|
118393
|
-
// predefined sets: all chains
|
|
118394
|
-
this.setChainsInMenu();
|
|
118395
|
-
|
|
118396
118531
|
// predefined sets: proteins,nucleotides, chemicals
|
|
118397
118532
|
this.setProtNuclLigInMenu();
|
|
118398
118533
|
|
|
118534
|
+
// predefined sets: all chains
|
|
118535
|
+
this.setChainsInMenu();
|
|
118536
|
+
|
|
118399
118537
|
// show 3d domains for mmdbid
|
|
118400
118538
|
if(me.cfg.mmdbid !== undefined || me.cfg.gi !== undefined || me.cfg.chainalign !== undefined || me.cfg.mmdbafid !== undefined) {
|
|
118401
118539
|
for(let tddomainName in ic.tddomains) {
|
|
@@ -118493,10 +118631,15 @@ class DefinedSets {
|
|
|
118493
118631
|
return html;
|
|
118494
118632
|
}
|
|
118495
118633
|
|
|
118496
|
-
setChainsInMenu() { let ic = this.icn3d
|
|
118634
|
+
setChainsInMenu() { let ic = this.icn3d, me = ic.icn3dui;
|
|
118635
|
+
let nonProtNuclResHash = {};
|
|
118636
|
+
|
|
118497
118637
|
for(let chainid in ic.chains) {
|
|
118498
|
-
|
|
118499
|
-
|
|
118638
|
+
let atom = ic.firstAtomObjCls.getFirstAtomObj(ic.chains[chainid]);
|
|
118639
|
+
|
|
118640
|
+
// protein or nucleotide
|
|
118641
|
+
// if(ic.chainsSeq[chainid] && ic.chainsSeq[chainid].length > 1) {
|
|
118642
|
+
if(ic.proteins.hasOwnProperty(atom.serial) || ic.nucleotides.hasOwnProperty(atom.serial)) {
|
|
118500
118643
|
//ic.defNames2Atoms[chainid] = Object.keys(ic.chains[chainid]);
|
|
118501
118644
|
ic.defNames2Residues[chainid] = Object.keys(ic.firstAtomObjCls.getResiduesFromAtoms(ic.chains[chainid]));
|
|
118502
118645
|
ic.defNames2Descr[chainid] = chainid;
|
|
@@ -118507,6 +118650,25 @@ class DefinedSets {
|
|
|
118507
118650
|
|
|
118508
118651
|
ic.defNames2Command[chainid] = 'select $' + structure + '.' + chain;
|
|
118509
118652
|
}
|
|
118653
|
+
else { // chemicals, etc
|
|
118654
|
+
let resid = atom.structure + '_' + atom.chain + '_' + atom.resi;
|
|
118655
|
+
let resn = atom.resn.substr(0, 3);
|
|
118656
|
+
|
|
118657
|
+
if(!nonProtNuclResHash[resn]) {
|
|
118658
|
+
nonProtNuclResHash[resn] = ic.residues[resid];
|
|
118659
|
+
}
|
|
118660
|
+
else {
|
|
118661
|
+
nonProtNuclResHash[resn] = me.hashUtilsCls.unionHash(nonProtNuclResHash[atom.resn], ic.residues[resid]);
|
|
118662
|
+
}
|
|
118663
|
+
}
|
|
118664
|
+
}
|
|
118665
|
+
|
|
118666
|
+
// chemicals etc
|
|
118667
|
+
for(let resn in nonProtNuclResHash) {
|
|
118668
|
+
ic.defNames2Residues[resn] = Object.keys(ic.firstAtomObjCls.getResiduesFromAtoms(nonProtNuclResHash[resn]));
|
|
118669
|
+
ic.defNames2Descr[resn] = resn;
|
|
118670
|
+
|
|
118671
|
+
ic.defNames2Command[resn] = 'select :3' + resn;
|
|
118510
118672
|
}
|
|
118511
118673
|
|
|
118512
118674
|
// select whole structure
|
|
@@ -122785,7 +122947,7 @@ class Dssp {
|
|
|
122785
122947
|
ic.ref2igtype['PDL1_4z18B_human_V-n1'] = 'IgV';
|
|
122786
122948
|
ic.ref2igtype['Palladin_2dm3A_human_Iset-n1'] = 'IgI';
|
|
122787
122949
|
ic.ref2igtype['RBPJ_6py8C_human_Unk-n1'] = 'IgFN3-like';
|
|
122788
|
-
ic.ref2igtype['RBPJ_6py8C_human_Unk-n2'] = 'IgFN3-like';
|
|
122950
|
+
//ic.ref2igtype['RBPJ_6py8C_human_Unk-n2'] = 'IgFN3-like';
|
|
122789
122951
|
ic.ref2igtype['Sidekick2_1wf5A_human_FN3-n7'] = 'IgFN3';
|
|
122790
122952
|
ic.ref2igtype['Siglec3_5j0bB_human_C1-n2'] = 'IgC1';
|
|
122791
122953
|
ic.ref2igtype['TCRa_6jxrm_human_C1-n2'] = 'IgC1';
|
|
@@ -128879,7 +129041,7 @@ class SaveFile {
|
|
|
128879
129041
|
//The type "png" is used to save the current canvas image. The type "html" is used to save html file with the
|
|
128880
129042
|
//"data". This can be used to save any text. The type "text" is used to save an array of text, where "data" is
|
|
128881
129043
|
//actually an array. The type "binary" is used to save an array of binary, where "data" is actually an array.
|
|
128882
|
-
saveFile(filename, type, text, bBlob) { let ic = this.icn3d, me = ic.icn3dui;
|
|
129044
|
+
async saveFile(filename, type, text, bBlob, bReturnBlobOnly) { let ic = this.icn3d, me = ic.icn3dui;
|
|
128883
129045
|
let thisClass = this;
|
|
128884
129046
|
|
|
128885
129047
|
//Save file
|
|
@@ -128921,7 +129083,12 @@ class SaveFile {
|
|
|
128921
129083
|
|
|
128922
129084
|
if(me.utilsCls.isIE()) {
|
|
128923
129085
|
blob = ic.renderer.domElement.msToBlob();
|
|
129086
|
+
}
|
|
129087
|
+
else {
|
|
129088
|
+
blob = await this.getBlobFromNonIE();
|
|
129089
|
+
}
|
|
128924
129090
|
|
|
129091
|
+
if(!bReturnBlobOnly) {
|
|
128925
129092
|
if(bAddURL) {
|
|
128926
129093
|
let reader = new FileReader();
|
|
128927
129094
|
reader.onload = function(e) {
|
|
@@ -128947,33 +129114,7 @@ class SaveFile {
|
|
|
128947
129114
|
}
|
|
128948
129115
|
}
|
|
128949
129116
|
else {
|
|
128950
|
-
|
|
128951
|
-
if(bAddURL) {
|
|
128952
|
-
let reader = new FileReader();
|
|
128953
|
-
reader.onload = function(e) {
|
|
128954
|
-
let arrayBuffer = e.target.result; // or = reader.result;
|
|
128955
|
-
|
|
128956
|
-
let text = ic.shareLinkCls.getPngText();
|
|
128957
|
-
|
|
128958
|
-
blob = me.convertTypeCls.getBlobFromBufferAndText(arrayBuffer, text);
|
|
128959
|
-
|
|
128960
|
-
//ic.createLinkForBlob(blob, filename);
|
|
128961
|
-
thisClass.saveBlob(blob, filename, bBlob, width, height);
|
|
128962
|
-
|
|
128963
|
-
return blob;
|
|
128964
|
-
};
|
|
128965
|
-
|
|
128966
|
-
reader.readAsArrayBuffer(data);
|
|
128967
|
-
}
|
|
128968
|
-
else {
|
|
128969
|
-
blob = data;
|
|
128970
|
-
|
|
128971
|
-
//ic.createLinkForBlob(blob, filename);
|
|
128972
|
-
thisClass.saveBlob(blob, filename, bBlob, width, height);
|
|
128973
|
-
|
|
128974
|
-
return blob;
|
|
128975
|
-
}
|
|
128976
|
-
});
|
|
129117
|
+
return blob;
|
|
128977
129118
|
}
|
|
128978
129119
|
|
|
128979
129120
|
// reset the image size
|
|
@@ -129007,12 +129148,20 @@ class SaveFile {
|
|
|
129007
129148
|
|
|
129008
129149
|
if(type !== 'png') {
|
|
129009
129150
|
//https://github.com/eligrey/FileSaver.js/
|
|
129010
|
-
saveAs(blob, filename);
|
|
129151
|
+
if(!bReturnBlobOnly) saveAs(blob, filename);
|
|
129011
129152
|
}
|
|
129012
129153
|
|
|
129013
129154
|
return blob;
|
|
129014
129155
|
}
|
|
129015
129156
|
|
|
129157
|
+
getBlobFromNonIE() { let ic = this.icn3d; ic.icn3dui;
|
|
129158
|
+
return new Promise(function(resolve, reject) {
|
|
129159
|
+
ic.renderer.domElement.toBlob(function(data) {
|
|
129160
|
+
resolve(data);
|
|
129161
|
+
});
|
|
129162
|
+
})
|
|
129163
|
+
}
|
|
129164
|
+
|
|
129016
129165
|
saveBlob(blob, filename, bBlob, width, height) { let ic = this.icn3d; ic.icn3dui;
|
|
129017
129166
|
if(bBlob) {
|
|
129018
129167
|
let urlCreator = window.URL || window.webkitURL;
|
|
@@ -133312,7 +133461,7 @@ class iCn3DUI {
|
|
|
133312
133461
|
//even when multiple iCn3D viewers are shown together.
|
|
133313
133462
|
this.pre = this.cfg.divid + "_";
|
|
133314
133463
|
|
|
133315
|
-
this.REVISION = '3.44.
|
|
133464
|
+
this.REVISION = '3.44.1';
|
|
133316
133465
|
|
|
133317
133466
|
// In nodejs, iCn3D defines "window = {navigator: {}}"
|
|
133318
133467
|
this.bNode = (Object.keys(window).length < 2) ? true : false;
|