简体   繁体   中英

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

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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