fix(B05 종단 표): 값 칸 세움 판정 = 글 폭 — 칸 폭 기준이면 안 겹치는 16 m 이웃까지 세워짐 (407-5)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013QyNXY2TUKXCFMwAca2APG
This commit is contained in:
2026-10-18 09:42:41 +09:00
co-authored by Claude Opus 5.5
parent 501d9ca907
commit dfb3cba240
+21 -8
View File
@@ -586,24 +586,37 @@ export function createProfileTable(options: ProfileTableOptions): HTMLElement {
table.append(
...buildSegmentRows(alignment, x, fontSize, rowHeight, structureChainages, selectedChainageM),
);
// 이웃 칸과 겹치는 값 칸(1.6 m 이웃 등)은 그 자리에서 세움 — 두께 = 이웃 사이 틈(407-5 · 곡선 행과 같은 규칙)
const stationThickness = crowdedThickness(
alignment.stations.map((station, stationIndex) =>
isNearChainage(station.chainage_m, structureChainageList) ? null : centers[stationIndex],
// 이웃 칸과 글이 겹치는 값 칸(1.6 m 이웃 등)만 그 자리에서 세움 — 판정 = 세 행 가운데 가장 긴 글 폭 ·
// 두께 = 이웃 사이 틈(407-5 · 곡선 행과 같은 함수)
const stationSpecs = buildStationRows(alignment, stationInterval, display);
const isStructural = alignment.stations.map((station) =>
isNearChainage(station.chainage_m, structureChainageList),
);
const longest = Math.max(
0,
...stationSpecs.flatMap((spec) =>
alignment.stations.map((_, stationIndex) =>
isStructural[stationIndex] ? 0 : spec.cell(stationIndex).length,
),
),
cellWidth,
);
const stationThickness = crowdedThickness(
alignment.stations.map((_, stationIndex) =>
isStructural[stationIndex] ? null : centers[stationIndex],
),
longest * fontSize * CHAR_WIDTH_EM + CELL_PADDING_PX * 2,
CURVE_ROTATED_WIDTH_PX,
);
buildStationRows(alignment, stationInterval, display).forEach((spec, index) => {
stationSpecs.forEach((spec, index) => {
const row = createRow(
`${spec.modifier ? `is-${spec.modifier}` : ""}${index === 0 ? " is-group-start" : ""}`,
spec.label,
spec.unit,
);
// 값이 없는 측점(절토고/성토고 중 한쪽)도 빈 칸을 만들어야 세로 구분선이 끊기지 않는다.
alignment.stations.forEach((station, stationIndex) => {
alignment.stations.forEach((_, stationIndex) => {
// 구조물 측점 열은 기본값을 비운다 — 격자(빈 셀)만 남기고 값은 선택 오버레이가 맡는다.
const structural = isNearChainage(station.chainage_m, structureChainageList);
const structural = isStructural[stationIndex];
const cell = element(
"span",
`b05-profile-table__cell${structural ? " is-structure" : ""}`,