icn3d 3.7.0 → 3.7.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.
Files changed (2) hide show
  1. package/icn3d.js +38 -21
  2. package/package.json +1 -1
package/icn3d.js CHANGED
@@ -2462,7 +2462,10 @@ THREE.TrackballControls = function ( object, domElement, icn3d ) {
2462
2462
 
2463
2463
  _eye.multiplyScalar( factor );
2464
2464
 
2465
- if(icn3d !== undefined && icn3d._zoomFactor !== undefined && (bUpdate === undefined || bUpdate === true)) icn3d._zoomFactor *= factor;
2465
+ if(icn3d !== undefined && icn3d._zoomFactor !== undefined && (bUpdate === undefined || bUpdate === true)) {
2466
+ icn3d._zoomFactor *= factor;
2467
+ icn3d.fogCls.setFog();
2468
+ }
2466
2469
 
2467
2470
  } else {
2468
2471
 
@@ -2475,7 +2478,10 @@ THREE.TrackballControls = function ( object, domElement, icn3d ) {
2475
2478
  factor = 1.0 + ( _this._zoomEnd.y - _this._zoomStart.y ) * _this.zoomSpeed;
2476
2479
  }
2477
2480
 
2478
- if(icn3d !== undefined && icn3d._zoomFactor !== undefined && (bUpdate === undefined || bUpdate === true)) icn3d._zoomFactor *= factor;
2481
+ if(icn3d !== undefined && icn3d._zoomFactor !== undefined && (bUpdate === undefined || bUpdate === true)) {
2482
+ icn3d._zoomFactor *= factor;
2483
+ icn3d.fogCls.setFog();
2484
+ }
2479
2485
 
2480
2486
  //if ( factor !== 1.0 && factor > 0.0 ) {
2481
2487
  if ( factor !== 1.0 ) {
@@ -5854,7 +5860,8 @@ class Fog {
5854
5860
  if(bZoomin) {
5855
5861
  let centerAtomsResults = ic.applyCenterCls.centerAtoms(ic.hAtoms);
5856
5862
  ic.maxD = centerAtomsResults.maxD;
5857
- if (ic.maxD < 5) ic.maxD = 5;
5863
+ //if (ic.maxD < 5) ic.maxD = 5;
5864
+ if (ic.maxD < 25) ic.maxD = 25;
5858
5865
  }
5859
5866
 
5860
5867
  let bInstance = (ic.biomtMatrices !== undefined && ic.biomtMatrices.length * ic.cnt > ic.maxatomcnt) ? true : false;
@@ -5871,7 +5878,9 @@ class Fog {
5871
5878
  ic.bSetFog = false;
5872
5879
  }
5873
5880
  else {
5874
- ic.scene.fog = new THREE.Fog(background, 2.5*ic.maxD, 4*ic.maxD);
5881
+ // adjust
5882
+ let zoomFactor = (ic._zoomFactor > 1) ? ic._zoomFactor * 1.0 : ic._zoomFactor;
5883
+ ic.scene.fog = new THREE.Fog(background, 2.5 * ic.maxD * zoomFactor, 4 * ic.maxD * zoomFactor);
5875
5884
  ic.bSetFog = true;
5876
5885
  ic.camMaxDFactorFog = 3;
5877
5886
  }
@@ -5890,9 +5899,9 @@ class Fog {
5890
5899
  ic.bSetFog = false;
5891
5900
  }
5892
5901
 
5893
- if(bZoomin && !bInstance) {
5894
- ic.transformCls.zoominSelection();
5895
- }
5902
+ //if(bZoomin && !bInstance) {
5903
+ // ic.transformCls.zoominSelection();
5904
+ //}
5896
5905
  }
5897
5906
  }
5898
5907
 
@@ -16157,8 +16166,10 @@ class LineGraph {
16157
16166
  }
16158
16167
 
16159
16168
  // draw label
16160
- height += textHeight;
16161
- html += "<text x='" + margin1 + "' y='" + height + "' style='font-size:8px; font-weight:bold'>" + label + "</text>";
16169
+ if(label) {
16170
+ height += textHeight;
16171
+ html += "<text x='" + margin1 + "' y='" + height + "' style='font-size:8px; font-weight:bold'>" + label + "</text>";
16172
+ }
16162
16173
 
16163
16174
  let h1 = 30 + height,
16164
16175
  h2 = 80 + height;
@@ -16228,10 +16239,11 @@ class LineGraph {
16228
16239
  let heightTotal =(len1 + 1) *(r + gap) + legendWidth + 2 * marginY;
16229
16240
 
16230
16241
  // draw label
16231
- height += textHeight;
16242
+ if(label) {
16243
+ height += textHeight;
16244
+ html += "<text x='" + marginX + "' y='" + (height + 15).toString() + "' style='font-size:8px; font-weight:bold'>" + label + "</text>";
16245
+ }
16232
16246
 
16233
- html += "<text x='" + marginX + "' y='" + (height + 15).toString() + "' style='font-size:8px; font-weight:bold'>" + label + "</text>";
16234
-
16235
16247
  let margin1 = height + heightTotal -(legendWidth + marginY +(r + gap)); // y-axis
16236
16248
  let margin2 = legendWidth + marginX +(r + gap); // x-axis
16237
16249
 
@@ -42662,10 +42674,10 @@ class Transform {
42662
42674
 
42663
42675
  if(ic.bRender) ic.drawCls.render();
42664
42676
  }
42665
-
42677
+ /*
42666
42678
  //Zoom in the structure at certain ratio, e.g., 0.1 is a reasonable value.
42667
42679
  zoomIn(normalizedFactor) { let ic = this.icn3d, me = ic.icn3dui;
42668
- let para = {};
42680
+ let para = {}
42669
42681
  para._zoomFactor = 1 - normalizedFactor;
42670
42682
  para.update = true;
42671
42683
  if(ic.bControlGl && !me.bNode) {
@@ -42675,12 +42687,14 @@ class Transform {
42675
42687
  ic.controls.update(para);
42676
42688
  }
42677
42689
 
42678
- if(ic.bRender) ic.drawCls.render();
42690
+ if(ic.bRender) {
42691
+ ic.drawCls.render();
42692
+ }
42679
42693
  }
42680
42694
 
42681
42695
  //Zoom out the structure at certain ratio, e.g., 0.1 is a reasonable value.
42682
42696
  zoomOut(normalizedFactor) { let ic = this.icn3d, me = ic.icn3dui;
42683
- let para = {};
42697
+ let para = {}
42684
42698
  para._zoomFactor = 1 + normalizedFactor;
42685
42699
  para.update = true;
42686
42700
 
@@ -42690,8 +42704,11 @@ class Transform {
42690
42704
  else {
42691
42705
  ic.controls.update(para);
42692
42706
  }
42693
- if(ic.bRender) ic.drawCls.render();
42707
+ if(ic.bRender) {
42708
+ ic.drawCls.render();
42709
+ }
42694
42710
  }
42711
+ */
42695
42712
 
42696
42713
  //Center on the selected atoms and zoom in.
42697
42714
  zoominSelection(atoms) { let ic = this.icn3d, me = ic.icn3dui;
@@ -47125,14 +47142,13 @@ class SetMenu {
47125
47142
  }
47126
47143
 
47127
47144
  let bOnePdb = me.cfg.mmtfid !== undefined || me.cfg.pdbid !== undefined || me.cfg.opmid !== undefined || me.cfg.mmcifid !== undefined || me.cfg.mmdbid !== undefined || me.cfg.gi !== undefined || me.cfg.blast_rep_id !== undefined;
47128
- console.log("me.cfg.mmdbid: " + me.cfg.mmdbid + " bOnePdb: " + bOnePdb);
47129
47145
 
47130
47146
  if(bOnePdb) {
47131
47147
  html += "<li id='" + me.pre + "assemblyWrapper'><span>Assembly</span>";
47132
47148
  html += "<ul>";
47133
47149
 
47134
- html += me.htmlCls.setHtmlCls.getRadio('mn6_assembly', 'mn6_assemblyYes', 'Biological Assembly', true);
47135
- html += me.htmlCls.setHtmlCls.getRadio('mn6_assembly', 'mn6_assemblyNo', 'Asymmetric Unit');
47150
+ html += me.htmlCls.setHtmlCls.getRadio('mn6_assembly', 'mn6_assemblyYes', 'Biological Assembly');
47151
+ html += me.htmlCls.setHtmlCls.getRadio('mn6_assembly', 'mn6_assemblyNo', 'Asymmetric Unit', true);
47136
47152
 
47137
47153
  html += "</ul>";
47138
47154
  html += "</li>";
@@ -54606,6 +54622,7 @@ class iCn3D {
54606
54622
  this.bInstanced = true;
54607
54623
 
54608
54624
  this.chainMissingResidueArray = {};
54625
+ this._zoomFactor = 1.0;
54609
54626
 
54610
54627
  if(!this.icn3dui.bNode) {
54611
54628
  this.bExtFragDepth = this.renderer.extensions.get( "EXT_frag_depth" );
@@ -55134,7 +55151,7 @@ class iCn3DUI {
55134
55151
  //even when multiple iCn3D viewers are shown together.
55135
55152
  this.pre = this.cfg.divid + "_";
55136
55153
 
55137
- this.REVISION = '3.7.0';
55154
+ this.REVISION = '3.7.1';
55138
55155
 
55139
55156
  // In nodejs, iCn3D defines "window = {navigator: {}}"
55140
55157
  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.7.0",
3
+ "version": "3.7.1",
4
4
  "main": "icn3d.js",
5
5
  "description": "iCn3D Structure Viewer",
6
6
  "repository": {