Skip to content

Commit

Permalink
fix: rank undefined issue
Browse files Browse the repository at this point in the history
  • Loading branch information
snjlee58 committed Jan 2, 2025
1 parent a56738d commit a303a21
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 a303a21

Please sign in to comment.