Skip to content

Commit

Permalink
Refactoring
Browse files Browse the repository at this point in the history
return json from buildBlockSmiles()
other refactoring
  • Loading branch information
privrja committed Aug 17, 2020
1 parent 018f577 commit 34e9b0f
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/Graph.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ class Graph {

// Add edge between this node and its parent
let edge = new Edge(parentVertexId, vertex.id, 1);
let vertexId = null;
let vertexId;

if (isBranch) {
edge.setBondType(vertex.value.branchBond || '-');
Expand All @@ -92,7 +92,7 @@ class Graph {
vertexId = parentVertex.id;
}

let edgeId = this.addEdge(edge);
this.addEdge(edge);
}

let offset = node.ringbondCount + 1;
Expand Down Expand Up @@ -1173,7 +1173,12 @@ class Graph {
this.dfsSmallStart();
this._smallGraph.oneCyclic();
this._smallGraph.dfsSequenceStart();
return [smiles, this._smallGraph.sequence, this._smallGraph.sequenceType, this.decays];
return {
blockSmiles: smiles,
sequence: this._smallGraph.sequence,
sequenceType: this._smallGraph.sequenceType,
decays: this.decays
}
}

dfsSmallStart() {
Expand Down

0 comments on commit 34e9b0f

Please sign in to comment.