d3边缘标签可以吗? [英] Is d3 edge labeling possible?

查看:69
本文介绍了d3边缘标签可以吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以使用 d3 在图形中包含边缘标签?我查看了示例和一些文档,可以看到可以在何处进行节点标记,但是没有在任何地方(我可以找到)明确提到边缘标记。

Is it possible to have edge labels in a graph using d3? I've looked over the examples and some of the documentation, and I can see where node labeling is possible, but edge labeling is not explicitly mentioned anywhere (that I can find).

推荐答案

按照其他人的示例


  • 添加一条路径与每个边缘并排,

  • 向边缘添加文本

  • 将文本绑定到文本路径,该路径引用沿边缘的路径

  • add a path alongside every edge,
  • add text to the edges
  • bind that text to a textpath which is referencing the path along the edge

此示例使用了以上想法: http://bl.ocks.org/jhb/5955887

This example is using the above ideas: http://bl.ocks.org/jhb/5955887

这篇关于d3边缘标签可以吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