I am trying to load a gexf file with sigInst.parseGexf(\'data/test.gexf\').
To create an edge with label I have this line in gexf file:
It's now possible to do this with a new plugin in the sigma repository: https://github.com/jacomyal/sigma.js/tree/master/plugins/sigma.renderers.edgeLabels
Just follow the instructions to build the Sigma project and you'll find this file in the /build/plugins folder: sigma.renderers.edgeLabels.min.js
Include that in your html file:
Make sure your edges have a 'label' key defined
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 the Sigma initialization.
var s = new sigma({
graph: data,
renderer: {
container: "container",
type: "canvas"
},
settings: {
}
});