Closed github-actions[bot] closed 1 year ago
https://github.com/Kanaries/Rath/blob/df4899ee4e41c0966387bc564e787eeac6076e46/packages/rath-client/src/pages/causal/explorer/graph-helper.ts#L165
} })(); return fieldsRef.current[idx]?.fid; }); graph.getNodes().forEach(node => { const isFocused = focusedNodes.some(item => item === node); // TODO: check 一下是否 work graph.setItemState(node, 'focused', isFocused); const isInSubtree = isFocused ? false : subtreeNodes.some(neighbor => neighbor === node); graph.setItemState(node, 'highlighted', isInSubtree); graph.setItemState(node, 'faded', selectedFieldGroup.length !== 0 && !isFocused && !isInSubtree); graph.updateItem(node, { labelCfg: { style: { opacity: focusedNodes.length === 0 ? 1 : isFocused ? 1 : isInSubtree ? 0.5 : 0.2, fontWeight: isFocused ? 600 : 400, }, }, }); }); graph.getEdges().forEach(edge => { const sourceIdx = (() => {
Closed in fd95c9b3a467d205acb23783dd0c3e36e15032c0
https://github.com/Kanaries/Rath/blob/df4899ee4e41c0966387bc564e787eeac6076e46/packages/rath-client/src/pages/causal/explorer/graph-helper.ts#L165