Files
Aislo/B05_Profile/B05_Profile_UI_Drainage_Show.ts
T
eomsangdonandClaude Opus 5.5 65b4b13ed7 refactor(472-5 5-A 나눔): 구조물 · 배수 판 셋 690줄 넘음 — 동작 같게 나눔
- B06_Section_UI_Page_Structures_Panel 700 → 타입을 _Panel_Types 로(다시 내보냄)
- B05_Profile_UI_Structures_Panel 693 → 관 목록 받기(임시 · 고른 관 따라감)를 _Panel_Pipes 로
- B05_Profile_UI_Drainage_Panel 691 → 표시 토글 상태를 _Drainage_Show 로
- 시험 test_233_3 — 옮긴 줄을 새 파일에서 읽음(까닭: 같은 줄이 자리만 옮김)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-19 09:42:53 +09:00

63 lines
2.1 KiB
TypeScript

/* =============================================================================
* B05_Profile_UI_Drainage_Show.ts
* 배수유역 판 표시 토글 상태 — 위성 · 도엽 · 화살표 · 강도 · 집중점 · 상류 세류
* (`B05_Profile_UI_Drainage_Panel.ts` 에서 나눔 · 472-5 · 동작 같음).
* ========================================================================== */
import { mountDrainageToggles, type DrainageLayer } from "./B05_Profile_UI_Drainage_Parts";
/** 지금 켜진 표시 — 그리기가 읽음(토글이 고침). */
export interface DrainageShow {
arrows: boolean;
/** 유입 강도 색칠 — B04 지도와 같은 색띠·같은 값(2026-08-01 사용자 지시). */
strength: boolean;
/** 유입 집중점 — 기본 꺼짐(마커가 관 마커와 겹쳐 읽기 어렵다). */
hotspots: boolean;
/** 유역 안쪽 상류 세류망 — B04 기준선 강조. */
upstream: boolean;
}
/** 토글 줄을 붙이고 상태를 돌려줌 — 위성사진은 기본 꺼짐(2026-08-18 사용자 지시). */
export function mountDrainageShow(
layerButtons: HTMLElement,
deps: {
backgroundImage: HTMLImageElement;
activeLayers: Set<DrainageLayer>;
onStrength: (show: boolean) => void;
redraw: () => void;
},
): DrainageShow {
const show: DrainageShow = { arrows: true, strength: true, hotspots: false, upstream: true };
deps.backgroundImage.hidden = true;
mountDrainageToggles(layerButtons, {
initial: { satellite: false, ...show },
onSatellite: (next) => {
deps.backgroundImage.hidden = !next;
deps.redraw();
},
onSheetLayer: (layer, next) => {
if (next) deps.activeLayers.add(layer);
else deps.activeLayers.delete(layer);
deps.redraw();
},
onArrows: (next) => {
show.arrows = next;
deps.redraw();
},
onStrength: (next) => {
show.strength = next;
deps.onStrength(next);
deps.redraw();
},
onHotspots: (next) => {
show.hotspots = next;
deps.redraw();
},
onUpstream: (next) => {
show.upstream = next;
deps.redraw();
},
});
return show;
}