Skip to content

Commit

Permalink
Merge pull request #11 from privrja/dev
Browse files Browse the repository at this point in the history
Add decays saving
  • Loading branch information
privrja authored Mar 28, 2019
2 parents 6f2018d + bbb988d commit c8dd8a2
Show file tree
Hide file tree
Showing 37 changed files with 3,858 additions and 3,827 deletions.
140 changes: 94 additions & 46 deletions dist/smiles-drawer.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/smiles-drawer.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/smiles-drawer.min.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions doc/ArrayHelper.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions doc/ArrayHelper.js.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions doc/Atom.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions doc/Atom.js.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions doc/CanvasWrapper.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions doc/CanvasWrapper.js.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions doc/DecayPoint.js.html

Large diffs are not rendered by default.

233 changes: 71 additions & 162 deletions doc/Drawer.html

Large diffs are not rendered by default.

24 changes: 8 additions & 16 deletions doc/Drawer.js.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions doc/Edge.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions doc/Edge.js.html

Large diffs are not rendered by default.

110 changes: 55 additions & 55 deletions doc/Graph.html

Large diffs are not rendered by default.

41 changes: 36 additions & 5 deletions doc/Graph.js.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions doc/Line.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions doc/Line.js.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions doc/MathHelper.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions doc/MathHelper.js.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions doc/Ring.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions doc/Ring.js.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions doc/RingConnection.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions doc/RingConnection.js.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions doc/SSSR.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions doc/SSSR.js.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions doc/Vector2.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions doc/Vector2.js.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions doc/Vertex.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions doc/Vertex.js.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions doc/VertexState.js.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions doc/index.html

Large diffs are not rendered by default.

650 changes: 328 additions & 322 deletions example/index_light.html

Large diffs are not rendered by default.

36 changes: 24 additions & 12 deletions spec/blocksSpec.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const SmilesDrawer = require('../app');
const DecayState = require('../src/DecayState');

const CYCLOSPORINE_A = 'CCC1C(=O)N(CC(=O)N(C(C(=O)NC(C(=O)N(C(C(=O)NC(C(=O)NC(C(=O)N(C(C(=O)N(C(C(=O)N(C(C(=O)N(C(C(=O)N1)C(C(C)CC=CC)O)C)C(C)C)C)CC(C)C)C)CC(C)C)C)C)C)CC(C)C)C)C(C)C)CC(C)C)C)C';
const CYCLOSPORINE_B = 'CC=CCC(C)C(C1C(=O)NC(C(=O)N(CC(=O)N(C(C(=O)NC(C(=O)N(C(C(=O)NC(C(=O)NC(C(=O)N(C(C(=O)N(C(C(=O)N(C(C(=O)N1C)C(C)C)C)CC(C)C)C)CC(C)C)C)C)C)CC(C)C)C)C(C)C)CC(C)C)C)C)C)O';
Expand All @@ -15,7 +16,7 @@ const PYOVERDIN_PA_A = 'CC(C1C(=O)NC(C(=O)NCCCCC(C(=O)NC(C(=O)N1)CCCN(C=O)O)NC(=
const MICAFUNGIN = 'CCCCCOC1=CC=C(C=C1)C2=CC(=NO2)C3=CC=C(C=C3)C(=O)NC4CC(C(NC(=O)C5C(C(CN5C(=O)C(NC(=O)C(NC(=O)C6CC(CN6C(=O)C(NC4=O)C(C)O)O)C(C(C7=CC(=C(C=C7)O)OS(=O)(=O)O)O)O)C(CC(=O)N)O)C)O)O)O';

