JSNetworkX icon indicating copy to clipboard operation
JSNetworkX copied to clipboard

Label for edges

Open rectangel-paul opened this issue 6 years ago • 1 comments

I'm working on my visualization project using JSNetworkx but cannot find a way to add label on the edges. Please someone help me.

rectangel-paul avatar Oct 18 '19 10:10 rectangel-paul

Hi @rectangel-paul,

The issue is when updating the edge labels. During the creation process, it works fine. #70

A quick fix is to change the line 759 of the src/drawing/sgv.js with the following code:

  if (config.withEdgeLabels) {
    selection.selectAll('text')
      .attr(config.edgeLabelAttr)
      .style(config.edgeLabelStyle)
      .text(config.edgeLabels);
  }

If you want to get the already compiled (for browser) version with this fix, take it at: https://github.com/piglesias1/JSNetworkX/blob/master/jsnetworkx.js

Hope it helps!

Thanks, Pablo Iglesias

piglesias1 avatar May 14 '20 10:05 piglesias1