codeout / inet-henge

Generate d3.js based Network Diagram from JSON data.
MIT License
258 stars 38 forks source link

Add label on the links #11

Closed Vito96 closed 5 years ago

Vito96 commented 6 years ago

Hi, Is it possibile add a label for every links?

Thanks a lot.

codeout commented 6 years ago

Thanks for asking, you can do this by adding "meta" data to every link like this:

# html
new Diagram('#diagram', 'index.json').init('bandwidth');
# index.json
...
  "links": [
    {
      "source": "Node 1", "target": "Node 2",
      "meta": {"bandwidth": "10G"}
    }
  ]
...

See https://github.com/codeout/inet-henge#labels for details.