Skip to content

Commit

Permalink
added custom css class on edge labels
Browse files Browse the repository at this point in the history
It should fix dagrejs#195
  • Loading branch information
kaelhem authored Mar 27, 2020
1 parent 58c0378 commit b84438c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/create-edge-labels.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,12 @@ function createEdgeLabels(selection, g) {
var root = d3.select(this);
root.select(".label").remove();
var edge = g.edge(e);
var label = addLabel(root, g.edge(e), 0, 0).classed("label", true);
var className = "label";
if (edge.className) {
className += " " + edge.className;
}
var label = addLabel(root, g.edge(e), 0, 0);
label.attr("class", className);
var bbox = label.node().getBBox();

if (edge.labelId) { label.attr("id", edge.labelId); }
Expand Down

0 comments on commit b84438c

Please sign in to comment.