---
code: "NET-07"
id: "c-hive"
tab: "network"
kind: "core"
title: "Hive Plot · 하이브 플롯"
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", "hive", "plot", "하이브", "플롯"]
gallery: "https://graph.heal7.com/#NET-07"
js: "/sku/NET-07.js"
---

# [NET-07] Hive Plot · 하이브 플롯

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

## 언제 가져가나
3개 축 위에 노드 정렬 — Arc보다 정형, 유형별 연결을 한눈에.

**응용** 3-tier 아키텍처 의존, 입력→처리→출력 흐름.

## 데이터 모양
- family: `relationship`
- dataShape: flows, ties or connected entities
- tasks: show connections, show hierarchy, trace flow
- tags: network, relationship, flow, hive, plot, 하이브, 플롯


## 의존
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 axes = [-Math.PI/2, Math.PI/6, Math.PI*5/6];
  const COL = [T.gold, T.royal, T.rose];
  const nodes = [];
  axes.forEach((a, ai) => {
    for(let i=1;i<=4;i++){
      const r = 18 + i*16;
      nodes.push({id:'a'+ai+'_'+i, name:'A'+ai+'-'+i, value:[Math.cos(a)*r, Math.sin(a)*r], symbolSize:10, itemStyle:{color:COL[ai]}});
    }
  });
  // 축 가이드라인 (markLine 대신 별도 line series)
  const guides = axes.map(a => [[0,0], [Math.cos(a)*80, Math.sin(a)*80]]);
  const links = [];
  for(let i=0;i<18;i++){
    const a = Math.floor(Math.random()*nodes.length);
    let b = Math.floor(Math.random()*nodes.length);
    if(a===b) b = (b+1)%nodes.length;
    links.push({source:nodes[a].id, target:nodes[b].id, lineStyle:{color:'rgba(232,192,105,.32)', curveness:.4, width:1+Math.random()}});
  }
  reg('c-hive', {
    backgroundColor:T.bg, tooltip:{},
    grid:{top:8, right:8, bottom:8, left:8},
    xAxis:{type:'value', show:false, min:-95, max:95},
    yAxis:{type:'value', show:false, min:-95, max:95, inverse:false},
    series:[
      {type:'lines', coordinateSystem:'cartesian2d', data:guides.map(g=>({coords:g})),
        lineStyle:{color:'rgba(255,255,255,.12)', width:1.5, type:'dashed'}, silent:true, animation:false},
      {type:'graph', coordinateSystem:'cartesian2d', data:nodes, links,
        label:{show:false}, edgeSymbol:['none','none'],
        emphasis:{focus:'adjacency', lineStyle:{width:3, color:T.gold}}}
    ]
  });
};
factory();
```

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

```js
function(){
  const axes = [-Math.PI/2, Math.PI/6, Math.PI*5/6];
  const COL = [T.gold, T.royal, T.rose];
  const nodes = [];
  axes.forEach((a, ai) => {
    for(let i=1;i<=4;i++){
      const r = 18 + i*16;
      nodes.push({id:'a'+ai+'_'+i, name:'A'+ai+'-'+i, value:[Math.cos(a)*r, Math.sin(a)*r], symbolSize:10, itemStyle:{color:COL[ai]}});
    }
  });
  // 축 가이드라인 (markLine 대신 별도 line series)
  const guides = axes.map(a => [[0,0], [Math.cos(a)*80, Math.sin(a)*80]]);
  const links = [];
  for(let i=0;i<18;i++){
    const a = Math.floor(Math.random()*nodes.length);
    let b = Math.floor(Math.random()*nodes.length);
    if(a===b) b = (b+1)%nodes.length;
    links.push({source:nodes[a].id, target:nodes[b].id, lineStyle:{color:'rgba(232,192,105,.32)', curveness:.4, width:1+Math.random()}});
  }
  reg('c-hive', {
    backgroundColor:T.bg, tooltip:{},
    grid:{top:8, right:8, bottom:8, left:8},
    xAxis:{type:'value', show:false, min:-95, max:95},
    yAxis:{type:'value', show:false, min:-95, max:95, inverse:false},
    series:[
      {type:'lines', coordinateSystem:'cartesian2d', data:guides.map(g=>({coords:g})),
        lineStyle:{color:'rgba(255,255,255,.12)', width:1.5, type:'dashed'}, silent:true, animation:false},
      {type:'graph', coordinateSystem:'cartesian2d', data:nodes, links,
        label:{show:false}, edgeSymbol:['none','none'],
        emphasis:{focus:'adjacency', lineStyle:{width:3, color:T.gold}}}
    ]
  });
}
```

