mirror of
https://github.com/MISP/misp-galaxy.git
synced 2025-02-17 01:06:22 +00:00
fix [graph] parent node bug
This commit is contained in:
parent
7fdabc9f4d
commit
8be04d62c4
1 changed files with 6 additions and 4 deletions
|
@ -82,6 +82,8 @@ document$.subscribe(function () {
|
||||||
path: nodePaths[id]
|
path: nodePaths[id]
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
const Parent_Node = nodes[0];
|
||||||
|
|
||||||
var links = data.map(d => ({ source: d.source, target: d.target }));
|
var links = data.map(d => ({ source: d.source, target: d.target }));
|
||||||
|
|
||||||
var tooltip = d3.select("body").append("div")
|
var tooltip = d3.select("body").append("div")
|
||||||
|
@ -121,10 +123,10 @@ document$.subscribe(function () {
|
||||||
.data(nodes)
|
.data(nodes)
|
||||||
.enter().append("circle")
|
.enter().append("circle")
|
||||||
.attr("r", function (d, i) {
|
.attr("r", function (d, i) {
|
||||||
return i === 0 ? NODE_RADIUS + 5 : NODE_RADIUS;
|
return d.id === Parent_Node.id ? NODE_RADIUS + 5 : NODE_RADIUS;
|
||||||
})
|
})
|
||||||
.attr("fill", function (d, i) {
|
.attr("fill", function (d, i) {
|
||||||
return i === 0 ? Parent_Node_COLOR : NODE_COLOR;
|
return d.id === Parent_Node.id ? Parent_Node_COLOR : NODE_COLOR;
|
||||||
});
|
});
|
||||||
|
|
||||||
// Apply tooltip on nodes
|
// Apply tooltip on nodes
|
||||||
|
@ -203,10 +205,10 @@ document$.subscribe(function () {
|
||||||
.join(
|
.join(
|
||||||
enter => enter.append("circle")
|
enter => enter.append("circle")
|
||||||
.attr("r", function (d, i) {
|
.attr("r", function (d, i) {
|
||||||
return i === 0 ? NODE_RADIUS + 5 : NODE_RADIUS;
|
return d.id === Parent_Node.id ? NODE_RADIUS + 5 : NODE_RADIUS;
|
||||||
})
|
})
|
||||||
.attr("fill", function (d, i) {
|
.attr("fill", function (d, i) {
|
||||||
return i === 0 ? Parent_Node_COLOR : NODE_COLOR;
|
return d.id === Parent_Node.id ? Parent_Node_COLOR : NODE_COLOR;
|
||||||
}),
|
}),
|
||||||
update => update,
|
update => update,
|
||||||
exit => exit.remove()
|
exit => exit.remove()
|
||||||
|
|
Loading…
Add table
Reference in a new issue