diff --git a/lib/extension/networkMap.js b/lib/extension/networkMap.js index 90afdfe78..51d57839d 100644 --- a/lib/extension/networkMap.js +++ b/lib/extension/networkMap.js @@ -42,6 +42,7 @@ class NetworkMap { graphviz(zigbee, topology) { let text = 'digraph G {\nnode[shape=record];\n'; + let devStyle = ''; zigbee.getDevices().forEach((device) => { const labels = []; @@ -67,8 +68,17 @@ class NetworkMap { // Add the device status (online/offline) labels.push(device.status); + // Shape the record according to device type + if (device.type == 'Coordinator') { + devStyle = 'style="bold"'; + } else if (device.type == 'Router') { + devStyle = 'style="rounded"'; + } else { + devStyle = 'style="rounded, dashed"'; + } + // Add the device with its labels to the graph as a node. - text += ` "${device.ieeeAddr}" [label="{${labels.join('|')}}"];\n`; + text += ` "${device.ieeeAddr}" [`+devStyle+`, label="{${labels.join('|')}}"];\n`; /** * Add an edge between the device and its parent to the graph @@ -76,7 +86,8 @@ class NetworkMap { * due to not responded to the lqi scan. In that case we do not add an edge for this device. */ topology.filter((e) => e.ieeeAddr === device.ieeeAddr).forEach((e) => { - text += ` "${device.ieeeAddr}" -> "${e.parent}" [label="${e.lqi}"]\n`; + const lineStyle = (e.lqi==0) ? `style="dashed", ` : ``; + text += ` "${device.ieeeAddr}" -> "${e.parent}" [`+lineStyle+`label="${e.lqi}"]\n`; }); });