Open dan2097 opened 6 years ago
A workaround for this is to create the SVG element for the edge label yourself e.g.
g.setEdge(start, end, {labelType: "svg", label: svgLabel});
The SVG element can then be associated with a property of the edge object to allow it to be retrieved from the edge e.g.
g.edge(start, end).labelElem = svgLabel
https://dagrejs.github.io/project/dagre-d3/latest/demo/svg-labels.html gives an example of creating an SVG element for use as an edge label
For nodes and edges g.node(v).elem and g.edge(v,w).elem can be used to access the corresponding SVG element. Am I right in saying that there is currently no way to get the corresponding SVG element for an edge label in a similar manner? [or perhaps through a property of the edge object]
The use case I have is to interactively toggle the visibility of the nodes/edges of the graph. When changing the visibility of an edge, I would obviously also want to do the same to its corresponding edge label.