refactor(B06): 700줄 초과 파일 분리 — Router·Cross_View·Section_View·Style

- B06_Section_Router.py(824) → Router_Design.py(139) 분리
- Cross_View → Cross_View_Metrics.ts(75) 분리
- Cross_Design → Cross_Design_Surface.ts(54) 분리
- Section_View → Section_View_Panel.ts(53) 분리
- Page → Page_Common.ts(15) 분리
- Style_Cross.css → Style_Cross_Controls.css(174) 분리
- B06_Section/ 전체 700줄 초과 0건

검증: tsc --noEmit 통과 · ruff check 통과(import 정렬·포맷 적용) ·
prettier 적용 · pytest tmp/tests/ 148 passed, 7 skipped.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-08-22 17:04:08 +09:00
co-authored by Claude Opus 5
parent be7503d741
commit e54da341ea
14 changed files with 553 additions and 600 deletions
+4 -50
View File
@@ -24,6 +24,10 @@ import type {
SectionMode,
SectionSample,
} from "./B06_Section_Api_Fetch";
export {
appendPavementOverlay,
appendRockBoundaryOverlay,
} from "./B06_Section_UI_Cross_Design_Surface";
const SVG_NS = "http://www.w3.org/2000/svg";
@@ -638,53 +642,3 @@ export function appendCrossDesignOverlay(
* 리핑암·발파암 지반에서만 호출한다. offsetM 음수 = 하향.
* 무효 샘플 구간은 지반선과 동일하게 선을 끊어 그린다.
*/
export function appendRockBoundaryOverlay(
svg: SVGElement,
groundSamples: Array<{ offset_m?: number; elevation_m?: number | null; valid: boolean }>,
offsetM: number,
x: (offset: number) => number,
toDisplayY: (elevation: number) => number,
): void {
const segments: string[][] = [];
let current: string[] = [];
for (const sample of groundSamples) {
const elevation = sample.elevation_m;
if (sample.valid === false || elevation === null || !Number.isFinite(elevation ?? NaN)) {
if (current.length > 1) segments.push(current);
current = [];
continue;
}
current.push(`${x(sample.offset_m ?? 0)},${toDisplayY((elevation as number) + offsetM)}`);
}
if (current.length > 1) segments.push(current);
for (const points of segments) {
const polyline = document.createElementNS(SVG_NS, "polyline");
polyline.setAttribute("points", points.join(" "));
polyline.setAttribute("class", "b06-chart__rock-boundary");
svg.append(polyline);
}
}
/** 포장 측점의 노면 포장층 박스를 겹쳐 그린다 (노면 양 끝점 기준, 두께만큼 하향). */
export function appendPavementOverlay(
svg: SVGElement,
design: CrossDesign,
x: (offset: number) => number,
toDisplayY: (elevation: number) => number,
): void {
// 포장은 차도(노견 제외)만 덮는다(D-5). 구 데이터 폴백으로 road_edges를 쓴다.
const edges = design.carriageway_edges ?? design.road_edges;
if (!design.paved || !edges) return;
const thickness = design.pavement_thickness_m ?? 0.2;
const { left, right } = edges;
const points = [
`${x(left.offset_m)},${toDisplayY(left.elevation_m)}`,
`${x(right.offset_m)},${toDisplayY(right.elevation_m)}`,
`${x(right.offset_m)},${toDisplayY(right.elevation_m - thickness)}`,
`${x(left.offset_m)},${toDisplayY(left.elevation_m - thickness)}`,
];
const polygon = document.createElementNS(SVG_NS, "polygon");
polygon.setAttribute("points", points.join(" "));
polygon.setAttribute("class", "b06-chart__pavement");
svg.append(polygon);
}