---
code: "SCH-01"
id: "c-sch-2col"
tab: "schemas"
kind: "schema"
title: "2분할 좌우 · Compare"
library: "SVG"
deps: ["svg"]
load: "low"
pasteKind: "schema-svg"
family: "compare"
dataShape: "2-cell diagram with 좌-우 axis"
tasks: ["structure ideas", "explain process", "choose communication frame"]
tags: ["compare", "좌-우", "2cells", "비교", "before-after", "A/B", "대비"]
gallery: "https://graph.heal7.com/#SCH-01"
js: "/sku/SCH-01.js"
---

# [SCH-01] 2분할 좌우 · Compare

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

## 언제 가져가나
A와 B 두 대상의 차이를 한눈에 비교 — 좌→우 시선 흐름이 자연스럽게 대조를 만들어주는 기초 패턴.

**응용** Before/After, 현재/목표, 경쟁사 비교, 가설 검증.

## 데이터 모양
- family: `compare`
- dataShape: 2-cell diagram with 좌-우 axis
- tasks: structure ideas, explain process, choose communication frame
- tags: compare, 좌-우, 2cells, 비교, before-after, A/B, 대비

- schema.type: `compare`
- schema.cells: `2`
- schema.axis: `좌-우`


## 의존
svg · load `low` · library `SVG`

## 붙여넣는 법
1. 라이브러리 없음. svg viewBox 0 0 400 240
2. 아래 body 를 svg 안에 넣는다
3. 색 변수(`${gold}` 등)는 T 토큰으로 치환한다

```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 gold = T.gold, royal = T.royal, rose = T.rose, teal = T.teal, plum = T.plum, fg = T.fg, sub = T.sub;
const stroke = 'rgba(255,255,255,.18)';
const fill1 = 'rgba(232,192,105,.10)';
const fill2 = 'rgba(107,140,255,.10)';
const host = document.querySelector('#chart');
const body = `
    <rect x="20" y="40" width="170" height="160" rx="10" fill="${fill1}" stroke="${gold}" stroke-width="1.5"/>
    <rect x="210" y="40" width="170" height="160" rx="10" fill="${fill2}" stroke="${royal}" stroke-width="1.5"/>
    <text x="105" y="120" text-anchor="middle" fill="${fg}" font-size="22" font-weight="700">A</text>
    <text x="105" y="148" text-anchor="middle" fill="${sub}" font-size="11">현재</text>
    <text x="295" y="120" text-anchor="middle" fill="${fg}" font-size="22" font-weight="700">B</text>
    <text x="295" y="148" text-anchor="middle" fill="${sub}" font-size="11">목표</text>
    <text x="200" y="225" text-anchor="middle" fill="${sub}" font-size="11">↔ Before / After · A / B</text>
  `;
host.innerHTML = '<svg viewBox="0 0 400 240" width="100%" height="100%" preserveAspectRatio="xMidYMid meet" style="overflow:visible">' + (typeof body === 'string' ? body : '') + '</svg>';
```

## 원본 factory (갤러리 정본 발췌)
- file: `frontend/js/graph-gallery/main.js`
- lines: 3911-4470
- gallery: https://graph.heal7.com/#SCH-01
- raw js: https://graph.heal7.com/sku/SCH-01.js

```js
`
    <rect x="20" y="40" width="170" height="160" rx="10" fill="${fill1}" stroke="${gold}" stroke-width="1.5"/>
    <rect x="210" y="40" width="170" height="160" rx="10" fill="${fill2}" stroke="${royal}" stroke-width="1.5"/>
    <text x="105" y="120" text-anchor="middle" fill="${fg}" font-size="22" font-weight="700">A</text>
    <text x="105" y="148" text-anchor="middle" fill="${sub}" font-size="11">현재</text>
    <text x="295" y="120" text-anchor="middle" fill="${fg}" font-size="22" font-weight="700">B</text>
    <text x="295" y="148" text-anchor="middle" fill="${sub}" font-size="11">목표</text>
    <text x="200" y="225" text-anchor="middle" fill="${sub}" font-size="11">↔ Before / After · A / B</text>
  `
```

## 시나리오
- Before / After — 정책 시행 전후 KPI 변화
- 경쟁사 비교 — 우리 제품 vs 경쟁사 핵심 메트릭
- A/B 테스트 — 실험군 vs 대조군 전환율
- 현재 / 목표 — 분기 KPI 현 상태와 도달 목표

## 관련 SKU
`c-sch-quad`, `c-sch-3flow`

