Skip to content

Commit

Permalink
Merge pull request #77 in STRUC/icn3d from release224 to master
Browse files Browse the repository at this point in the history
* commit 'a3dbcbdf1cc4610447b6a33de92b55d2fdf4fd75':
  The location of 2D interaction dialog was optimized
  • Loading branch information
jiywang3 committed Sep 6, 2018
2 parents d2bead9 + a3dbcbd commit 3cd894e
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 10 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ We provided two types of iCn3D widgets: [basic interface](https://www.ncbi.nlm.n

Either of these widgets could be easily added to your own web pages. Please see the [help page](https://www.ncbi.nlm.nih.gov/Structure/icn3d/docs/icn3d_help.html#HowToUse) for more details.

<b>Complete package</b> of iCn3D including Three.js and jQuery can be downloaded from [https://www.ncbi.nlm.nih.gov/Structure/icn3d/icn3d-2.2.3.zip](https://www.ncbi.nlm.nih.gov/Structure/icn3d/icn3d-2.2.3.zip). The "Download ZIP" link in this page does not include third-party libraries.
<b>Complete package</b> of iCn3D including Three.js and jQuery can be downloaded from [https://www.ncbi.nlm.nih.gov/Structure/icn3d/icn3d-2.2.4.zip](https://www.ncbi.nlm.nih.gov/Structure/icn3d/icn3d-2.2.4.zip). The "Download ZIP" link in this page does not include third-party libraries.

## Usage

Expand Down Expand Up @@ -72,6 +72,8 @@ gulp
```

## Change log
The production version [icn3d-2.2.4](https://www.ncbi.nlm.nih.gov/Structure/icn3d/icn3d-2.2.4.zip) was release on September 6, 2018. The location of 2D interaction dialog was optimized.

The production version [icn3d-2.2.3](https://www.ncbi.nlm.nih.gov/Structure/icn3d/icn3d-2.2.3.zip) was release on August 30, 2018. Added an option to show N- and C-terminal labels.

The production version [icn3d-2.2.2](https://www.ncbi.nlm.nih.gov/Structure/icn3d/icn3d-2.2.2.zip) was release on August 9, 2018. Defined sets can be combined using "or", "and", and "not".
Expand Down
8 changes: 7 additions & 1 deletion icn3d.html
Original file line number Diff line number Diff line change
Expand Up @@ -760,7 +760,7 @@ <h2>Menus, Commands, and Methods of the advanced interface<img src="https://www.
<tr><td valign='top'><span class="indent">per Selection:</span></td> <td valign='top'>add label [label text] | size [label size] | color [FF0000] | background [FFFFFF]</td> <td valign='top'><a href="#addLabel">addLabel</a></td></tr>
<tr><td valign='top'><span class="indent">per Residue:</span></td> <td valign='top'>add residue labels</td> <td valign='top'><a href="#addResiudeLabels">addResiudeLabels</a></td></tr>
<tr><td valign='top'><span class="indent">per Chain:</span></td> <td valign='top'>add chain labels</td> <td valign='top'><a href="#addLabel">addLabel</a></td></tr>
<tr><td valign='top'><span class="indent">N- & C- Termini:</span></td> <td valign='top'>add terminal labels</td> <td valign='top'><a href="#addLabel">addTerminiLabels</a></td></tr>
<tr><td valign='top'><span class="indent">N- & C- Termini:</span></td> <td valign='top'>add terminal labels</td> <td valign='top'><a href="#addTerminiLabels">addTerminiLabels</a></td></tr>
<tr><td valign='top'><span class="indent">Remove:</span></td> <td valign='top'>set labels off</td> <td valign='top'><a href="#addChainLabels">addChainLabels</a></td></tr>

<tr><td colspan="3"><br>k) View -&gt; Reset:</td> </tr>
Expand Down Expand Up @@ -1405,6 +1405,9 @@ <h3>Methods <a href="#Top"><span class="top">&nbsp;&nbsp;&nbsp;</span></a></h3>
<br><br><a name="addStabilizer"></a><b>addStabilizer()</b> <a href="#Top"><span class="top">&nbsp;&nbsp;&nbsp;</span></a><br>
Add stabilizers in the model for 3D printing. This is especially important for the cartoon display such as ribbons.

<a name="addTerminiLabels"></a><b>addTerminiLabels(atomHash)</b> <a href="#Top"><span class="top">&nbsp;&nbsp;&nbsp;</span></a><br>
Display the terminal labels for the atoms in "atomHash". The termini of proteins are labeld as "N-" and "C-". The termini of nucleotides are labeled as "5'" and "3'".

<br><br><a name="allCustomEvents"></a><b>allCustomEvents()</b> <a href="#Top"><span class="top">&nbsp;&nbsp;&nbsp;</span></a><br>
You can add your custom events in this function if you want to add new links in the function setTools.

Expand Down Expand Up @@ -1722,6 +1725,9 @@ <h3>Methods <a href="#Top"><span class="top">&nbsp;&nbsp;&nbsp;</span></a></h3>

<a name="log"></a>
<h2>Change Log:<img src="https://www.ncbi.nlm.nih.gov/Structure/IMG/spacer.gif" width="25" height="1" border="0"><a href="#Top"><img src="https://www.ncbi.nlm.nih.gov/Structure/IMG/arrowup_blue.gif" width="12" height="12" border="0" alt="back to top"></a></h2>
The production version <a href="https://www.ncbi.nlm.nih.gov/Structure/icn3d/icn3d-2.2.4.zip">icn3d-2.2.4</a> was release on September 6, 2018. The location of 2D interaction dialog was optimized.
<br><br>

The production version <a href="https://www.ncbi.nlm.nih.gov/Structure/icn3d/icn3d-2.2.3.zip">icn3d-2.2.3</a> was release on August 30, 2018. Added an option to show N- and C-terminal labels.
<br><br>

Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "icn3d",
"version": "2.2.3",
"version": "2.2.4",
"description": "iCn3D Structure Viewer",
"main": "index.html",
"scripts": {
Expand All @@ -22,7 +22,7 @@
"dependencies": {
"jquery": "~3.2.1",
"jquery-ui": "components/jqueryui.git#1.12.1",
"three": "~0.80.0"
"three": "~0.80.1"
},
"devDependencies": {
"del": "^2.2.0",
Expand Down
43 changes: 37 additions & 6 deletions src/icn3dui/html/dialogs.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ iCn3DUI.prototype.openDialogHalfWindow = function (id, title, dialogWidth, bForc
if(bTwoddgmInit2 || bSetsInit2) {
me.resizeCanvas(me.WIDTH - me.LESSWIDTH - twoddgmWidth, me.HEIGHT - me.LESSHEIGHT - me.EXTRAHEIGHT, true);

if(bTwoddgmInit2) me.openDialog2Ddgm(me.pre + 'dl_2ddgm');
if(bTwoddgmInit2) me.openDialog2Ddgm(me.pre + 'dl_2ddgm', undefined, bSetsInit2);
if(bSetsInit2) me.openDialog2Ddgm(me.pre + 'dl_definedsets');
}
else {
Expand All @@ -64,15 +64,21 @@ iCn3DUI.prototype.openDialogHalfWindow = function (id, title, dialogWidth, bForc
});
};

iCn3DUI.prototype.openDialog2Ddgm = function (id, inHeight) { var me = this;
iCn3DUI.prototype.openDialog2Ddgm = function (id, inHeight, bDefinedSets) { var me = this;
var twoddgmWidth = 170;
var at, title;
if(id === me.pre + 'dl_definedsets') {
at = "right top";
title = 'Select sets';
}
else if(id === me.pre + 'dl_2ddgm') {
at = "right top+190";
if(bDefinedSets !== undefined && bDefinedSets) {
at = "right top+240";
}
else {
at = "right top";
}

title = 'Interactions';
}

Expand Down Expand Up @@ -132,7 +138,7 @@ iCn3DUI.prototype.openDialog = function (id, title) { var me = this;
if(bTwoddgmInit2 || bSetsInit2) {
me.resizeCanvas(me.WIDTH - me.LESSWIDTH - dialogWidth - twoddgmWidth, me.HEIGHT - me.LESSHEIGHT - me.EXTRAHEIGHT, true);

if(bTwoddgmInit2) me.openDialog2Ddgm(me.pre + 'dl_2ddgm');
if(bTwoddgmInit2) me.openDialog2Ddgm(me.pre + 'dl_2ddgm', undefined, bSetsInit2);
if(bSetsInit2) me.openDialog2Ddgm(me.pre + 'dl_definedsets');
}
}
Expand All @@ -153,6 +159,7 @@ iCn3DUI.prototype.openDialog = function (id, title) { var me = this;
modal: false,
position: position,
close: function(e) {
/*
// determine whether dialogs initilaized
var bSelectannotationsInit = $('#' + me.pre + 'dl_selectannotations').hasClass('ui-dialog-content'); // initialized
var bAlignmentInit = $('#' + me.pre + 'dl_alignment').hasClass('ui-dialog-content'); // initialized
Expand All @@ -164,14 +171,15 @@ iCn3DUI.prototype.openDialog = function (id, title) { var me = this;
if(bAlignmentInit) bAlignmentInit2 = $('#' + me.pre + 'dl_alignment').dialog( 'isOpen' );
if(bTwoddgmInit) bTwoddgmInit2 = $('#' + me.pre + 'dl_2ddgm').dialog( 'isOpen' );
if(bSetsInit) bSetsInit2 = $('#' + me.pre + 'dl_definedsets').dialog( 'isOpen' );
*/

if((id === me.pre + 'dl_selectannotations' && (!bAlignmentInit2) )
|| (id === me.pre + 'dl_alignment' &&(!bSelectannotationsInit2) )
) {
if(bTwoddgmInit2 || bSetsInit2) {
me.resizeCanvas(me.WIDTH - me.LESSWIDTH - twoddgmWidth, me.HEIGHT - me.LESSHEIGHT - me.EXTRAHEIGHT, true);

if(bTwoddgmInit2) me.openDialog2Ddgm(me.pre + 'dl_2ddgm');
if(bTwoddgmInit2) me.openDialog2Ddgm(me.pre + 'dl_2ddgm', undefined, bSetsInit2);
if(bSetsInit2) me.openDialog2Ddgm(me.pre + 'dl_definedsets');
}
else {
Expand All @@ -187,6 +195,24 @@ iCn3DUI.prototype.openDialog = function (id, title) { var me = this;
});
}
}
else if(id === me.pre + 'dl_2ddgm') {
var tmpWidth = 0;

if(me.WIDTH - me.LESSWIDTH >= me.HEIGHT - me.LESSHEIGHT - me.EXTRAHEIGHT) {
if(bSelectannotationsInit2 || bAlignmentInit2) {
tmpWidth = 0.5 * (me.WIDTH - me.LESSWIDTH) - twoddgmWidth * 0.5;
}
me.resizeCanvas(me.WIDTH - me.LESSWIDTH - tmpWidth - twoddgmWidth, me.HEIGHT - me.LESSHEIGHT - me.EXTRAHEIGHT, true);

me.openDialog2Ddgm(id, undefined, bSetsInit2);
}
else {
me.resizeCanvas(me.WIDTH - me.LESSWIDTH - tmpWidth - twoddgmWidth, (me.HEIGHT - me.LESSHEIGHT - me.EXTRAHEIGHT)*0.5, true);
me.openDialog2Ddgm(id, (me.HEIGHT - me.LESSHEIGHT - me.EXTRAHEIGHT)*0.5);

me.openDialog2Ddgm(id, (me.HEIGHT - me.LESSHEIGHT - me.EXTRAHEIGHT)*0.5, bSetsInit2);
}
}
else {
height = 'auto';
width = 'auto';
Expand All @@ -197,18 +223,23 @@ iCn3DUI.prototype.openDialog = function (id, title) { var me = this;

var position;

if(id === me.pre + 'dl_2ddgm' || id === me.pre + 'dl_definedsets') {
if(id === me.pre + 'dl_definedsets') {
var tmpWidth = 0;

if(me.WIDTH - me.LESSWIDTH >= me.HEIGHT - me.LESSHEIGHT - me.EXTRAHEIGHT) {
if(bSelectannotationsInit2 || bAlignmentInit2) {
tmpWidth = 0.5 * (me.WIDTH - me.LESSWIDTH) - twoddgmWidth * 0.5;
}
me.resizeCanvas(me.WIDTH - me.LESSWIDTH - tmpWidth - twoddgmWidth, me.HEIGHT - me.LESSHEIGHT - me.EXTRAHEIGHT, true);
me.openDialog2Ddgm(id);

if(bTwoddgmInit2) me.openDialog2Ddgm(me.pre + 'dl_2ddgm', undefined, true);
}
else {
me.resizeCanvas(me.WIDTH - me.LESSWIDTH - tmpWidth - twoddgmWidth, (me.HEIGHT - me.LESSHEIGHT - me.EXTRAHEIGHT)*0.5, true);
me.openDialog2Ddgm(id, (me.HEIGHT - me.LESSHEIGHT - me.EXTRAHEIGHT)*0.5);

if(bTwoddgmInit2) me.openDialog2Ddgm(me.pre + 'dl_2ddgm', (me.HEIGHT - me.LESSHEIGHT - me.EXTRAHEIGHT)*0.5, true);
}
}
else {
Expand Down

0 comments on commit 3cd894e

Please sign in to comment.