/* ============================================================================= * common_util_svg.ts * SVG 도면 렌더러가 공유하는 최소 유틸리티 — 요소 생성·텍스트·측점 표기. * * B06 종·횡단 렌더러가 쓰던 것을 유토곡선 모듈 공용화(2026-08-03)에 맞춰 옮겼다. * B05 계획 유토곡선과 B06 정식 유토곡선이 **같은 표기 규칙**을 쓰게 하는 것이 목적이며, * B06 쪽은 `_UI_Section_Common`이 그대로 재수출해 기존 임포트 경로를 유지한다. * ========================================================================== */ import { currentLanguageIndex, ui_locales } from "@ui/ui_template_locale"; export const SVG_NS = "http://www.w3.org/2000/svg"; export function L(key: keyof typeof ui_locales): string { return ui_locales[key][currentLanguageIndex]; } export function svgElement( tag: K, attributes: Record = {}, ): SVGElementTagNameMap[K] { const element = document.createElementNS(SVG_NS, tag); Object.entries(attributes).forEach(([key, value]) => element.setAttribute(key, String(value))); return element; } export function svgText( value: string, attributes: Record, ): SVGTextElement { const text = svgElement("text", attributes); text.textContent = value; return text; } export { inferStationInterval, stationLabel } from "./common_util_station";