---
code: "INT-03"
id: "c-force"
tab: "dynamic-1"
kind: "interactive"
title: "본인 자원 지도 · Weak Ties"
library: "ECharts"
deps: ["echarts@5"]
load: "low"
pasteKind: "echarts-mount"
family: "social-network"
dataShape: "force-directed social ties graph"
tasks: ["explore data", "monitor change", "drill into structure", "show connections", "show influence network"]
tags: ["interactive", "live", "exploration", "network", "flow", "force", "weak ties", "본인", "자원", "지도", "weak", "ties"]
gallery: "https://graph.heal7.com/#INT-03"
js: "/sku/INT-03.js"
---

# [INT-03] 본인 자원 지도 · Weak Ties

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

## 언제 가져가나
본인을 중심으로 가족·동료·멘토·친구·약한연결까지 21개 관계 노드를 force layout으로 시각화. 노드를 드래그하면 따라 움직이고, 호버 시 인접 관계가 강조됩니다.

**응용** Granovetter의 「약한 연결의 힘(weak ties)」 — 멘토로 가는 다리는 가까운 관계가 아니라 약한 연결에서 만들어집니다.

## 데이터 모양
- family: `social-network`
- dataShape: force-directed social ties graph
- tasks: explore data, monitor change, drill into structure, show connections, show influence network
- tags: interactive, live, exploration, network, flow, force, weak ties, 본인, 자원, 지도, weak, ties


