icn3d 3.39.1 → 3.40.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.module.js CHANGED
@@ -13693,6 +13693,10 @@ class SetMenu {
13693
13693
 
13694
13694
  html += "<ul class='icn3d-mn-item'>";
13695
13695
 
13696
+ if(me.cfg.cid !== undefined || me.cfg.smiles !== undefined) {
13697
+ html += this.getLink('mn2_2ddepiction', '2D Depiction ' + me.htmlCls.wifiStr, 1, 1);
13698
+ }
13699
+
13696
13700
  if(me.cfg.cid === undefined) {
13697
13701
  html += this.getLink('mn6_selectannotations', 'Seq. & Annotations ' + me.htmlCls.wifiStr, 1, 1);
13698
13702
 
@@ -15517,24 +15521,30 @@ class SetDialog {
15517
15521
  html += "</div>";
15518
15522
 
15519
15523
 
15520
- html += me.htmlCls.divStr + "dl_ligplot' sty2D Interaction for One Ligand/Residule='background-color:white' class='" + dialogClass + "'>";
15521
- html += this.addNotebookTitle('dl_ligplot', 'e with Atom Details');
15524
+ html += me.htmlCls.divStr + "dl_ligplot' style='background-color:white' class='" + dialogClass + "'>";
15522
15525
 
15523
- html += me.htmlCls.divNowrapStr + "<b>Note</b>: Nodes/Residues can be dragged. Both nodes and dashed lines/interactions can be clicked to select residues. " + me.htmlCls.space3;
15526
+ if(me.cfg.cid !== undefined || me.cfg.smiles !== undefined) {
15527
+ html += this.addNotebookTitle('dl_ligplot', '2D Depiction for Chemicals');
15528
+ }
15529
+ else {
15530
+ html += this.addNotebookTitle('dl_ligplot', '2D Interaction for One Ligand/Residue with Atom Details');
15524
15531
 
15525
- html += '<div style="width:20px; margin-top:6px; display:inline-block;"><span id="'
15526
- + me.pre + 'dl_ligplotcolor_expand" class="ui-icon ui-icon-plus icn3d-expand icn3d-link" style="display:none; width:15px;" title="Expand"></span><span id="'
15527
- + me.pre + 'dl_ligplotcolor_shrink" class="ui-icon ui-icon-minus icn3d-shrink icn3d-link" style="width:15px;" title="Shrink"></span></div></div>';
15532
+ html += me.htmlCls.divNowrapStr + "<b>Note</b>: Nodes/Residues can be dragged. Both nodes and dashed lines/interactions can be clicked to select residues. " + me.htmlCls.space3;
15528
15533
 
15529
- html += me.htmlCls.divStr + "dl_ligplotcolor' style='inline-block;'>";
15534
+ html += '<div style="width:20px; margin-top:6px; display:inline-block;"><span id="'
15535
+ + me.pre + 'dl_ligplotcolor_expand" class="ui-icon ui-icon-plus icn3d-expand icn3d-link" style="display:none; width:15px;" title="Expand"></span><span id="'
15536
+ + me.pre + 'dl_ligplotcolor_shrink" class="ui-icon ui-icon-minus icn3d-shrink icn3d-link" style="width:15px;" title="Shrink"></span></div></div>';
15530
15537
 
15531
- // html += "The real interaction distances are not in scale, and are about twice the distances of dashed line segments.<br>Some \"Contact\" lines are only shown partially to simplify the view.<br>";
15532
- // html += "Mouseover the dashed lines to see interaction types and distances.<br>";
15533
- html += "<b>Color legend</b> for interactions (dashed lines): <br>";
15538
+ html += me.htmlCls.divStr + "dl_ligplotcolor' style='inline-block;'>";
15534
15539
 
15535
- html += me.htmlCls.setHtmlCls.setColorHints();
15540
+ // html += "The real interaction distances are not in scale, and are about twice the distances of dashed line segments.<br>Some \"Contact\" lines are only shown partially to simplify the view.<br>";
15541
+ // html += "Mouseover the dashed lines to see interaction types and distances.<br>";
15542
+ html += "<b>Color legend</b> for interactions (dashed lines): <br>";
15536
15543
 
15537
- html += "<br></div>";
15544
+ html += me.htmlCls.setHtmlCls.setColorHints();
15545
+
15546
+ html += "<br></div>";
15547
+ }
15538
15548
 
15539
15549
  me.ligplotid = me.pre + 'ligplot';
15540
15550
  html += me.htmlCls.divNowrapStr + buttonStrTmp + me.ligplotid + '_svg">SVG</button>' + me.htmlCls.space2;
@@ -16920,6 +16930,11 @@ class Events {
16920
16930
  thisClass.setLogCmd("view interactions", true);
16921
16931
  });
16922
16932
 
16933
+ me.myEventCls.onIds("#" + me.pre + "mn2_2ddepiction", "click", async function(e) { let ic = me.icn3d;
16934
+ await ic.ligplotCls.drawLigplot(ic.atoms, true);
16935
+ thisClass.setLogCmd("view 2d depiction", true);
16936
+ });
16937
+
16923
16938
  me.myEventCls.onIds("#" + me.pre + "search_seq_button", "click", async function(e) { me.icn3d;
16924
16939
  e.stopImmediatePropagation();
16925
16940
  await thisClass.searchSeq();
@@ -28123,6 +28138,8 @@ class Camera {
28123
28138
  }
28124
28139
  }
28125
28140
 
28141
+ // ic.cam.add(ic.directionalLight);
28142
+
28126
28143
  ic.cam.updateProjectionMatrix();
28127
28144
  // }
28128
28145
  }
@@ -38058,6 +38075,11 @@ class Alternate {
38058
38075
  ic.directionalLight.position.copy(ic.lightPos.clone().applyQuaternion( quaternion ).normalize());
38059
38076
  ic.directionalLight2.position.copy(ic.lightPos2.clone().applyQuaternion( quaternion ).normalize());
38060
38077
  ic.directionalLight3.position.copy(ic.lightPos3.clone().applyQuaternion( quaternion ).normalize());
38078
+
38079
+ // adjust the light according to the position of camera
38080
+ ic.directionalLight.applyMatrix4(cam.matrixWorld);
38081
+ ic.directionalLight2.applyMatrix4(cam.matrixWorld);
38082
+ ic.directionalLight3.applyMatrix4(cam.matrixWorld);
38061
38083
  }
38062
38084
 
38063
38085
  if(!ic.bVr) ic.renderer.setPixelRatio( window.devicePixelRatio ); // r71
@@ -70001,7 +70023,9 @@ class LoadScript {
70001
70023
  }
70002
70024
  else if(command.indexOf('view interactions') == 0 && me.cfg.align !== undefined) { // the command may have "|||{"factor"...
70003
70025
  await thisClass.applyCommandViewinteraction(strArray[0].trim());
70004
-
70026
+ }
70027
+ else if(command.indexOf('view 2d depiction') == 0) { // the command may have "|||{"factor"...
70028
+ await ic.ligplotCls.drawLigplot(ic.atoms, true);
70005
70029
  }
70006
70030
  else if(command.indexOf('symmetry') == 0) {
70007
70031
  ic.bAxisOnly = false;
@@ -70211,6 +70235,9 @@ class LoadScript {
70211
70235
  else if(lastCommand.indexOf('view interactions') == 0 && me.cfg.align !== undefined) {
70212
70236
  await thisClass.applyCommandViewinteraction(lastCommand);
70213
70237
  }
70238
+ else if(lastCommand.indexOf('view 2d depiction') == 0) {
70239
+ await ic.ligplotCls.drawLigplot(ic.atoms, true);
70240
+ }
70214
70241
  else if(lastCommand.indexOf('symmetry') == 0) {
70215
70242
  let title = lastCommand.substr(lastCommand.indexOf(' ') + 1);
70216
70243
  ic.symmetrytitle =(title === 'none') ? undefined : title;
@@ -78594,8 +78621,13 @@ class Ligplot {
78594
78621
  this.icn3d = icn3d;
78595
78622
  }
78596
78623
 
78597
- async drawLigplot(atomSet1) { let ic = this.icn3d, me = ic.icn3dui;
78598
- me.htmlCls.dialogCls.openDlg('dl_ligplot', 'Show ligand interactions with atom details');
78624
+ async drawLigplot(atomSet1, bDepiction) { let ic = this.icn3d, me = ic.icn3dui;
78625
+ if(bDepiction) {
78626
+ me.htmlCls.dialogCls.openDlg('dl_ligplot', '2D Depiction');
78627
+ }
78628
+ else {
78629
+ me.htmlCls.dialogCls.openDlg('dl_ligplot', 'Show ligand interactions with atom details');
78630
+ }
78599
78631
 
78600
78632
  let widthOri, heightOri, width = 100, height = 100;
78601
78633
  ic.len4ang = 80;
@@ -78677,19 +78709,28 @@ class Ligplot {
78677
78709
  let offset = - ic.len4ang;
78678
78710
  let svgHtml = "<svg id='" + id + "' viewBox='" + offset + "," + offset + "," + width + "," + heightAll + "' width='" + graphWidth + "px' font-family='sans-serif' stroke='rgb(0,0,0)' stroke-width='2' stroke-linecap='round'>";
78679
78711
 
78680
- let xlen = parseInt(widthOri / ic.svgGridSize), ylen = parseInt(heightOri / ic.svgGridSize);
78681
- let result = ic.viewInterPairsCls.getAllInteractionTable("save1", index2xy, xlen, ylen, xcenter, ycenter); // sort on the ligand/set1
78682
- ic.bLigplot = true;
78712
+ if(bDepiction) {
78713
+ svgHtml += lineSvg + nodeSvg;
78714
+ }
78715
+ else {
78716
+ let xlen = parseInt(widthOri / ic.svgGridSize), ylen = parseInt(heightOri / ic.svgGridSize);
78717
+ let result = ic.viewInterPairsCls.getAllInteractionTable("save1", index2xy, xlen, ylen, xcenter, ycenter); // sort on the ligand/set1
78718
+ // ic.bLigplot = true;
78683
78719
 
78684
- svgHtml += lineSvg + result.svgHtmlLine;
78720
+ svgHtml += lineSvg + result.svgHtmlLine;
78685
78721
 
78686
- svgHtml += nodeSvg + result.svgHtmlNode;
78722
+ svgHtml += nodeSvg + result.svgHtmlNode;
78723
+ }
78687
78724
 
78688
78725
  svgHtml += "</svg>";
78689
78726
 
78690
- $("#" + ic.pre + "ligplotDiv").html(svgHtml);
78691
-
78692
- this.setEventsForLigplot();
78727
+ if(bDepiction) {
78728
+ $("#" + ic.pre + "ligplotDiv").html(svgHtml);
78729
+ }
78730
+ else {
78731
+ $("#" + ic.pre + "ligplotDiv").html(svgHtml);
78732
+ this.setEventsForLigplot();
78733
+ }
78693
78734
  }
78694
78735
 
78695
78736
 
@@ -83763,7 +83804,7 @@ class iCn3DUI {
83763
83804
  //even when multiple iCn3D viewers are shown together.
83764
83805
  this.pre = this.cfg.divid + "_";
83765
83806
 
83766
- this.REVISION = '3.39.0';
83807
+ this.REVISION = '3.40.0';
83767
83808
 
83768
83809
  // In nodejs, iCn3D defines "window = {navigator: {}}"
83769
83810
  this.bNode = (Object.keys(window).length < 2) ? true : false;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "icn3d",
3
- "version": "3.39.1",
3
+ "version": "3.40.0",
4
4
  "main": "./icn3d.js",
5
5
  "exports": {
6
6
  ".": {