---
code: "TIM-04"
id: "c-calendar"
tab: "timeline"
kind: "core"
title: "Calendar · 캘린더 히트맵"
library: "ECharts"
deps: ["echarts@5"]
load: "low"
pasteKind: "echarts-mount"
family: "calendar"
dataShape: "date heatmap on calendar grid"
tasks: ["show trend", "show seasonality", "show sequence", "show trend over time", "show daily intensity"]
tags: ["time-series", "trend", "timeline", "calendar", "heatmap", "캘린더", "히트맵"]
gallery: "https://graph.heal7.com/#TIM-04"
js: "/sku/TIM-04.js"
---

# [TIM-04] Calendar · 캘린더 히트맵

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

## 언제 가져가나
365일 격자에 일자별 강도 — GitHub 잔디 스타일.

**응용** 명상/일지 작성, 운세 길흉일 캘린더.

## 데이터 모양
- family: `calendar`
- dataShape: date heatmap on calendar grid
- tasks: show trend, show seasonality, show sequence, show trend over time, show daily intensity
- tags: time-series, trend, timeline, calendar, heatmap, 캘린더, 히트맵


## 의존
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 data = [];
  const start = new Date(2026,0,1).getTime();
  for(let i=0;i<365;i++){
    const d = new Date(start + i*864e5);
    const iso = d.toISOString().slice(0,10);
    const dow = d.getDay();
    const v = Math.max(0, Math.round(Math.random()*5 - (dow===0||dow===6?1:0)));
    data.push([iso, v]);
  }
  reg('c-calendar', {
    backgroundColor:T.bg, tooltip:{},
    visualMap:{min:0, max:5, orient:'horizontal', left:'center', bottom:0, textStyle:{color:T.sub,fontSize:10}, inRange:{color:['#1f1640','#3a2a5e','#6b8cff','#e8c069']}},
    calendar:{top:18, left:46, right:18, cellSize:['auto',14], range:'2026', itemStyle:{color:'rgba(255,255,255,.02)', borderColor:'#0e0a1a', borderWidth:1},
      yearLabel:{show:false}, monthLabel:{color:T.sub,fontSize:10}, dayLabel:{color:T.sub,fontSize:9, firstDay:1}, splitLine:{show:false}},
    series:[{type:'heatmap', coordinateSystem:'calendar', data}]
  });
};
factory();
```

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

```js
function(){
  const data = [];
  const start = new Date(2026,0,1).getTime();
  for(let i=0;i<365;i++){
    const d = new Date(start + i*864e5);
    const iso = d.toISOString().slice(0,10);
    const dow = d.getDay();
    const v = Math.max(0, Math.round(Math.random()*5 - (dow===0||dow===6?1:0)));
    data.push([iso, v]);
  }
  reg('c-calendar', {
    backgroundColor:T.bg, tooltip:{},
    visualMap:{min:0, max:5, orient:'horizontal', left:'center', bottom:0, textStyle:{color:T.sub,fontSize:10}, inRange:{color:['#1f1640','#3a2a5e','#6b8cff','#e8c069']}},
    calendar:{top:18, left:46, right:18, cellSize:['auto',14], range:'2026', itemStyle:{color:'rgba(255,255,255,.02)', borderColor:'#0e0a1a', borderWidth:1},
      yearLabel:{show:false}, monthLabel:{color:T.sub,fontSize:10}, dayLabel:{color:T.sub,fontSize:9, firstDay:1}, splitLine:{show:false}},
    series:[{type:'heatmap', coordinateSystem:'calendar', data}]
  });
}
```

