Dendrogram
chartAlso known as: tree diagram, cluster diagram, hierarchical tree, phylogenetic tree
설명 / Description
덴드로그램은 계층적 관계를 나타내는 가지 형태의 트리 다이어그램입니다. 각 리프 노드는 개별 개체를 나타내고, 내부 노드는 군집이나 그룹을 나타냅니다. 가지 구조는 어떤 개체들이 가장 밀접하게 관련되어 있는지 보여줍니다: 낮은 수준(짧은 가지 길이)에서 병합되는 개체는 더 높은 수준에서 병합되는 개체보다 더 유사합니다. 각 가지 구간의 높이나 길이는 보통 두 그룹이 병합되는 거리나 비유사도를 인코딩합니다.
A dendrogram is a branching tree diagram that represents hierarchical relationships. Each leaf node represents an individual entity, and internal nodes represent clusters or groupings. The branching structure shows which entities are most closely related: entities that merge at lower levels (shorter branch lengths) are more similar than those that merge at higher levels. The height or length of each branch segment typically encodes the distance or dissimilarity at which two groups merge.
덴드로그램은 계층적 군집 분석의 근간을 이루며, 여기서 알고리즘(워드 방법, 완전 연결법, UPGMA 등)은 모든 개체가 하나의 트리에 속할 때까지 가장 유사한 군집 쌍을 반복적으로 병합합니다. 덴드로그램은 이 전체 병합 이력을 시각화하여, 분석가가 원하는 군집 개수로 데이터를 나누는 "절단 높이"를 선택할 수 있게 합니다. 덴드로그램을 어떤 높이에서 수평선으로 자르면 그 세분화 수준에서 존재하는 군집들이 드러납니다.
Dendrograms are foundational in hierarchical cluster analysis, where an algorithm (such as Ward's method, complete linkage, or UPGMA) iteratively merges the most similar pairs of clusters until all entities belong to one tree. The dendrogram visualizes this entire merging history, allowing analysts to choose a "cutting height" that partitions the data into a desired number of clusters. Drawing a horizontal line across the dendrogram at any height reveals the clusters that exist at that level of granularity.
통계학을 넘어서 덴드로그램은 생물학(진화적 관계를 보여주는 계통수), 언어학(어족 계통도), 정보 아키텍처(파일 시스템이나 조직 계층 구조)에서도 등장합니다. 이 차트는 리프 노드 수가 적당할 때(20~200개) 가장 효과적입니다. 그 이상이 되면 인터랙티브 줌 기능 없이는 레이블을 읽을 수 없고 트리 구조가 압도적으로 복잡해집니다.
Beyond statistics, dendrograms appear in biology (phylogenetic trees showing evolutionary relationships), linguistics (language family trees), and information architecture (file system or organizational hierarchies). The chart works best with moderate numbers of leaf nodes (20-200); beyond that, labels become unreadable and the tree structure overwhelming without interactive zoom capabilities.
언제 사용하나 / When to Use
- 계층적 군집화 결과를 표시하여 어떤 개체들이 함께 그룹화되는지 보여줄 때
- Displaying the results of hierarchical clustering to show which entities group together
- 분류학적이거나 진화적인 관계(계통 분류학)를 보여줄 때
- Showing taxonomic or evolutionary relationships (phylogenetics)
- 조직 계층 구조, 파일 시스템, 의사결정 트리를 시각화할 때
- Visualizing organizational hierarchies, file systems, or decision trees
- 사용자가 "절단" 높이를 선택하여 다양한 세분화 수준을 탐색하게 할 때
- Enabling users to explore different levels of granularity by choosing a "cut" height
이럴 땐 피하세요 / When NOT to Use
- 계층 구조가 매우 넓을 때(수백 개의 리프 노드) 인터랙티브 줌 없이 -- 트리를 읽을 수 없게 됩니다; 공간 효율적인 표시를 위해 트리맵을 사용하세요
- When the hierarchy is very wide (hundreds of leaf nodes) without interactive zoom -- the tree becomes unreadable; use a treemap for space-efficient display
- 리프 노드에서 수량적 값을 보여줘야 할 때 -- 덴드로그램 옆에 히트맵이나 막대 차트를 함께 사용하세요
- When you need to show quantitative values at leaf nodes -- pair with a heatmap or bar chart alongside the dendrogram
- 관계가 진정한 계층 구조가 아닐 때(예: 순환이 있는 네트워크) -- 네트워크 다이어그램을 사용하세요
- When the relationships are not truly hierarchical (e.g., a network with cycles) -- use a network diagram
- 청중이 트리 다이어그램에 익숙하지 않을 때 -- 더 단순한 그룹 목록이나 막대 차트를 사용하세요
- When the audience is unfamiliar with tree diagrams -- use a simpler grouped list or bar chart
구조 / Anatomy
- 리프 노드: 개별 개체를 나타내는 말단 지점으로, 보통 레이블이 붙습니다
- Leaf nodes: Terminal points representing individual entities, typically labeled
- 내부 노드: 두 개의 서브트리가 병합되는 분기점으로, 군집을 나타냅니다
- Internal nodes: Branching points where two sub-trees merge, representing clusters
- 가지: 부모 노드와 자식 노드를 잇는 선분으로, 그 길이가 거리나 비유사도를 인코딩합니다
- Branches: Line segments connecting parent nodes to children, whose length encodes distance or dissimilarity
- 루트: 모든 개체가 하나의 군집으로 병합되는 최상위 노드
- Root: The topmost node where all entities merge into a single cluster
- 높이 축: 각 병합에서의 거리/비유사도를 측정하는 척도(보통 수직 또는 수평)
- Height axis: The scale (usually vertical or horizontal) measuring the distance/dissimilarity at each merge
- 절단선: 군집 경계를 정의하기 위해 선택한 높이에 그리는 선택적 수평선
- Cut line: An optional horizontal line at a chosen height to define cluster boundaries
- 색상: 군집 소속을 강조하기 위해 가지나 리프에 자주 적용됩니다
- Color: Often applied to branches or leaves to highlight cluster membership
변형 / Variations
- 원형 덴드로그램(방사형 트리): 가지가 중심 루트에서 바깥쪽으로 뻗어나가며, 원형으로 감싸는 큰 트리에 유용합니다
- Circular dendrogram (radial tree): Branches radiate outward from a central root, useful for large trees that wrap around a circle
- 극좌표 덴드로그램: 원형과 비슷하지만 가지 길이가 방사형으로 인코딩됩니다
- Polar dendrogram: Similar to circular but with branch lengths encoded radially
- 덴드로그램 + 히트맵: 히트맵의 한쪽 또는 양쪽 축에 덴드로그램을 배치하여 수량적 데이터와 함께 군집 구조를 보여줍니다(유전체학에서 매우 흔함)
- Dendrogram + heatmap: A dendrogram on one or both axes of a heatmap, showing cluster structure alongside quantitative data (very common in genomics)
- 클래도그램: 가지 길이가 균일하며(거리를 인코딩하지 않음) 순수하게 위상 구조에 초점을 둡니다
- Cladogram: Branch lengths are uniform (not encoding distance), focusing purely on topology
- 인터랙티브 덴드로그램: 클릭으로 서브트리를 펼치거나 접어 큰 계층 구조를 탐색할 수 있게 합니다
- Interactive dendrogram: Click to expand/collapse sub-trees, enabling exploration of large hierarchies
코드 레퍼런스 / Code Reference
// D3 dendrogram using d3.cluster layout
import * as d3 from "d3";
const root = d3.hierarchy(data).sort((a, b) => a.height - b.height);
const cluster = d3.cluster().size([height, width - 160]);
cluster(root);
const svg = d3.select("#chart").append("svg")
.attr("viewBox", [0, 0, width, height]);
svg.selectAll("path")
.data(root.links()).join("path")
.attr("d", d3.linkHorizontal().x(d => d.y).y(d => d.x))
.attr("fill", "none").attr("stroke", "#999");
svg.selectAll("text")
.data(root.leaves()).join("text")
.attr("x", d => d.y + 6).attr("y", d => d.x)
.text(d => d.data.name).attr("font-size", 10);