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

# [NET-05] Arc · 호 다이어그램

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

## 언제 가져가나
한 축 위 노드들을 호로 연결 — 인접하지 않은 관계가 큰 호로 드러남.

**응용** 등장인물 동반 출현, 시퀀스 데이터 연관, 책 페이지 인용.

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


## 의존
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 N = 14;
  const nodes = [];
  for(let i=0;i<N;i++) nodes.push({id:'n'+i, name:'N'+(i+1), value:[i, 0], symbolSize:14, itemStyle:{color:i%2?T.royal:T.gold}});
  const links = [];
  for(let i=0;i<18;i++){
    const a = Math.floor(Math.random()*N), b = Math.floor(Math.random()*N);
    if(a!==b) links.push({source:'n'+a, target:'n'+b, lineStyle:{color:'rgba(232,192,105,.4)', curveness:-0.6, width:1+Math.random()*2}});
  }
  reg('c-arc', {
    backgroundColor:T.bg, tooltip:{},
    grid:{top:14, right:14, bottom:30, left:14},
    xAxis:{type:'value', min:-1, max:N, show:false},
    yAxis:{type:'value', min:-1, max:1.5, show:false},
    series:[{type:'graph', coordinateSystem:'cartesian2d', data:nodes, links,
      label:{show:true, color:T.sub, fontSize:9, position:'bottom'},
      edgeSymbol:['none','none'],
      emphasis:{focus:'adjacency', lineStyle:{width:3, color:T.gold}}
    }]
  });
};
factory();
```

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

```js
function(){
  const N = 14;
  const nodes = [];
  for(let i=0;i<N;i++) nodes.push({id:'n'+i, name:'N'+(i+1), value:[i, 0], symbolSize:14, itemStyle:{color:i%2?T.royal:T.gold}});
  const links = [];
  for(let i=0;i<18;i++){
    const a = Math.floor(Math.random()*N), b = Math.floor(Math.random()*N);
    if(a!==b) links.push({source:'n'+a, target:'n'+b, lineStyle:{color:'rgba(232,192,105,.4)', curveness:-0.6, width:1+Math.random()*2}});
  }
  reg('c-arc', {
    backgroundColor:T.bg, tooltip:{},
    grid:{top:14, right:14, bottom:30, left:14},
    xAxis:{type:'value', min:-1, max:N, show:false},
    yAxis:{type:'value', min:-1, max:1.5, show:false},
    series:[{type:'graph', coordinateSystem:'cartesian2d', data:nodes, links,
      label:{show:true, color:T.sub, fontSize:9, position:'bottom'},
      edgeSymbol:['none','none'],
      emphasis:{focus:'adjacency', lineStyle:{width:3, color:T.gold}}
    }]
  });
}
```

