---
code: "CMP-09"
id: "c-tornado"
tab: "compare"
kind: "core"
title: "Tornado · 영향 토네이도"
library: "ECharts"
deps: ["echarts@5"]
load: "low"
pasteKind: "echarts-mount"
family: "comparison"
dataShape: "ranked categories or before-after pairs"
tasks: ["compare alternatives", "show delta", "benchmark groups", "compare categories"]
tags: ["comparison", "benchmark", "delta", "ranking", "tornado", "영향", "토네이도"]
gallery: "https://graph.heal7.com/#CMP-09"
js: "/sku/CMP-09.js"
---

# [CMP-09] Tornado · 영향 토네이도

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

## 언제 가져가나
HR 이직률에 영향 주는 요인 8종을 중앙축 좌우(↓완화/↑가속)로 정렬 — Mirror Bar 패턴 통합.

**응용** HR 이직 영향 요인, 매출 민감도, 남/여 분포 비교, 정책 임팩트.

## 데이터 모양
- family: `comparison`
- dataShape: ranked categories or before-after pairs
- tasks: compare alternatives, show delta, benchmark groups, compare categories
- tags: comparison, benchmark, delta, ranking, tornado, 영향, 토네이도


## 의존
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(){
  // 좌(neg)=완화 효과(음수: 이직 ↓), 우(pos)=가속 효과(양수: 이직 ↑)
  // 각 요인의 절대 영향력으로 정렬되어 위에서 아래로 내림차순.
  const items = [
    {n:'급여 인상',       pos: 4, neg:-26}, // 이직률 크게 낮춤
    {n:'팀장 리더십',     pos:12, neg:-22},
    {n:'성장 기회',       pos: 8, neg:-20}, // 부재 시 이직 ↑
    {n:'원격근무',        pos: 6, neg:-18},
    {n:'평가 공정성',     pos:14, neg:-12},
    {n:'업무 강도',       pos:22, neg:- 4}, // 강할수록 이직 ↑
    {n:'동료 관계',       pos:10, neg:-14},
    {n:'복지·휴가',       pos: 8, neg:-12}
  ];
  items.sort((a,b)=> Math.max(b.pos, -b.neg) - Math.max(a.pos, -a.neg));
  reg('c-tornado', {
    backgroundColor:T.bg, tooltip:{formatter:p=> `${p.name}<br/>${p.seriesName} <b>${p.value>0?'+':''}${p.value}%</b>`},
    legend:{data:['이직률 ↓ 완화','이직률 ↑ 가속'], top:0, right:8, textStyle:{color:T.sub,fontSize:11}},
    grid:{top:32, right:32, bottom:18, left:104},
    xAxis:{type:'value', name:'이직률 영향', nameLocation:'middle', nameGap:30, nameTextStyle:{color:T.sub,fontSize:11}, axisLabel:{color:T.sub,fontSize:10, formatter:v=>(v>0?'+':'')+v+'%'}, splitLine:{lineStyle:{color:T.grid}}},
    yAxis:{type:'category', data:items.map(x=>x.n), axisLabel:{color:T.fg,fontSize:12,fontWeight:600}, axisLine:{show:false}, axisTick:{show:false}, inverse:true},
    series:[
      {name:'이직률 ↓ 완화', type:'bar', data:items.map(x=>x.neg), itemStyle:{color:T.teal, borderRadius:[6,0,0,6]}, label:{show:true, color:'#fff', fontSize:10, position:'inside', formatter:p=>p.value+'%'}},
      {name:'이직률 ↑ 가속', type:'bar', data:items.map(x=>x.pos), itemStyle:{color:T.rose, borderRadius:[0,6,6,0]}, label:{show:true, color:'#fff', fontSize:10, position:'inside', formatter:p=>'+'+p.value+'%'}}
    ]
  });
};
factory();
```

## 원본 factory (갤러리 정본 발췌)
- file: `frontend/js/graph-gallery/main.js`
- lines: 2718-2743
- gallery: https://graph.heal7.com/#CMP-09
- raw js: https://graph.heal7.com/sku/CMP-09.js

```js
function(){
  // 좌(neg)=완화 효과(음수: 이직 ↓), 우(pos)=가속 효과(양수: 이직 ↑)
  // 각 요인의 절대 영향력으로 정렬되어 위에서 아래로 내림차순.
  const items = [
    {n:'급여 인상',       pos: 4, neg:-26}, // 이직률 크게 낮춤
    {n:'팀장 리더십',     pos:12, neg:-22},
    {n:'성장 기회',       pos: 8, neg:-20}, // 부재 시 이직 ↑
    {n:'원격근무',        pos: 6, neg:-18},
    {n:'평가 공정성',     pos:14, neg:-12},
    {n:'업무 강도',       pos:22, neg:- 4}, // 강할수록 이직 ↑
    {n:'동료 관계',       pos:10, neg:-14},
    {n:'복지·휴가',       pos: 8, neg:-12}
  ];
  items.sort((a,b)=> Math.max(b.pos, -b.neg) - Math.max(a.pos, -a.neg));
  reg('c-tornado', {
    backgroundColor:T.bg, tooltip:{formatter:p=> `${p.name}<br/>${p.seriesName} <b>${p.value>0?'+':''}${p.value}%</b>`},
    legend:{data:['이직률 ↓ 완화','이직률 ↑ 가속'], top:0, right:8, textStyle:{color:T.sub,fontSize:11}},
    grid:{top:32, right:32, bottom:18, left:104},
    xAxis:{type:'value', name:'이직률 영향', nameLocation:'middle', nameGap:30, nameTextStyle:{color:T.sub,fontSize:11}, axisLabel:{color:T.sub,fontSize:10, formatter:v=>(v>0?'+':'')+v+'%'}, splitLine:{lineStyle:{color:T.grid}}},
    yAxis:{type:'category', data:items.map(x=>x.n), axisLabel:{color:T.fg,fontSize:12,fontWeight:600}, axisLine:{show:false}, axisTick:{show:false}, inverse:true},
    series:[
      {name:'이직률 ↓ 완화', type:'bar', data:items.map(x=>x.neg), itemStyle:{color:T.teal, borderRadius:[6,0,0,6]}, label:{show:true, color:'#fff', fontSize:10, position:'inside', formatter:p=>p.value+'%'}},
      {name:'이직률 ↑ 가속', type:'bar', data:items.map(x=>x.pos), itemStyle:{color:T.rose, borderRadius:[0,6,6,0]}, label:{show:true, color:'#fff', fontSize:10, position:'inside', formatter:p=>'+'+p.value+'%'}}
    ]
  });
}
```

