---
code: "NET-01"
id: "c-chord"
tab: "network"
kind: "core"
title: "Chord · 코드 다이어그램"
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", "chord", "코드", "다이어그램"]
gallery: "https://graph.heal7.com/#NET-01"
js: "/sku/NET-01.js"
---

# [NET-01] Chord · 코드 다이어그램

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

## 언제 가져가나
원주에 카테고리, 호로 양방향 흐름 — 협업/거래 빈도.

**응용** 역할↔역할 협업 강도, 콘텐츠 교차 소비.

## 데이터 모양
- family: `relationship`
- dataShape: flows, ties or connected entities
- tasks: show connections, show hierarchy, trace flow
- tags: network, relationship, flow, chord, 코드, 다이어그램


## 의존
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 = ['기획','디자인','개발','마케팅','영업','CS'];
  const data = cats.map((c,i)=>({name:c, symbolSize: 30+i*4, itemStyle:{color:[T.gold,T.royal,T.plum,T.rose,T.teal,'#cfd1d3'][i]}}));
  const links = [];
  for(let i=0;i<cats.length;i++) for(let j=i+1;j<cats.length;j++){
    const v = Math.random();
    if(v>.35) links.push({source:cats[i], target:cats[j], lineStyle:{width:2+Math.random()*4, color:'rgba(232,192,105,.35)', curveness:.3}});
  }
  reg('c-chord', {
    backgroundColor:T.bg, tooltip:{},
    series:[{type:'graph', layout:'circular', circular:{rotateLabel:true}, roam:false,
      label:{show:true, color:T.fg, fontSize:11, position:'right'},
      data, links, edgeSymbol:['none','none'],
      lineStyle:{opacity:.7}, emphasis:{focus:'adjacency'}}]
  });
};
factory();
```

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

```js
function(){
  const cats = ['기획','디자인','개발','마케팅','영업','CS'];
  const data = cats.map((c,i)=>({name:c, symbolSize: 30+i*4, itemStyle:{color:[T.gold,T.royal,T.plum,T.rose,T.teal,'#cfd1d3'][i]}}));
  const links = [];
  for(let i=0;i<cats.length;i++) for(let j=i+1;j<cats.length;j++){
    const v = Math.random();
    if(v>.35) links.push({source:cats[i], target:cats[j], lineStyle:{width:2+Math.random()*4, color:'rgba(232,192,105,.35)', curveness:.3}});
  }
  reg('c-chord', {
    backgroundColor:T.bg, tooltip:{},
    series:[{type:'graph', layout:'circular', circular:{rotateLabel:true}, roam:false,
      label:{show:true, color:T.fg, fontSize:11, position:'right'},
      data, links, edgeSymbol:['none','none'],
      lineStyle:{opacity:.7}, emphasis:{focus:'adjacency'}}]
  });
}
```

