화면 구성 — 시각화 (tree/graph)
기본 화면 문법은 화면 구성 (기본), 고급 문법은 화면 구성 (고급)을 참조하세요.
개요
tree와 graph screenType은 config-driven 시각화 아키텍처를 따릅니다. 캔버스 디자이너에서 설정한 treeConfig 또는 graphConfig가 런타임에서 자동으로 렌더링되며, 코드 수정 없이 다양한 솔루션에 재사용할 수 있습니다.
핵심 설계 원칙:
- 선언적 구성: JSON config만으로 트리/그래프 화면 생성
- 동적 컬럼 접근:
parentColumn,childColumn등으로 테이블 컬럼을 동적 참조 (getField패턴) - 솔루션 독립: MES LOT 계보, ERP BOM, EAM 설비 계층 등 동일 엔진으로 처리
데이터 흐름
캔버스 디자이너에서 런타임 렌더링까지의 전체 파이프라인입니다.
┌─────────────────────────┐
│ Canvas Designer │
│ ScreenViewNodePanel │
│ (treeConfig/graphConfig│
│ 설정 UI) │
└──────────┬──────────────┘
│ JSON 저장
▼
┌─────────────────────────┐
│ runtimeStore │
│ (screenType, config │
│ 로드 및 상태 관리) │
└──────────┬──────────────┘
│ props 전달
▼
┌─────────────────────────┐
│ ScreenModal │
│ (screenType 분기) │
│ tree → RuntimeTreeView │
│ graph → RuntimeGraphView│
└──────────┬──────────────┘
│ config 해석
▼
┌─────────────────────────┐
│ 시각화 컴포넌트 │
│ - LotGenealogyTree │
│ - LotTraceGraph │
│ (React Flow 기반 렌더링)│
└─────────────────────────┘
데이터 흐름 요약
- 디자이너에서
treeConfig/graphConfig를 JSON으로 저장 runtimeStore가 해당 설정을 로드하여 상태 관리ScreenModal이screenType에 따라 적절한 뷰 컴포넌트로 분기- 뷰 컴포넌트가 config의 컬럼명을 기반으로 데이터를 동적 조회하여 시각화
treeConfig 상세
트리뷰 화면의 전체 설정 구조입니다.
전체 JSON 예시
{
"refId": "scr_lot_genealogy_tree",
"label": "LOT 계보 트리",
"screenType": "tree",
"menuIcon": "ApartmentOutlined",
"menuOrder": 5,
"boundTableRef": "lot_genealogy",
"parentMenuRef": "menu_mes_production",
"treeConfig": {
"parentColumn": "parent_lot_id",
"childColumn": "child_lot_id",
"labelColumn": "lot_number",
"badgeColumn": "relation_type",
"detailColumns": ["consumed_qty", "produced_qty", "linked_at"],
"direction": "TB",
"maxDepth": 10,
"searchEnabled": true,
"detailPanelEnabled": true
},
"listConfig": {
"columns": [
{ "columnName": "parent_lot_id", "width": 150, "sortable": true },
{ "columnName": "child_lot_id", "width": 150, "sortable": true },
{ "columnName": "relation_type", "width": 100, "filterable": true }
],
"defaultSort": { "columnName": "linked_at", "order": "descend" },
"pageSize": 20
}
}