## 의존
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 dom = document.getElementById('c-force'); if(!dom) return;
  const c = echarts.init(dom);
  // 카테고리: 0 본인 / 1 가족 / 2 친구 / 3 동료 / 4 멘토 / 5 약한연결
  const N = (id, cat, sz)=>({id, name:id, category:cat, symbolSize:sz});
  const nodes = [
    N('나', 0, 44),
    // 가족 4
    N('부', 1, 26), N('모', 1, 26), N('형', 1, 22), N('동생', 1, 22),
    // 친구 5
    N('친구A', 2, 22), N('친구B', 2, 20), N('친구C', 2, 20), N('친구D', 2, 18), N('친구E', 2, 18),
    // 동료 5
    N('동료A', 3, 20), N('동료B', 3, 20), N('동료C', 3, 18), N('동료D', 3, 18), N('동료E', 3, 16),
    // 멘토 2
    N('멘토①', 4, 30), N('멘토②', 4, 26),
    // 약한 연결 4
    N('지인A', 5, 14), N('지인B', 5, 14), N('지인C', 5, 14), N('지인D', 5, 14)
  ];
  const strong = (s,t)=>({source:s, target:t, lineStyle:{width:2.4, color:'rgba(232,192,105,.5)', opacity:.9}});
  const mid    = (s,t)=>({source:s, target:t, lineStyle:{width:1.6, color:'rgba(255,255,255,.22)', opacity:.7}});
  const weak   = (s,t)=>({source:s, target:t, lineStyle:{width:1, color:'rgba(180,135,232,.45)', type:'dashed', opacity:.65}});
  const bridge = (s,t)=>({source:s, target:t, lineStyle:{width:2, color:T.rose, opacity:.95, shadowBlur:8, shadowColor:T.rose}});
  const links = [
    // 강 — 가족
    strong('나','부'), strong('나','모'), strong('나','형'), strong('나','동생'),
    mid('부','모'), mid('형','동생'),
    // 강 — 친구
    strong('나','친구A'), strong('나','친구B'), strong('나','친구C'), mid('나','친구D'), mid('나','친구E'),
    mid('친구A','친구B'), mid('친구C','친구D'),
    // 중 — 동료
    mid('나','동료A'), mid('나','동료B'), mid('나','동료C'), mid('나','동료D'), mid('나','동료E'),
    mid('동료A','동료C'), mid('동료B','동료D'),
    // 약 — 지인
    weak('나','지인A'), weak('나','지인B'), weak('나','지인C'), weak('나','지인D'),
    // 핵심: 약한 연결 → 멘토 (Granovetter bridge)
    bridge('지인A','멘토①'), bridge('지인C','멘토②'),
    weak('지인B','동료E'), weak('지인D','친구E')
  ];
  c.setOption({
    backgroundColor:T.bg, tooltip:{formatter:p=>p.dataType==='node'?('<b>'+p.name+'</b><br>분류: '+['본인','가족','친구','동료','멘토','약한 연결'][p.data.category]):'관계'},
    legend:{data:['본인','가족','친구','동료','멘토','약한 연결'], textStyle:{color:T.sub}, top:0, right:8, itemWidth:10, itemHeight:10},
    color:[T.gold, T.rose, T.teal, T.royal, '#f0a060', T.plum],
    series:[{type:'graph', layout:'force', roam:true, draggable:true,
      categories:[{name:'본인'},{name:'가족'},{name:'친구'},{name:'동료'},{name:'멘토'},{name:'약한 연결'}],
      force:{repulsion:160, edgeLength:[40,90], gravity:.08, friction:.55},
      label:{show:true, color:T.fg, fontSize:11, fontWeight:600, position:'right'},
      emphasis:{focus:'adjacency', label:{fontSize:12}, lineStyle:{width:3}, itemStyle:{shadowBlur:14, shadowColor:T.gold}},
      itemStyle:{borderColor:'rgba(255,255,255,.25)', borderWidth:1},
      data:nodes, links,
      autoCurveness:true
    }]
  });
  charts.push(c);
};
factory();
```

## 원본 factory (갤러리 정본 발췌)
- file: `frontend/js/graph-gallery/main.js`
- lines: 1014-1067
- gallery: https://graph.heal7.com/#INT-03
- raw js: https://graph.heal7.com/sku/INT-03.js

```js
function(){
  const dom = document.getElementById('c-force'); if(!dom) return;
  const c = echarts.init(dom);
  // 카테고리: 0 본인 / 1 가족 / 2 친구 / 3 동료 / 4 멘토 / 5 약한연결
  const N = (id, cat, sz)=>({id, name:id, category:cat, symbolSize:sz});
  const nodes = [
    N('나', 0, 44),
    // 가족 4
    N('부', 1, 26), N('모', 1, 26), N('형', 1, 22), N('동생', 1, 22),
    // 친구 5
    N('친구A', 2, 22), N('친구B', 2, 20), N('친구C', 2, 20), N('친구D', 2, 18), N('친구E', 2, 18),
    // 동료 5
    N('동료A', 3, 20), N('동료B', 3, 20), N('동료C', 3, 18), N('동료D', 3, 18), N('동료E', 3, 16),
    // 멘토 2
    N('멘토①', 4, 30), N('멘토②', 4, 26),
    // 약한 연결 4
    N('지인A', 5, 14), N('지인B', 5, 14), N('지인C', 5, 14), N('지인D', 5, 14)
  ];
  const strong = (s,t)=>({source:s, target:t, lineStyle:{width:2.4, color:'rgba(232,192,105,.5)', opacity:.9}});
  const mid    = (s,t)=>({source:s, target:t, lineStyle:{width:1.6, color:'rgba(255,255,255,.22)', opacity:.7}});
  const weak   = (s,t)=>({source:s, target:t, lineStyle:{width:1, color:'rgba(180,135,232,.45)', type:'dashed', opacity:.65}});
  const bridge = (s,t)=>({source:s, target:t, lineStyle:{width:2, color:T.rose, opacity:.95, shadowBlur:8, shadowColor:T.rose}});
  const links = [
    // 강 — 가족
    strong('나','부'), strong('나','모'), strong('나','형'), strong('나','동생'),
    mid('부','모'), mid('형','동생'),
    // 강 — 친구
    strong('나','친구A'), strong('나','친구B'), strong('나','친구C'), mid('나','친구D'), mid('나','친구E'),
    mid('친구A','친구B'), mid('친구C','친구D'),
    // 중 — 동료
    mid('나','동료A'), mid('나','동료B'), mid('나','동료C'), mid('나','동료D'), mid('나','동료E'),
    mid('동료A','동료C'), mid('동료B','동료D'),
    // 약 — 지인
    weak('나','지인A'), weak('나','지인B'), weak('나','지인C'), weak('나','지인D'),
    // 핵심: 약한 연결 → 멘토 (Granovetter bridge)
    bridge('지인A','멘토①'), bridge('지인C','멘토②'),
    weak('지인B','동료E'), weak('지인D','친구E')
  ];
  c.setOption({
    backgroundColor:T.bg, tooltip:{formatter:p=>p.dataType==='node'?('<b>'+p.name+'</b><br>분류: '+['본인','가족','친구','동료','멘토','약한 연결'][p.data.category]):'관계'},
    legend:{data:['본인','가족','친구','동료','멘토','약한 연결'], textStyle:{color:T.sub}, top:0, right:8, itemWidth:10, itemHeight:10},
    color:[T.gold, T.rose, T.teal, T.royal, '#f0a060', T.plum],
    series:[{type:'graph', layout:'force', roam:true, draggable:true,
      categories:[{name:'본인'},{name:'가족'},{name:'친구'},{name:'동료'},{name:'멘토'},{name:'약한 연결'}],
      force:{repulsion:160, edgeLength:[40,90], gravity:.08, friction:.55},
      label:{show:true, color:T.fg, fontSize:11, fontWeight:600, position:'right'},
      emphasis:{focus:'adjacency', label:{fontSize:12}, lineStyle:{width:3}, itemStyle:{shadowBlur:14, shadowColor:T.gold}},
      itemStyle:{borderColor:'rgba(255,255,255,.25)', borderWidth:1},
      data:nodes, links,
      autoCurveness:true
    }]
  });
  charts.push(c);
}
```

