@@ -88,7 +88,7 @@ export default {
88
88
89
89
// link arrow
90
90
this .scene .append (" defs" ).selectAll (" marker" )
91
- .data ([" TCP " ])
91
+ .data ([" Marker " ])
92
92
.enter ().append (" marker" )
93
93
.attr (' markerUnits' , ' userSpaceOnUse' )
94
94
.attr (" id" , function (d ) {
@@ -145,24 +145,24 @@ export default {
145
145
.data (edges, d => [d .source , d .target ])
146
146
.join (enter => enter .insert (" path" , " circle" )
147
147
.attr (" fill" , " none" )
148
- .attr (" stroke-width" , d => packetCountScale (d .packetCount ))
149
- .attr (" stroke" , d => colorScale (d .byteCount ))
150
- .attr (" marker-end" , " url(#TCP )" ));
148
+ .attr (" stroke-width" , d => d . width ?? packetCountScale (d .packetCount ))
149
+ .attr (" stroke" , d => d . hexColor ?? colorScale (d .byteCount ))
150
+ .attr (" marker-end" , " url(#Marker )" ));
151
151
152
152
this .linkHitArea = this .linkHitArea
153
153
.data (edges, d => [d .source , d .target ])
154
154
.join (enter => enter .insert (" path" , " circle" ))
155
155
.call (link => link .append (" title" )
156
- .text (d => ` Bytes: ${ d .byteCount } \n Packets: ${ d .packetCount } \n Protocols : ${ d .dataProtocol } ` ));
156
+ .text (d => ` Bytes: ${ d .byteCount } \n Packets: ${ d .packetCount } \n Protocol : ${ d .dataProtocol } ` ));
157
157
158
158
this .node = this .node
159
159
.data (nodes, d => d .id )
160
160
.join (enter => enter .append (" circle" )
161
161
.attr (" r" , 8 )
162
- .attr (" fill" , " #537B87" )
162
+ .attr (" fill" , d => d . hexColor ?? " #537B87" )
163
163
.call (this .drag (this .simulation ))
164
164
.call (node => node .append (" title" )
165
- .text (d => d .name ))
165
+ .text (d => ` IP: ${ d .name } ${ d . tags ? ` \n Tags: ${ d . tags } ` : ' ' } ` ))
166
166
);
167
167
168
168
this .label = this .label
@@ -171,7 +171,7 @@ export default {
171
171
.attr (" text-anchor" , " middle" )
172
172
.attr (" dy" , " 1.8em" )
173
173
.attr (" font-size" , " 10px" )
174
- .text (d => d .name )
174
+ .text (d => d .dnsName ?? d . name )
175
175
);
176
176
177
177
let selectedNode = null ;
0 commit comments