describe("blocks", function () {
let smilesDrawer = new SmilesDrawer.Drawer({drawDecayPoints: true});
let smilesDrawer = new SmilesDrawer.Drawer({drawDecayPoints: DecayState.VALUES.STANDARD});

it("cyclosporine", function () {
smilesDrawer.draw(SmilesDrawer.Parser.parse(CYCLOSPORINE_A), 'output-canvas', 'light', true);
Expand Down Expand Up @@ -75,7 +76,8 @@ describe("blocks", function () {
'N(C(C(=O)O)C(C(C)CC=CC)O)C'
],
'[0]-[10]-[9]-[8]-[7]-[6]-[5]-[4]-[3]-[2]-[1]',
'cyclic'
'cyclic',
[4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44]
];
expect(result).toEqual(expected);
});
Expand All @@ -98,7 +100,8 @@ describe("blocks", function () {
'N(C(C(=O)O)C(C)C)C'
],
'[0]-[10]-[9]-[8]-[7]-[6]-[5]-[4]-[3]-[2]-[1]',
'cyclic'
'cyclic',
[9, 13, 17, 21, 25, 29, 33, 37, 41, 45, 49]
];
expect(result).toEqual(expected);
});
Expand All @@ -122,7 +125,8 @@ describe("blocks", function () {
'NC(C(=O)O)C(C)C'
],
'[0]-[11]-[10]-[9]-[8]-[7]-[6]-[5]-[4]-[3]-[2]-[1]',
'cyclic'
'cyclic',
[3, 7, 11, 15, 19, 23, 27, 31, 35, 39, 43, 47]
];
expect(result).toEqual(expected);
});
Expand All @@ -141,7 +145,8 @@ describe("blocks", function () {
'OC(=O)C(Cc1ccccc1)N'
],
'\\([2]-[0]-[1]\\)[3]-[4]-[5]-[6]',
'branch-cyclic'
'branch-cyclic',
[5, 10, 16, 20, 24, 31, 42]
];
expect(result).toEqual(expected);
});
Expand All @@ -162,7 +167,8 @@ describe("blocks", function () {
'OC(C)=O',
],
'[0]-[2]-[3]-[4]\\([5]-[6]\\)\\([1]-[7]-[8]\\)',
'other'
'other',
[28, 25, 22, 19, 16, 65, 9, 5, 70]
];
expect(result).toEqual(expected);
});
Expand All @@ -182,7 +188,8 @@ describe("blocks", function () {
'OC(=O)C1CCCN1',
],
'[2]-[1]\\([0]-[5]-[6]-[7]\\)[3]-[4]',
'branched'
'branched',
[4, 8, 17, 27, 30, 38, 46]
];
expect(result).toEqual(expected);
});
Expand All @@ -207,7 +214,8 @@ describe("blocks", function () {
'O'
],
'[0]\\([3]-[4]\\)\\([2]\\([5]-[6]\\)[7]-[8]-[9]-[10]-[11]-[12]-[1]',
'other'
'other',
[4, 8, 16, 20, 25, 29, 36, 40, 46, 57, 63, 82, 88]
];
expect(result).toEqual(expected);
});
Expand All @@ -228,7 +236,8 @@ describe("blocks", function () {
'N'
],
'\\([1]-[0]\\)[2]\\([3]-[7]\\)[4]-[5]-[6]',
'other'
'other',
[24, 30, 37, 41, 45, 52, 56, 82]
];
expect(result).toEqual(expected);
});
Expand Down Expand Up @@ -257,7 +266,8 @@ describe("blocks", function () {
'OC=O'
],
'[12]-[11]-[10]-[9]-[8]-[7]-[6]-[5]-[4]-[3]-[2]-[1]-[0]-[13]-[14]-[15]-[16]',
'linear'
'linear',
[6, 11, 18, 25, 32, 46, 54, 66, 74, 88, 96, 110, 115, 120, 124, 131]
];
expect(result).toEqual(expected);
});
Expand All @@ -273,7 +283,8 @@ describe("blocks", function () {
'NC(C(=O)O)CC(C)C',
],
'[0]-[3]-[2]-[1]',
'cyclic'
'cyclic',
[9, 13, 17, 21]
];
expect(result).toEqual(expected);
});
Expand All @@ -288,7 +299,8 @@ describe("blocks", function () {
'OC(=O)[CH](O)C(C)(C)COP(O)(=O)OP(O)(=O)OC[CH]1O[CH](C(O)[CH]1OP(O)(O)=O)N3C=NC2=C3N=CN=C2N'
],
'[0]-[1]-[2]',
'linear'
'linear',
[24, 29]
];
expect(result).toEqual(expected);
});
Expand Down
10 changes: 10 additions & 0 deletions src/DecayState.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
//@ts-check

class DecayState {

static get VALUES() {
return { NO: 0, STANDARD: 1, SOURCE: 2, STANDARD_AND_SOURCE: 3};
}
}

module.exports = DecayState;
Loading

0 comments on commit c8dd8a2

Please sign in to comment.