1. highlight last edge. 2. padEnd() to left align capsule label
This commit is contained in:
@@ -60,15 +60,19 @@ export default defineStore('useMapPathStore', {
|
||||
curGraphNode = prevGraphNode.outgoers('node').filter(neighbor =>
|
||||
neighbor.data('label') === curButton[listIndex][nodeIndex]
|
||||
);
|
||||
if(!curGraphNode) {
|
||||
// curGraphNode = prevGraphNode.outgoers('node').filter(node =>
|
||||
// node.data('label').toLocaleLowerCase() === 'end');
|
||||
}
|
||||
curEdge = prevGraphNode.edgesWith(curGraphNode);
|
||||
}
|
||||
}
|
||||
this.insightWithPath[INSIGHTS_FIELDS_AND_LABELS[i][0]][listIndex].nodes.push(curGraphNode);
|
||||
this.insightWithPath[INSIGHTS_FIELDS_AND_LABELS[i][0]][listIndex].edges.push(curEdge);
|
||||
// 特殊狀況,在for迴圈之外額外插入最後一條線段
|
||||
if(nodeIndex === curButton[listIndex].length - 1){
|
||||
const endNode = curGraphNode.outgoers('node').filter(neighbor =>
|
||||
neighbor.data('label').toLocaleLowerCase() === 'end'
|
||||
);
|
||||
const lastEdge = curGraphNode.edgesWith(endNode);
|
||||
this.insightWithPath[INSIGHTS_FIELDS_AND_LABELS[i][0]][listIndex].edges.push(lastEdge);
|
||||
}
|
||||
prevGraphNode = curGraphNode;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user