Now you can do this with the new plugin in the sigma repository: https://github.com/jacomyal/sigma.js/tree/master/plugins/sigma.renderers.edgeLabels
Just follow the instructions to create a Sigma project and you will find this file in the / build / plugins folder: sigma.renderers.edgeLabels.min.js
Include this in your html file:
<script src="sigma.min.js"></script> <script src="sigma.renderers.edgeLabels.min.js"></script>
Make sure the key labeled
var data = { // specify 'nodes' as well edges: [ { id: "e1", source: "user", target: "b1", label: "This is the label", // <----- define 'label' key for your edges }, ] }
And then specify your renderer in Sigma initialization.
var s = new sigma({ graph: data, renderer: { container: "container", type: "canvas" }, settings: { } });
user1000952
source share