简体   繁体   English

文本未在d3可视化中呈现

[英]Text not rendered in d3 visualization

我在这里查看可视化代码http://bl.ocks.org/mbostock/4062045 ,我很想知道为什么json文件中的名称没有与节点一起呈现,即使代码包括:

node.append("title").text(function(d) { return d.name; });

The SVG <title> element is not displayed on screen. SVG <title>元素未显示在屏幕上。 It is used as the tooltip text by browsers (and is also used by screen readers) in the same way as a title attribute in HTML. 它被浏览器用作工具提示文本(并且也被屏幕阅读器使用),其方式与HTML中的标题属性相同。

Ie, the SVG code 即,SVG代码

<svg>
   <image xlink:href="image.png">
      <title>My PNG</title>
   </image>
</svg>

Is equivalent to the HTML code 相当于HTML代码

<div>
   <img src="image.png" title="My PNG" />
</div>

Attribute title is supposed to be displayed as a tooltip (if you hover over a node), and it is really correctly displayed, check it out. 属性title应该显示为工具提示(如果将鼠标悬停在节点上),并且它确实正确显示,请将其检出。 (I know... it's not logical, but such is standard) (我知道......这不符合逻辑,但这是标准的)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM