Skip to content

[Track B] demographic_depth: peak_hour_matrix(7×24) 노출 #106

@Knockcha

Description

@Knockcha

배경

대시보드 v4.3 시각화 가이드(2026-04-23 강민) 중 Calendar Heatmap (시간×요일 유동인구 피크) 차트 적용 결정.

현재 demographic_report.peak_consumption_hoursstring[] (예: ["10-12", "18-20"])만 노출 — Heatmap 168셀(7×24) 매트릭스 데이터 부재로 차트 구현 불가.

요청 사항

DemographicReport 스키마에 다음 필드 추가:

class DemographicReport(BaseModel):
    # 기존 필드 …
    peak_hour_matrix: list[list[float]] | None = None
    """요일×시간대 유동인구 밀도 정규화 매트릭스.
    shape = [7][24] (월~일 × 0~23시).
    값 범위: 0.0 (방문 없음) ~ 1.0+ (피크 대비 비율).
    """

데이터 출처 후보

  • flow_population 테이블 시간대별 집계 (이미 D1·D2 공통 사용)
  • 마포 16동 단위 dong_code 필터 + 요일별 group by

관련 시각화

  • frontend/src/components/SimulationResult/dashboard/tabs/SummaryTab.tsx — 인구 구성 Collapsible Section 내 Calendar Heatmap (Atlassian WSJ 홍역 차트 패턴)
  • 가이드: §1-8 Heatmap 시간 × 범주 / §1-1 시간 추이

완료 조건

  • DemographicReport.peak_hour_matrix 필드 추가 (Pydantic + TS 타입)
  • demographic_depth 노드에서 매트릭스 산출 + 채움
  • 데이터 부재 시 None 반환 (mock 금지 — IM3-144 incident 근거)
  • 프론트는 자동 활성화 (현 PR에서 peak_hour_matrix 있으면 렌더, 없으면 기존 텍스트로 fallback 처리)

우선순위

Track B (블로커 아님). 본 트랙 PR 머지 후 진행 가능.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions