icn3d 3.44.0 → 3.44.2
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 +309 -49
- package/icn3d.min.js +4 -4
- package/icn3d.module.js +309 -49
- 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'>";
|
|
@@ -57380,6 +57387,10 @@ class ClickMenu {
|
|
|
57380
57387
|
me.htmlCls.dialogCls.openDlg('dl_state', 'Please input the state file');
|
|
57381
57388
|
});
|
|
57382
57389
|
|
|
57390
|
+
me.myEventCls.onIds("#" + me.pre + "mn1_bcfviewpoint", "click", function(e) { me.icn3d; //e.preventDefault();
|
|
57391
|
+
me.htmlCls.dialogCls.openDlg('dl_bcfviewpoint', 'Please input the BCF viewpoint file');
|
|
57392
|
+
});
|
|
57393
|
+
|
|
57383
57394
|
me.myEventCls.onIds("#" + me.pre + "mn1_selection", "click", function(e) { me.icn3d; //e.preventDefault();
|
|
57384
57395
|
me.htmlCls.dialogCls.openDlg('dl_selection', 'Please input the selection file');
|
|
57385
57396
|
});
|
|
@@ -57426,6 +57437,132 @@ class ClickMenu {
|
|
|
57426
57437
|
ic.saveFileCls.saveFile(file_pref + '_statefile.txt', 'command');
|
|
57427
57438
|
});
|
|
57428
57439
|
|
|
57440
|
+
me.myEventCls.onIds("#" + me.pre + "mn1_exportCamera", "click", async function(e) { let ic = me.icn3d; //e.preventDefault();
|
|
57441
|
+
thisClass.setLogCmd("export bcf viewpoint", false);
|
|
57442
|
+
let file_pref = Object.keys(ic.structures).join(',');
|
|
57443
|
+
//ic.saveFileCls.saveFile(file_pref + '_camera.bcf', 'bcf');
|
|
57444
|
+
|
|
57445
|
+
let url = './script/jszip.min.js';
|
|
57446
|
+
await me.getAjaxPromise(url, 'script');
|
|
57447
|
+
|
|
57448
|
+
let data, jszip = new JSZip();
|
|
57449
|
+
|
|
57450
|
+
let uuid1 = thisClass.uuidv4();
|
|
57451
|
+
let uuid2 = thisClass.uuidv4();
|
|
57452
|
+
|
|
57453
|
+
data = '';
|
|
57454
|
+
data += '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\n';
|
|
57455
|
+
data += ' <Version VersionId="3.0"/>\n';
|
|
57456
|
+
|
|
57457
|
+
jszip.file("bcf.version", data);
|
|
57458
|
+
|
|
57459
|
+
data = '';
|
|
57460
|
+
data += '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\n';
|
|
57461
|
+
data += ' <Extensions>\n';
|
|
57462
|
+
data += ' <TopicTypes>\n';
|
|
57463
|
+
data += ' <TopicType>ERROR</TopicType>\n';
|
|
57464
|
+
data += ' <TopicType>WARNING</TopicType>\n';
|
|
57465
|
+
data += ' <TopicType>INFORMATION</TopicType>\n';
|
|
57466
|
+
data += ' <TopicType>CLASH</TopicType>\n';
|
|
57467
|
+
data += ' <TopicType>OTHER</TopicType>\n';
|
|
57468
|
+
data += ' </TopicTypes>\n';
|
|
57469
|
+
data += ' <TopicStatuses>\n';
|
|
57470
|
+
data += ' <TopicStatus>OPEN</TopicStatus>\n';
|
|
57471
|
+
data += ' <TopicStatus>IN_PROGRESS</TopicStatus>\n';
|
|
57472
|
+
data += ' <TopicStatus>SOLVED</TopicStatus>\n';
|
|
57473
|
+
data += ' <TopicStatus>CLOSED</TopicStatus>\n';
|
|
57474
|
+
data += ' </TopicStatuses>\n';
|
|
57475
|
+
data += ' <Priorities>\n';
|
|
57476
|
+
data += ' <Priority>LOW</Priority>\n';
|
|
57477
|
+
data += ' <Priority>MEDIUM</Priority>\n';
|
|
57478
|
+
data += ' <Priority>HIGH</Priority>\n';
|
|
57479
|
+
data += ' <Priority>CRITICAL</Priority>\n';
|
|
57480
|
+
data += ' </Priorities>\n';
|
|
57481
|
+
data += ' <TopicLabels/>\n';
|
|
57482
|
+
data += ' <Users/>\n';
|
|
57483
|
+
data += ' <SnippetTypes/>\n';
|
|
57484
|
+
data += ' <Stages/>\n';
|
|
57485
|
+
data += ' </Extensions>\n';
|
|
57486
|
+
|
|
57487
|
+
jszip.file("extensions.xml", data);
|
|
57488
|
+
|
|
57489
|
+
let folder = jszip.folder(uuid1);
|
|
57490
|
+
|
|
57491
|
+
data = '';
|
|
57492
|
+
data += '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\n';
|
|
57493
|
+
data += ' <Markup>\n';
|
|
57494
|
+
data += ' <Header>\n';
|
|
57495
|
+
data += ' <Files/>\n';
|
|
57496
|
+
data += ' </Header> \n';
|
|
57497
|
+
data += ' <Topic Guid="' + uuid1 + '">\n';
|
|
57498
|
+
data += ' <Title>Perspective camera</Title>\n';
|
|
57499
|
+
|
|
57500
|
+
let now = new Date();
|
|
57501
|
+
const isoString = now.toISOString();
|
|
57502
|
+
|
|
57503
|
+
data += ' <CreationDate>' + isoString + '</CreationDate>\n';
|
|
57504
|
+
data += ' <CreationAuthor>https://www.ncbi.nlm.nih.gov/Structure/icn3d</CreationAuthor>\n';
|
|
57505
|
+
data += ' <DocumentReferences/>\n';
|
|
57506
|
+
data += ' <RelatedTopics/>\n';
|
|
57507
|
+
data += ' <Comments/>\n';
|
|
57508
|
+
data += ' <Viewpoints>\n';
|
|
57509
|
+
data += ' <ViewPoint Guid="' + uuid2 + '">\n';
|
|
57510
|
+
data += ' <Viewpoint>viewpoint-' + uuid2 + '.bcfv</Viewpoint>\n';
|
|
57511
|
+
data += ' <Snapshot>snapshot-' + uuid2 + '.png</Snapshot>\n';
|
|
57512
|
+
data += ' </ViewPoint>\n';
|
|
57513
|
+
data += ' </Viewpoints>\n';
|
|
57514
|
+
data += ' </Topic>\n';
|
|
57515
|
+
data += ' </Markup>\n';
|
|
57516
|
+
|
|
57517
|
+
folder.file("markup.bcf", data);
|
|
57518
|
+
let blob = await ic.saveFileCls.saveFile('any', 'png', undefined, undefined, true);
|
|
57519
|
+
|
|
57520
|
+
folder.file("snapshot-" + uuid2 + ".png", blob);
|
|
57521
|
+
|
|
57522
|
+
data = '';
|
|
57523
|
+
|
|
57524
|
+
data += '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\n';
|
|
57525
|
+
data += ' <VisualizationInfo Guid="' + uuid2 + '">\n';
|
|
57526
|
+
data += ' <Components>\n';
|
|
57527
|
+
data += ' <Selection/>\n';
|
|
57528
|
+
data += ' <Visibility DefaultVisibility="true" />\n';
|
|
57529
|
+
data += ' <Coloring/>\n';
|
|
57530
|
+
data += ' </Components>\n';
|
|
57531
|
+
data += ' <PerspectiveCamera>\n';
|
|
57532
|
+
data += ' <CameraViewPoint>\n';
|
|
57533
|
+
data += ' <X>' + ic.cam.position.x + '</X>\n';
|
|
57534
|
+
data += ' <Y>' + ic.cam.position.y + '</Y>\n';
|
|
57535
|
+
data += ' <Z>' + ic.cam.position.z + '</Z>\n';
|
|
57536
|
+
data += ' </CameraViewPoint>\n';
|
|
57537
|
+
|
|
57538
|
+
let direction = (new Vector3$1(0, 0, -1)).applyQuaternion(ic.cam.quaternion);
|
|
57539
|
+
|
|
57540
|
+
data += ' <CameraDirection>\n';
|
|
57541
|
+
data += ' <X>' + direction.x + '</X>\n';
|
|
57542
|
+
data += ' <Y>' + direction.y + '</Y>\n';
|
|
57543
|
+
data += ' <Z>' + direction.z + '</Z>\n';
|
|
57544
|
+
data += ' </CameraDirection>\n';
|
|
57545
|
+
data += ' <CameraUpVector>\n';
|
|
57546
|
+
data += ' <X>' + ic.cam.up.x + '</X>\n';
|
|
57547
|
+
data += ' <Y>' + ic.cam.up.y + '</Y>\n';
|
|
57548
|
+
data += ' <Z>' + ic.cam.up.z + '</Z>\n';
|
|
57549
|
+
data += ' </CameraUpVector>\n';
|
|
57550
|
+
data += ' <FieldOfView>' + ic.cam.fov + '</FieldOfView>\n'; // 20
|
|
57551
|
+
data += ' <AspectRatio>' + ic.container.whratio + '</AspectRatio>\n';
|
|
57552
|
+
data += ' </PerspectiveCamera>\n';
|
|
57553
|
+
data += ' <Lines/>\n';
|
|
57554
|
+
data += ' <ClippingPlanes/>\n';
|
|
57555
|
+
data += ' <Bitmaps/> \n';
|
|
57556
|
+
data += ' </VisualizationInfo>\n';
|
|
57557
|
+
|
|
57558
|
+
folder.file("viewpoint-" + uuid2 + ".bcfv", data);
|
|
57559
|
+
|
|
57560
|
+
jszip.generateAsync({type:"blob"})
|
|
57561
|
+
.then(function(content) {
|
|
57562
|
+
saveAs(content, file_pref + "_viewpoint.bcf");
|
|
57563
|
+
});
|
|
57564
|
+
});
|
|
57565
|
+
|
|
57429
57566
|
me.myEventCls.onIds("#" + me.pre + "mn1_exportVideo", "click", function(e) { me.icn3d; //e.preventDefault();
|
|
57430
57567
|
thisClass.setLogCmd("export video", false);
|
|
57431
57568
|
me.htmlCls.dialogCls.openDlg('dl_video', 'Save canvas changes in a video');
|
|
@@ -59166,13 +59303,13 @@ class ClickMenu {
|
|
|
59166
59303
|
thisClass.setLogCmd(value, true);
|
|
59167
59304
|
let axis;
|
|
59168
59305
|
if(direction == 'x') {
|
|
59169
|
-
axis = new
|
|
59306
|
+
axis = new Vector3$1(1,0,0);
|
|
59170
59307
|
}
|
|
59171
59308
|
else if(direction == 'y') {
|
|
59172
|
-
axis = new
|
|
59309
|
+
axis = new Vector3$1(0,1,0);
|
|
59173
59310
|
}
|
|
59174
59311
|
else if(direction == 'z') {
|
|
59175
|
-
axis = new
|
|
59312
|
+
axis = new Vector3$1(0,0,1);
|
|
59176
59313
|
}
|
|
59177
59314
|
let angle = 0.5 * Math.PI;
|
|
59178
59315
|
ic.transformCls.setRotation(axis, angle);
|
|
@@ -59483,8 +59620,8 @@ class ClickMenu {
|
|
|
59483
59620
|
if(!ic.quaternion) {
|
|
59484
59621
|
// reset parameters
|
|
59485
59622
|
ic._zoomFactor = 1.0;
|
|
59486
|
-
ic.mouseChange = new
|
|
59487
|
-
ic.quaternion = new
|
|
59623
|
+
ic.mouseChange = new Vector2$1(0,0);
|
|
59624
|
+
ic.quaternion = new Quaternion(0,0,0,1);
|
|
59488
59625
|
}
|
|
59489
59626
|
|
|
59490
59627
|
transformation.factor = ic._zoomFactor;
|
|
@@ -60167,6 +60304,7 @@ class SetMenu {
|
|
|
60167
60304
|
html += this.getLink('mn1_fixedversion', 'Share Link in Archived Ver. ' + me.htmlCls.wifiStr, undefined, 2);
|
|
60168
60305
|
html += this.getLink('mn1_selection', 'Selection File', undefined, 2);
|
|
60169
60306
|
html += this.getLink("mn1_collection", "Collection File", undefined, 2);
|
|
60307
|
+
html += this.getLink('mn1_bcfviewpoint', 'BCF Viewpoint File', undefined, 2);
|
|
60170
60308
|
|
|
60171
60309
|
html += this.getMenuSep();
|
|
60172
60310
|
|
|
@@ -60289,6 +60427,7 @@ class SetMenu {
|
|
|
60289
60427
|
html += this.getLink('mn1_exportKabat', 'Kabat', undefined, 3);
|
|
60290
60428
|
html += this.getLink('mn1_exportImgt', 'IMGT', undefined, 3);
|
|
60291
60429
|
html += "</ul>";
|
|
60430
|
+
html += this.getLink('mn1_exportCamera', 'BCF Viewpoint', undefined, 2);
|
|
60292
60431
|
|
|
60293
60432
|
html += "<li><br/></li>";
|
|
60294
60433
|
|
|
@@ -61503,6 +61642,7 @@ class SetMenu {
|
|
|
61503
61642
|
|
|
61504
61643
|
html += this.getMenuText('mn6_develop', 'Develop', undefined, undefined, 1);
|
|
61505
61644
|
html += "<ul>";
|
|
61645
|
+
html += this.getMenuUrl('dev_contribute', me.htmlCls.baseUrl + "icn3d/icn3d.html#HowToContribute", "Become a Contributor", undefined, 2);
|
|
61506
61646
|
html += this.getMenuUrl('dev_embedicn3d2', me.htmlCls.baseUrl + "icn3d/icn3d.html#HowToUse", "Embed iCn3D", undefined, 2);
|
|
61507
61647
|
html += this.getMenuUrl('dev_urlpara', me.htmlCls.baseUrl + "icn3d/icn3d.html#parameters", "URL Parameters", undefined, 2);
|
|
61508
61648
|
html += this.getMenuUrl('dev_command', me.htmlCls.baseUrl + "icn3d/icn3d.html#commands", "Commands", undefined, 2);
|
|
@@ -62653,6 +62793,12 @@ class SetDialog {
|
|
|
62653
62793
|
html += me.htmlCls.buttonStr + "reload_state' style='margin-top: 6px;'>Load</button>";
|
|
62654
62794
|
html += "</div>";
|
|
62655
62795
|
|
|
62796
|
+
html += me.htmlCls.divStr + "dl_bcfviewpoint' class='" + dialogClass + "'>";
|
|
62797
|
+
html += this.addNotebookTitle('dl_bcfviewpoint', 'Please input a BCF viewpoint file');
|
|
62798
|
+
html += "BCF viewpoint file: " + me.htmlCls.inputFileStr + "id='" + me.pre + "bcfviewpoint'><br/>";
|
|
62799
|
+
html += me.htmlCls.buttonStr + "reload_bcfviewpoint' style='margin-top: 6px;'>Load</button>";
|
|
62800
|
+
html += "</div>";
|
|
62801
|
+
|
|
62656
62802
|
html += me.htmlCls.divStr + "dl_video' class='" + dialogClass + "'>";
|
|
62657
62803
|
html += this.addNotebookTitle('dl_video', 'Save canvas changes in a video');
|
|
62658
62804
|
html += "State file: " + me.htmlCls.inputFileStr + "id='" + me.pre + "state'><br/>";
|
|
@@ -63732,9 +63878,9 @@ class SetDialog {
|
|
|
63732
63878
|
|
|
63733
63879
|
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
63880
|
|
|
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', '
|
|
63881
|
+
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
63882
|
|
|
63737
|
-
group2tpl['Other Ig'] = ['CD19_6al5A_human-n1', 'CuZnSuperoxideDismutase_1hl5C_human', 'ECadherin_4zt1A_human_n2', 'LaminAC_1ifrA_human', 'ORF7a_1xakA_virus'];
|
|
63883
|
+
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
63884
|
|
|
63739
63885
|
let tpl2strandsig = {};
|
|
63740
63886
|
tpl2strandsig['ASF1A_2iijA_human'] = "A A' B C C' E F G G+";
|
|
@@ -64147,6 +64293,67 @@ class Events {
|
|
|
64147
64293
|
}
|
|
64148
64294
|
}
|
|
64149
64295
|
|
|
64296
|
+
async openBcf(file) { let me = this.icn3dui, ic = me.icn3d;
|
|
64297
|
+
let url = './script/jszip.min.js';
|
|
64298
|
+
await me.getAjaxPromise(url, 'script');
|
|
64299
|
+
|
|
64300
|
+
let jszip = new JSZip();
|
|
64301
|
+
|
|
64302
|
+
me.htmlCls.setHtmlCls.fileSupport();
|
|
64303
|
+
|
|
64304
|
+
jszip.loadAsync(file).then(function(zip) {
|
|
64305
|
+
zip.forEach(function (relativePath, zipEntry) {
|
|
64306
|
+
if (zipEntry.dir) {
|
|
64307
|
+
// Handle directory creation
|
|
64308
|
+
let folder = jszip.folder(relativePath);
|
|
64309
|
+
folder.forEach(function (filename, zipEntry2) {
|
|
64310
|
+
if(filename.substr(0, 9) == 'viewpoint') {
|
|
64311
|
+
zipEntry2.async('string') // or 'blob', 'arraybuffer'
|
|
64312
|
+
.then(function(fileData) {
|
|
64313
|
+
let parser = new DOMParser();
|
|
64314
|
+
let xmlDoc = parser.parseFromString(fileData, "text/xml");
|
|
64315
|
+
|
|
64316
|
+
// Accessing elements
|
|
64317
|
+
//const author = xmlDoc.getElementsByTagName("author")[0].textContent;
|
|
64318
|
+
//const author = xmlDoc.querySelector("author").textContent;
|
|
64319
|
+
let viewpoint = xmlDoc.querySelector("CameraViewPoint");
|
|
64320
|
+
let direction = xmlDoc.querySelector("CameraDirection");
|
|
64321
|
+
let upvector = xmlDoc.querySelector("CameraUpVector");
|
|
64322
|
+
let fov = xmlDoc.querySelector("FieldOfView").textContent;
|
|
64323
|
+
xmlDoc.querySelector("AspectRatio").textContent;
|
|
64324
|
+
|
|
64325
|
+
let childNodes, viewpointArray = [], directionArray = [], upvectorArray = [];
|
|
64326
|
+
|
|
64327
|
+
childNodes = viewpoint.children;
|
|
64328
|
+
viewpointArray = [childNodes[0].textContent, childNodes[1].textContent, childNodes[2].textContent];
|
|
64329
|
+
childNodes = direction.children;
|
|
64330
|
+
directionArray = [childNodes[0].textContent, childNodes[1].textContent, childNodes[2].textContent];
|
|
64331
|
+
childNodes = upvector.children;
|
|
64332
|
+
upvectorArray = [childNodes[0].textContent, childNodes[1].textContent, childNodes[2].textContent];
|
|
64333
|
+
|
|
64334
|
+
ic.cam.position.set(viewpointArray[0], viewpointArray[1], viewpointArray[2]);
|
|
64335
|
+
ic.cam.quaternion.setFromUnitVectors(new Vector3$1(0, 0, -1), new Vector3$1(directionArray[0], directionArray[1], directionArray[2]));
|
|
64336
|
+
ic.cam.up.set(upvectorArray[0], upvectorArray[1], upvectorArray[2]);
|
|
64337
|
+
ic.cam.fov = fov;
|
|
64338
|
+
//ic.container.whratio = aspect;
|
|
64339
|
+
|
|
64340
|
+
ic.drawCls.applyTransformation(ic._zoomFactor, ic.mouseChange, ic.quaternion);
|
|
64341
|
+
ic.drawCls.render();
|
|
64342
|
+
});
|
|
64343
|
+
}
|
|
64344
|
+
});
|
|
64345
|
+
}
|
|
64346
|
+
// else {
|
|
64347
|
+
// // Handle file extraction
|
|
64348
|
+
// zipEntry.async("string").then(function (content) {
|
|
64349
|
+
// });
|
|
64350
|
+
// }
|
|
64351
|
+
});
|
|
64352
|
+
}, function (e) {
|
|
64353
|
+
console.error("Error loading BCF viewpoint file:", e);
|
|
64354
|
+
});
|
|
64355
|
+
}
|
|
64356
|
+
|
|
64150
64357
|
//Hold all functions related to click events.
|
|
64151
64358
|
allEventFunctions() { let me = this.icn3dui, ic = me.icn3d;
|
|
64152
64359
|
let thisClass = this;
|
|
@@ -64573,7 +64780,7 @@ class Events {
|
|
|
64573
64780
|
let v2Y = $("#" + me.pre + "v2Y").val();
|
|
64574
64781
|
let v2Z = $("#" + me.pre + "v2Z").val();
|
|
64575
64782
|
|
|
64576
|
-
let angleRad = new
|
|
64783
|
+
let angleRad = new Vector3$1(parseFloat(v1X), parseFloat(v1Y), parseFloat(v1Z)).angleTo(new Vector3$1(parseFloat(v2X), parseFloat(v2Y), parseFloat(v2Z)));
|
|
64577
64784
|
let angle = angleRad / 3.1416 * 180;
|
|
64578
64785
|
angle = Math.abs(angle).toFixed(0);
|
|
64579
64786
|
if(angle > 180) angle -= 180;
|
|
@@ -65239,6 +65446,19 @@ class Events {
|
|
|
65239
65446
|
}
|
|
65240
65447
|
});
|
|
65241
65448
|
|
|
65449
|
+
me.myEventCls.onIds("#" + me.pre + "reload_bcfviewpoint", "click", async function(e) { me.icn3d;
|
|
65450
|
+
e.preventDefault();
|
|
65451
|
+
if(!me.cfg.notebook) dialog.dialog( "close" );
|
|
65452
|
+
|
|
65453
|
+
let file = $("#" + me.pre + "bcfviewpoint")[0].files[0];
|
|
65454
|
+
if(!file) {
|
|
65455
|
+
var aaa = 1; //alert("Please select a file before clicking 'Load'");
|
|
65456
|
+
}
|
|
65457
|
+
else {
|
|
65458
|
+
await thisClass.openBcf(file);
|
|
65459
|
+
}
|
|
65460
|
+
});
|
|
65461
|
+
|
|
65242
65462
|
me.myEventCls.onIds("#" + me.pre + "reload_selectionfile", "click", function(e) { let ic = me.icn3d;
|
|
65243
65463
|
e.preventDefault();
|
|
65244
65464
|
if(!me.cfg.notebook) dialog.dialog( "close" );
|
|
@@ -66674,8 +66894,8 @@ class Events {
|
|
|
66674
66894
|
let posArray1 = ic.contactCls.getExtent(atomSet1);
|
|
66675
66895
|
let posArray2 = ic.contactCls.getExtent(atomSet2);
|
|
66676
66896
|
|
|
66677
|
-
let pos1 = new
|
|
66678
|
-
let pos2 = new
|
|
66897
|
+
let pos1 = new Vector3$1(posArray1[2][0], posArray1[2][1], posArray1[2][2]);
|
|
66898
|
+
let pos2 = new Vector3$1(posArray2[2][0], posArray2[2][1], posArray2[2][2]);
|
|
66679
66899
|
|
|
66680
66900
|
let radius = $("#" + me.pre + "linebtwsets_radius").val();
|
|
66681
66901
|
let color = $("#" + me.pre + "linebtwsets_customcolor").val();
|
|
@@ -66699,7 +66919,7 @@ class Events {
|
|
|
66699
66919
|
let nameArray = $("#" + me.pre + "cartoonshape").val();
|
|
66700
66920
|
let atomSet1 = ic.definedSetsCls.getAtomsFromNameArray(nameArray);
|
|
66701
66921
|
let posArray1 = ic.contactCls.getExtent(atomSet1);
|
|
66702
|
-
let pos1 = new
|
|
66922
|
+
let pos1 = new Vector3$1(posArray1[2][0], posArray1[2][1], posArray1[2][2]);
|
|
66703
66923
|
|
|
66704
66924
|
let shape = $("#" + me.pre + "cartoonshape_shape").val(); // Sphere or Cube
|
|
66705
66925
|
let radius = $("#" + me.pre + "cartoonshape_radius").val();
|
|
@@ -67160,6 +67380,32 @@ class Events {
|
|
|
67160
67380
|
thisClass.setLogCmd("set theme black", true);
|
|
67161
67381
|
});
|
|
67162
67382
|
|
|
67383
|
+
// dragover and drop
|
|
67384
|
+
me.myEventCls.onIds("#" + me.pre + "viewer", "dragover", function(e) { me.icn3d;
|
|
67385
|
+
e.preventDefault();
|
|
67386
|
+
$("#" + me.pre + "viewer")[0].style.border = "5px solid blue";
|
|
67387
|
+
});
|
|
67388
|
+
me.myEventCls.onIds("#" + me.pre + "viewer", "drop", async function(e) { me.icn3d;
|
|
67389
|
+
e.preventDefault();
|
|
67390
|
+
|
|
67391
|
+
let files = e.dataTransfer.files;
|
|
67392
|
+
|
|
67393
|
+
for(let i = 0, il = e.dataTransfer.files.length; i < il; ++i) {
|
|
67394
|
+
let file = e.dataTransfer.files[i];
|
|
67395
|
+
let fileName = file.name;
|
|
67396
|
+
|
|
67397
|
+
let fileType = fileName.substr(fileName.lastIndexOf('.') + 1).toLowerCase();
|
|
67398
|
+
if(fileType == 'pdb' || fileType == 'mmcif' || fileType == 'png') {
|
|
67399
|
+
await me.htmlCls.eventsCls.readFile(true, files, i, '', (fileType == 'mmcif'), (fileType == 'png'));
|
|
67400
|
+
}
|
|
67401
|
+
else if(fileType == 'bcf') {
|
|
67402
|
+
await thisClass.openBcf(file);
|
|
67403
|
+
}
|
|
67404
|
+
}
|
|
67405
|
+
|
|
67406
|
+
$("#" + me.pre + "viewer")[0].style.border = "0px solid black";
|
|
67407
|
+
});
|
|
67408
|
+
|
|
67163
67409
|
$(document).on("click", "." + me.pre + "snpin3d", async function(e) { let ic = me.icn3d;
|
|
67164
67410
|
e.stopImmediatePropagation();
|
|
67165
67411
|
|
|
@@ -94945,9 +95191,12 @@ class Domain3d {
|
|
|
94945
95191
|
|
|
94946
95192
|
// let subdomains = result.subdomains;
|
|
94947
95193
|
// let substruct = result.substruct;
|
|
95194
|
+
let jsonStr = '{"data": [';
|
|
94948
95195
|
|
|
94949
95196
|
let residueHash = ic.firstAtomObjCls.getResiduesFromAtoms(atoms);
|
|
94950
95197
|
let residueArray = Object.keys(residueHash);
|
|
95198
|
+
if(residueArray.length == 0) return jsonStr + ']}';
|
|
95199
|
+
|
|
94951
95200
|
let chnid = residueArray[0].substr(0, residueArray[0].lastIndexOf('_'));
|
|
94952
95201
|
|
|
94953
95202
|
// let resid1 = residueArray[0];
|
|
@@ -94998,7 +95247,7 @@ class Domain3d {
|
|
|
94998
95247
|
substruct = this.standardizeSubstruct(chnid, substruct, pos2resi);
|
|
94999
95248
|
|
|
95000
95249
|
// 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
|
-
|
|
95250
|
+
|
|
95002
95251
|
//merge all subdomains into one domain
|
|
95003
95252
|
jsonStr += '{"ss": ['; //secondary structure
|
|
95004
95253
|
|
|
@@ -118390,12 +118639,12 @@ class DefinedSets {
|
|
|
118390
118639
|
}
|
|
118391
118640
|
|
|
118392
118641
|
setPredefinedInMenu() { let ic = this.icn3d, me = ic.icn3dui;
|
|
118393
|
-
// predefined sets: all chains
|
|
118394
|
-
this.setChainsInMenu();
|
|
118395
|
-
|
|
118396
118642
|
// predefined sets: proteins,nucleotides, chemicals
|
|
118397
118643
|
this.setProtNuclLigInMenu();
|
|
118398
118644
|
|
|
118645
|
+
// predefined sets: all chains
|
|
118646
|
+
this.setChainsInMenu();
|
|
118647
|
+
|
|
118399
118648
|
// show 3d domains for mmdbid
|
|
118400
118649
|
if(me.cfg.mmdbid !== undefined || me.cfg.gi !== undefined || me.cfg.chainalign !== undefined || me.cfg.mmdbafid !== undefined) {
|
|
118401
118650
|
for(let tddomainName in ic.tddomains) {
|
|
@@ -118493,10 +118742,15 @@ class DefinedSets {
|
|
|
118493
118742
|
return html;
|
|
118494
118743
|
}
|
|
118495
118744
|
|
|
118496
|
-
setChainsInMenu() { let ic = this.icn3d
|
|
118745
|
+
setChainsInMenu() { let ic = this.icn3d, me = ic.icn3dui;
|
|
118746
|
+
let nonProtNuclResHash = {};
|
|
118747
|
+
|
|
118497
118748
|
for(let chainid in ic.chains) {
|
|
118498
|
-
|
|
118499
|
-
|
|
118749
|
+
let atom = ic.firstAtomObjCls.getFirstAtomObj(ic.chains[chainid]);
|
|
118750
|
+
|
|
118751
|
+
// protein or nucleotide
|
|
118752
|
+
// if(ic.chainsSeq[chainid] && ic.chainsSeq[chainid].length > 1) {
|
|
118753
|
+
if(ic.proteins.hasOwnProperty(atom.serial) || ic.nucleotides.hasOwnProperty(atom.serial)) {
|
|
118500
118754
|
//ic.defNames2Atoms[chainid] = Object.keys(ic.chains[chainid]);
|
|
118501
118755
|
ic.defNames2Residues[chainid] = Object.keys(ic.firstAtomObjCls.getResiduesFromAtoms(ic.chains[chainid]));
|
|
118502
118756
|
ic.defNames2Descr[chainid] = chainid;
|
|
@@ -118507,6 +118761,25 @@ class DefinedSets {
|
|
|
118507
118761
|
|
|
118508
118762
|
ic.defNames2Command[chainid] = 'select $' + structure + '.' + chain;
|
|
118509
118763
|
}
|
|
118764
|
+
else { // chemicals, etc
|
|
118765
|
+
let resid = atom.structure + '_' + atom.chain + '_' + atom.resi;
|
|
118766
|
+
let resn = atom.resn.substr(0, 3);
|
|
118767
|
+
|
|
118768
|
+
if(!nonProtNuclResHash[resn]) {
|
|
118769
|
+
nonProtNuclResHash[resn] = ic.residues[resid];
|
|
118770
|
+
}
|
|
118771
|
+
else {
|
|
118772
|
+
nonProtNuclResHash[resn] = me.hashUtilsCls.unionHash(nonProtNuclResHash[atom.resn], ic.residues[resid]);
|
|
118773
|
+
}
|
|
118774
|
+
}
|
|
118775
|
+
}
|
|
118776
|
+
|
|
118777
|
+
// chemicals etc
|
|
118778
|
+
for(let resn in nonProtNuclResHash) {
|
|
118779
|
+
ic.defNames2Residues[resn] = Object.keys(ic.firstAtomObjCls.getResiduesFromAtoms(nonProtNuclResHash[resn]));
|
|
118780
|
+
ic.defNames2Descr[resn] = resn;
|
|
118781
|
+
|
|
118782
|
+
ic.defNames2Command[resn] = 'select :3' + resn;
|
|
118510
118783
|
}
|
|
118511
118784
|
|
|
118512
118785
|
// select whole structure
|
|
@@ -122785,7 +123058,7 @@ class Dssp {
|
|
|
122785
123058
|
ic.ref2igtype['PDL1_4z18B_human_V-n1'] = 'IgV';
|
|
122786
123059
|
ic.ref2igtype['Palladin_2dm3A_human_Iset-n1'] = 'IgI';
|
|
122787
123060
|
ic.ref2igtype['RBPJ_6py8C_human_Unk-n1'] = 'IgFN3-like';
|
|
122788
|
-
ic.ref2igtype['RBPJ_6py8C_human_Unk-n2'] = 'IgFN3-like';
|
|
123061
|
+
//ic.ref2igtype['RBPJ_6py8C_human_Unk-n2'] = 'IgFN3-like';
|
|
122789
123062
|
ic.ref2igtype['Sidekick2_1wf5A_human_FN3-n7'] = 'IgFN3';
|
|
122790
123063
|
ic.ref2igtype['Siglec3_5j0bB_human_C1-n2'] = 'IgC1';
|
|
122791
123064
|
ic.ref2igtype['TCRa_6jxrm_human_C1-n2'] = 'IgC1';
|
|
@@ -128879,7 +129152,7 @@ class SaveFile {
|
|
|
128879
129152
|
//The type "png" is used to save the current canvas image. The type "html" is used to save html file with the
|
|
128880
129153
|
//"data". This can be used to save any text. The type "text" is used to save an array of text, where "data" is
|
|
128881
129154
|
//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;
|
|
129155
|
+
async saveFile(filename, type, text, bBlob, bReturnBlobOnly) { let ic = this.icn3d, me = ic.icn3dui;
|
|
128883
129156
|
let thisClass = this;
|
|
128884
129157
|
|
|
128885
129158
|
//Save file
|
|
@@ -128921,7 +129194,12 @@ class SaveFile {
|
|
|
128921
129194
|
|
|
128922
129195
|
if(me.utilsCls.isIE()) {
|
|
128923
129196
|
blob = ic.renderer.domElement.msToBlob();
|
|
129197
|
+
}
|
|
129198
|
+
else {
|
|
129199
|
+
blob = await this.getBlobFromNonIE();
|
|
129200
|
+
}
|
|
128924
129201
|
|
|
129202
|
+
if(!bReturnBlobOnly) {
|
|
128925
129203
|
if(bAddURL) {
|
|
128926
129204
|
let reader = new FileReader();
|
|
128927
129205
|
reader.onload = function(e) {
|
|
@@ -128947,33 +129225,7 @@ class SaveFile {
|
|
|
128947
129225
|
}
|
|
128948
129226
|
}
|
|
128949
129227
|
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
|
-
});
|
|
129228
|
+
return blob;
|
|
128977
129229
|
}
|
|
128978
129230
|
|
|
128979
129231
|
// reset the image size
|
|
@@ -129007,12 +129259,20 @@ class SaveFile {
|
|
|
129007
129259
|
|
|
129008
129260
|
if(type !== 'png') {
|
|
129009
129261
|
//https://github.com/eligrey/FileSaver.js/
|
|
129010
|
-
saveAs(blob, filename);
|
|
129262
|
+
if(!bReturnBlobOnly) saveAs(blob, filename);
|
|
129011
129263
|
}
|
|
129012
129264
|
|
|
129013
129265
|
return blob;
|
|
129014
129266
|
}
|
|
129015
129267
|
|
|
129268
|
+
getBlobFromNonIE() { let ic = this.icn3d; ic.icn3dui;
|
|
129269
|
+
return new Promise(function(resolve, reject) {
|
|
129270
|
+
ic.renderer.domElement.toBlob(function(data) {
|
|
129271
|
+
resolve(data);
|
|
129272
|
+
});
|
|
129273
|
+
})
|
|
129274
|
+
}
|
|
129275
|
+
|
|
129016
129276
|
saveBlob(blob, filename, bBlob, width, height) { let ic = this.icn3d; ic.icn3dui;
|
|
129017
129277
|
if(bBlob) {
|
|
129018
129278
|
let urlCreator = window.URL || window.webkitURL;
|
|
@@ -133312,7 +133572,7 @@ class iCn3DUI {
|
|
|
133312
133572
|
//even when multiple iCn3D viewers are shown together.
|
|
133313
133573
|
this.pre = this.cfg.divid + "_";
|
|
133314
133574
|
|
|
133315
|
-
this.REVISION = '3.44.
|
|
133575
|
+
this.REVISION = '3.44.2';
|
|
133316
133576
|
|
|
133317
133577
|
// In nodejs, iCn3D defines "window = {navigator: {}}"
|
|
133318
133578
|
this.bNode = (Object.keys(window).length < 2) ? true : false;
|