---
code: "TIM-05"
id: "c-stream"
tab: "timeline"
kind: "core"
title: "Stream · 스트림 그래프"
library: "ECharts"
deps: ["echarts@5"]
load: "low"
pasteKind: "echarts-mount"
family: "relationship"
dataShape: "flows, ties or connected entities"
tasks: ["show trend", "show seasonality", "show sequence", "show connections"]
tags: ["time-series", "trend", "timeline", "network", "flow", "stream", "스트림", "그래프"]
gallery: "https://graph.heal7.com/#TIM-05"
js: "/sku/TIM-05.js"
---

# [TIM-05] Stream · 스트림 그래프

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

## 언제 가져가나
시간 따른 카테고리별 비중 변화 — 부드러운 강.

**응용** 관심 키워드 변천, 매출 카테고리 점유 변화.

## 데이터 모양
- family: `relationship`
- dataShape: flows, ties or connected entities
- tasks: show trend, show seasonality, show sequence, show connections
- tags: time-series, trend, timeline, network, flow, stream, 스트림, 그래프


## 의존
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 = ['창의','분석','관계','실행','보호'];
  const data = [];
  for(let m=1;m<=12;m++){
    const ts = '2026-' + String(m).padStart(2,'0') + '-01';
    cats.forEach((c,i)=>{
      const base = [22,18,16,20,14][i];
      const wave = Math.sin((m+i*2)/2.2)*6 + (Math.random()*4-2);
      data.push([ts, Math.max(4, Math.round(base+wave)), c]);
    });
  }
  reg('c-stream', {
    backgroundColor:T.bg, tooltip:{trigger:'axis'},
    legend:{data:cats, textStyle:{color:T.sub}, top:0, right:8},
    color:[T.gold,T.royal,T.rose,T.teal,T.plum],
    singleAxis:{top:36, bottom:30, type:'time', axisLabel:{color:T.sub,fontSize:10}, axisLine:{lineStyle:{color:T.grid}}},
    series:[{type:'themeRiver', data, label:{color:T.fg,fontSize:10}, emphasis:{itemStyle:{shadowBlur:14,shadowColor:'rgba(0,0,0,.4)'}}}]
  });
};
factory();
```

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

```js
function(){
  const cats = ['창의','분석','관계','실행','보호'];
  const data = [];
  for(let m=1;m<=12;m++){
    const ts = '2026-' + String(m).padStart(2,'0') + '-01';
    cats.forEach((c,i)=>{
      const base = [22,18,16,20,14][i];
      const wave = Math.sin((m+i*2)/2.2)*6 + (Math.random()*4-2);
      data.push([ts, Math.max(4, Math.round(base+wave)), c]);
    });
  }
  reg('c-stream', {
    backgroundColor:T.bg, tooltip:{trigger:'axis'},
    legend:{data:cats, textStyle:{color:T.sub}, top:0, right:8},
    color:[T.gold,T.royal,T.rose,T.teal,T.plum],
    singleAxis:{top:36, bottom:30, type:'time', axisLabel:{color:T.sub,fontSize:10}, axisLine:{lineStyle:{color:T.grid}}},
    series:[{type:'themeRiver', data, label:{color:T.fg,fontSize:10}, emphasis:{itemStyle:{shadowBlur:14,shadowColor:'rgba(0,0,0,.4)'}}}]
  });
}
```

