0

I am working with Wireless sensor networks and I have been obtaining the sensor's addresses and their sensing parameter like Temperature in JSON format. The format is as follows:

{"eui":"c10c00000000007b","count":0"tmp102":" 0.0000 C"}

As far are the connection of the network, the Parent Node and the next destination are also got through a JSON format (on the Ubuntu gnome Terminal) using CoAP (constrained Application Protocol) for the Sensor Networks which has synonymous implementation like HTTP but is light weight.

{"Dest":"aaaa::c30c:0:0:7b","Next":"fe80::c30c:0:0:7b"}

for further details please refer to my repository

I want to create a visualization of the topology of sensors also if possible then with attributes like a when one clicks on the sensor, then the last sensed value could be observed.

I am already storing the first in a file with .JSON extension. I want to try this visualization in Vis.js but I am relatively new to it. I have seen an example of GephiJSON but somehow I do not understand the implementation.

Any sincere guidance would be really appreciated.

Shan-Desai
  • 3,101
  • 3
  • 46
  • 89

1 Answers1

0

If you want to load your data into vis.js, you will have to convert it to the format that vis.js understands: an array with nodes like [{id: 1, label: 'Node 1'}, ...] and an array with edges like [{from: 1, to: 2}, ...]. You can use event listeners to listen for event like select, and in that case you could display additional information about the selected node in a side panel or something.

Jos de Jong
  • 6,602
  • 3
  • 38
  • 58
  • Hi Jos, I am trying to get my head around this query in vis.js. Would you suggest something like `[{id: 1, label: 'c10c00000000007b'}]` or something similar. So I try mapping my JSON to the format of vis.js and then carry out the procedures accordingly? – Shan-Desai Jul 29 '15 at 09:07
  • Yes you have to map your JSON to the format of vis.js. What text you want to display as label is up to you, whether it's your eui, count, or tempeature or a combination of them al. You can also display additional information using `title`, this will be displayed when hovering a node. – Jos de Jong Jul 29 '15 at 09:58