|
|
@ -597,13 +597,13 @@ export default { |
|
|
labelText: (d) => d.data.relationship.properties.label, |
|
|
labelText: (d) => d.data.relationship.properties.label, |
|
|
stroke: (d) => { |
|
|
stroke: (d) => { |
|
|
// 获取 target 节点的 label |
|
|
// 获取 target 节点的 label |
|
|
const targetLabel = this._nodeLabelMap.get(d.target); // d.target 是目标节点 ID |
|
|
const targetLabel = this._nodeLabelMap.get(d.source); // d.target 是目标节点 ID |
|
|
// 根据 target 节点类型返回对应浅色 |
|
|
// 根据 target 节点类型返回对应浅色 |
|
|
if (targetLabel === 'Disease') return 'rgba(239,68,68,0.5)'; |
|
|
if (targetLabel === 'Disease') return 'rgba(239,68,68,0.5)'; |
|
|
if (targetLabel === 'Drug') return 'rgba(145,204,117,0.5)'; |
|
|
if (targetLabel === 'Drug') return 'rgba(145,204,117,0.5)'; |
|
|
if (targetLabel === 'Symptom') return 'rgba(250,200,88,0.5)'; |
|
|
if (targetLabel === 'Symptom') return 'rgba(250,200,88,0.5)'; |
|
|
if (targetLabel === 'Check') return 'rgba(89,209,212,0.5)'; // 橙 |
|
|
if (targetLabel === 'Check') return 'rgba(51,110,238,0.5)'; // 橙 |
|
|
return 'rgba(51,110,238,0.5)'; // default |
|
|
return 'rgba(89,209,212,0.5)'; // default |
|
|
}, |
|
|
}, |
|
|
// labelFill: (d) => { |
|
|
// labelFill: (d) => { |
|
|
// // 获取 target 节点的 label |
|
|
// // 获取 target 节点的 label |
|
|
|