Skip to content

d3-hierarchy

许多数据集本质上是分层的:地理实体,例如人口普查区块、人口普查区、县和州;企业和政府的指挥结构;文件系统;软件包。即使是非层次结构的数据也可以像 k 均值聚类系统发育树 一样按层次结构排列。良好的分层可视化有助于快速进行多尺度推断:对单个元素的微观观察和对大组元素的宏观观察。

¥Many datasets are intrinsically hierarchical: geographic entities, such as census blocks, census tracts, counties and states; the command structure of businesses and governments; file systems; software packages. And even non-hierarchical data may be arranged hierarchically as with k-means clustering or phylogenetic trees. A good hierarchical visualization facilitates rapid multiscale inference: micro-observations of individual elements and macro-observations of large groups.

此模块实现了几种常用的可视化分层数据的技术:

¥This module implements several popular techniques for visualizing hierarchical data:

节点链接图使用离散的节点和链接标记来显示拓扑结构,例如每个节点用一个圆圈表示,以及连接每个父节点和子节点的一条线。“tidy” 树 非常紧凑,而 dendrogram 将叶子节点放置在同一层级。(它们具有极坐标和笛卡尔坐标形式。)缩进树 适用于交互式浏览。

¥Node-link diagrams show topology using discrete marks for nodes and links, such as a circle for each node and a line connecting each parent and child. The “tidy” tree is delightfully compact, while the dendrogram places leaves at the same level. (These have both polar and Cartesian forms.) Indented trees are useful for interactive browsing.

邻接图通过节点的相对位置显示拓扑结构。它们还可以在每个节点的区域中编码量化维度,例如显示收入或文件大小。“冰柱”图 使用矩形,而“旭日”使用环形线段。

¥Adjacency diagrams show topology through the relative placement of nodes. They may also encode a quantitative dimension in the area of each node, for example to show revenue or file size. The “icicle” diagram uses rectangles, while the “sunburst” uses annular segments.

封闭图也使用区域编码,但通过包含来显示拓扑。treemap 递归地将区域细分为矩形。圆形填充 紧密嵌套圆圈;这不像树形图那样节省空间,但可能更容易显示拓扑结构。

¥Enclosure diagrams also use an area encoding, but show topology through containment. A treemap recursively subdivides area into rectangles. Circle-packing tightly nests circles; this is not as space-efficient as a treemap, but perhaps more readily shows topology.

请参阅以下之一:

¥See one of:

  • 层级结构 - 表示和操作分层数据

    ¥Hierarchies - represent and manipulate hierarchical data

  • 分层 - 将表格数据组织成 hierarchy

    ¥Stratify - organize tabular data into a hierarchy

  • - 构造“整洁”的层次结构树形图

    ¥Tree - construct “tidy” tree diagrams of hierarchies

  • - 构造将叶节点置于相同深度的树形图

    ¥Cluster - construct tree diagrams that place leaf nodes at the same depth

  • 分区 - 构建空间填充邻接图

    ¥Partition - construct space-filling adjacency diagrams

  • 打包 - 通过紧密嵌套的圆圈构造封闭图

    ¥Pack - construct enclosure diagrams by tightly nesting circles

  • 树形图 - 按定量值递归细分矩形

    ¥Treemap - recursively subdivide rectangles by quantitative value