---
code: "NET-10"
id: "c-bundle"
tab: "network"
kind: "core"
title: "Edge Bundling · 곡선 묶음"
library: "ECharts"
deps: ["echarts@5"]
load: "low"
pasteKind: "echarts-mount"
family: "relationship"
dataShape: "flows, ties or connected entities"
tasks: ["show connections", "show hierarchy", "trace flow"]
tags: ["network", "relationship", "flow", "edge", "bundling", "곡선", "묶음"]
gallery: "https://graph.heal7.com/#NET-10"
js: "/sku/NET-10.js"
---

# [NET-10] Edge Bundling · 곡선 묶음

> AI 붙여넣기 카드. 갤러리 런타임(`main.js`)이 아니라 이 파일을 가져와라.

## 언제 가져가나
계층 트리의 leaf 사이 연결을 곡선으로 묶음 — 시각적 잡음을 줄여 흐름이 보임.

**응용** 부서 간 협업 흐름, 모듈 의존성, 항공 노선 묶음.

## 데이터 모양
- family: `relationship`
- dataShape: flows, ties or connected entities
- tasks: show connections, show hierarchy, trace flow
- tags: network, relationship, flow, edge, bundling, 곡선, 묶음


## 의존
echarts@5 · load `low` · library `ECharts`

## 붙여넣는 법
1. echarts 5.x 로드 (GL이면 echarts-gl도)
2. 컨테이너 id를 원본 id와 맞추거나 `document.getElementById` 한 줄만 바꾼다
3. `T`, `reg`, `cssv` 가 필요하면 갤러리 테마 스텁을 함께 가져간다

```js
const T = {
  "bg": "transparent",
  "fg": "#ece8f5",
  "sub": "#a59bbd",
  "grid": "rgba(255,255,255,.08)",
  "gold": "#e8c069",
  "royal": "#6b8cff",
  "rose": "#e07a9f",
  "teal": "#6dd2c4",
  "plum": "#b487e8"
};
const cssv = (n, fb) => (getComputedStyle(document.documentElement).getPropertyValue(n).trim() || fb);
const isDark = () => document.documentElement.getAttribute('data-theme') !== 'light';
const charts = [];
const reg = (id, opt) => {
  const dom = document.getElementById(id); if (!dom) return;
  const c = echarts.init(dom, null, {renderer:'canvas'});
  c.setOption(opt);
  charts.push(c);
  return c;
};
const factory = function(){
  const cats = ['전략','디자인','개발','데이터','마케팅'];
  const leaves = [];
  cats.forEach((c,ci)=>{
    for(let i=0;i<5;i++){
      const angle = (ci*5+i) * (Math.PI*2/(cats.length*5));
      leaves.push({name:`${c[0]}${i+1}`, group:ci, angle, x:Math.cos(angle)*100, y:Math.sin(angle)*100});
    }
  });
  // 12 random connections
  const links = [];
  for(let k=0;k<14;k++){
    const a = Math.floor(Math.random()*leaves.length);
    let b = Math.floor(Math.random()*leaves.length); while(b===a) b = Math.floor(Math.random()*leaves.length);
    links.push({source:leaves[a].name, target:leaves[b].name});
  }
  const colors = [T.gold, T.royal, T.rose, T.teal, T.plum];
  reg('c-bundle', {
    backgroundColor:T.bg,
    tooltip:{},
    series:[{
      type:'graph', layout:'none', coordinateSystem:undefined,
      symbolSize:10,
      data: leaves.map(l => ({name:l.name, x:l.x, y:l.y, itemStyle:{color:colors[l.group]}})),
      links: links.map(l => ({source:l.source, target:l.target})),
      lineStyle:{color:'source', curveness:0.45, opacity:0.55, width:1.2},
      label:{show:true, color:T.sub, fontSize:10}
    }]
  });
};
factory();
```

## 원본 factory (갤러리 정본 발췌)
- file: `frontend/js/graph-gallery/main.js`
- lines: 2946-2975
- gallery: https://graph.heal7.com/#NET-10
- raw js: https://graph.heal7.com/sku/NET-10.js

```js
function(){
  const cats = ['전략','디자인','개발','데이터','마케팅'];
  const leaves = [];
  cats.forEach((c,ci)=>{
    for(let i=0;i<5;i++){
      const angle = (ci*5+i) * (Math.PI*2/(cats.length*5));
      leaves.push({name:`${c[0]}${i+1}`, group:ci, angle, x:Math.cos(angle)*100, y:Math.sin(angle)*100});
    }
  });
  // 12 random connections
  const links = [];
  for(let k=0;k<14;k++){
    const a = Math.floor(Math.random()*leaves.length);
    let b = Math.floor(Math.random()*leaves.length); while(b===a) b = Math.floor(Math.random()*leaves.length);
    links.push({source:leaves[a].name, target:leaves[b].name});
  }
  const colors = [T.gold, T.royal, T.rose, T.teal, T.plum];
  reg('c-bundle', {
    backgroundColor:T.bg,
    tooltip:{},
    series:[{
      type:'graph', layout:'none', coordinateSystem:undefined,
      symbolSize:10,
      data: leaves.map(l => ({name:l.name, x:l.x, y:l.y, itemStyle:{color:colors[l.group]}})),
      links: links.map(l => ({source:l.source, target:l.target})),
      lineStyle:{color:'source', curveness:0.45, opacity:0.55, width:1.2},
      label:{show:true, color:T.sub, fontSize:10}
    }]
  });
}
```

