How to Hide Overlapping Text of Labels in D3 Zoomable Pack Layout?

我只是一个虾纸丫 提交于 2019-12-10 20:10:42

问题


I am using the Zoomable Pack Layout provided on the D3 website: http://mbostock.github.io/d3/talk/20111116/pack-hierarchy.html

All labels of the circles are displayed when the layout is displayed.

The problem is that for small circles which are close together, the labels overlap. I would like to know if there is a way to hide the overlapping text of the labels?

I have read about "foreignobject", but if this is the answer, I am not sure how and where to incorporate it in the code.


回答1:


You could restrict the display of text based on either the level of the hierarchy, the radius of the circle or a combination of both. Both are in the pack output. Use titles for hover detail.



来源:https://stackoverflow.com/questions/19607281/how-to-hide-overlapping-text-of-labels-in-d3-zoomable-pack-layout

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!