o2o-negosium-original/negodata/front/src/features/statistics/palette.ts
Mina Choi c32ee300e6 [feat] negodata: 통계 페이지(성과 분석) 추가 — 파생 집계 API + recharts 차트
- 백엔드 GET /v1/statistics/summary: 회사/내견적 스코프, 최근 6개월 파생 집계(저장 X, DDL 0)
- 지표: 총절감/절감률/낙찰률/앵커도달률/마감수/재견적라운드 + 월별추이·마감결과분해·참여율·유형별(협상/견적)·카테고리·카드빈도
- 프론트 recharts+shadcn Chart, 사이드바 통계 nav, /statistics

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-07 16:18:33 +09:00

28 lines
1.6 KiB
TypeScript

// 통계 차트 시리즈 색. features/dashboard/tones 와 같은 계열(Tailwind 램프)을 라이트/다크 한 쌍으로 둔다.
// shadcn ChartConfig 의 theme({light,dark}) 로 주입 → [data-chart] 스코프 --color-<key> CSS 변수 → 다크모드 자동 전환.
// 색 단독 식별 금지 — 모든 차트는 범례/값을 함께 노출한다(색맹 안전, dataviz 6단계).
export type SeriesKey = 'emerald' | 'amber' | 'blue' | 'purple' | 'rose' | 'zinc';
export const SERIES_COLOR: Record<SeriesKey, { light: string; dark: string }> = {
emerald: { light: '#10b981', dark: '#34d399' }, // 절감/낙찰/응찰 = 긍정
amber: { light: '#f59e0b', dark: '#fbbf24' }, // 개찰(가격) = 주의
blue: { light: '#3b82f6', dark: '#60a5fa' }, // 협상/카테고리 기본
purple: { light: '#a855f7', dark: '#c084fc' }, // 경매/동가
rose: { light: '#f43f5e', dark: '#fb7185' }, // 거부
zinc: { light: '#d4d4d8', dark: '#52525b' }, // 미응찰/중립
};
// shadcn ChartConfig 의 theme 슬롯용.
export const themeOf = (k: SeriesKey) => ({ light: SERIES_COLOR[k].light, dark: SERIES_COLOR[k].dark });
// 차트 밖(범례 점 등) DOM 요소용 Tailwind bg 클래스. --color-<key> CSS 변수는 [data-chart] 스코프 안에만 있어
// 차트 바깥에선 못 쓰므로, 여기서 라이트/다크 램프 스텝을 직접 건다.
export const SERIES_BG: Record<SeriesKey, string> = {
emerald: 'bg-emerald-500 dark:bg-emerald-400',
amber: 'bg-amber-500 dark:bg-amber-400',
blue: 'bg-blue-500 dark:bg-blue-400',
purple: 'bg-purple-500 dark:bg-purple-400',
rose: 'bg-rose-500 dark:bg-rose-400',
zinc: 'bg-zinc-300 dark:bg-zinc-600',
};