Skip to content

Commit

Permalink
Merge pull request #98 from snjlee58/master
Browse files Browse the repository at this point in the history
fix: rank undefined issue
  • Loading branch information
milot-mirdita authored Jan 2, 2025
2 parents 7654f55 + a303a21 commit 0ee170d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions frontend/SankeyDiagram.vue
Original file line number Diff line number Diff line change
Expand Up @@ -132,13 +132,17 @@ export default {
if (node.rank !== "clade") {
let lastLineageNode = currentLineage[currentLineage.length - 1];
if (lastLineageNode) {
let currentRank = rankHierarchyFull[node.rank] ?? Infinity;
let lastRank = rankHierarchyFull[lastLineageNode.rank] ?? Infinity;
while (lastLineageNode && currentRank <= lastRank) {
while (lastLineageNode && currentRank <= lastRank) {
const poppedNode = currentLineage.pop();
lastLineageNode = currentLineage[currentLineage.length - 1];
if (!lastLineageNode) {
break; // Exit the loop if no more nodes in the lineage
}
currentRank = rankHierarchyFull[node.rank] ?? Infinity;
lastRank = rankHierarchyFull[lastLineageNode.rank] ?? Infinity;
}
Expand Down

0 comments on commit 0ee170d

Please sign in to comment.