260209_01_ENH: 테이블에 단위 텍스트 추가, 하단 설명 추가

This commit is contained in:
2026-02-09 16:28:29 +09:00
parent b7282bd07d
commit 6e6120f205
21 changed files with 249 additions and 173 deletions

View File

@@ -1,12 +1,12 @@
import {ChartData, DataColumn, DataTable, HorizontalBar, LeftChartTable, SignStyle} from "@/components/lge-dashboard";
import {BannerKey, ServerBannerRow} from "@/types/lg";
import {formatRowLabel, wrapSampleRow} from "@/lib/lg-dashboard";
import {formatRowLabel, isGapRow, wrapSampleRow} from "@/lib/lg-dashboard";
import {useEffect, useMemo} from "react";
import {
BANNER_GROUP,
BANNER_KEY_MAP,
GRID_Y_NOT_PADDING,
SAMPLE_SIZE_NOTICE, SITE_TITLE,
SITE_TITLE,
} from "@/const/lgConst";
import {parseNumber} from "@/lib/utils";
import {
@@ -27,7 +27,7 @@ type SectionSpec = {
/** 3개 섹션(테이블)도 여기서만 선언 */
const SECTIONS: SectionSpec[] = [
{ title: "가구 형태", groupKeys: ["lifeStage", "household", "age"] },
{ title: "거주 형태", groupKeys: ["tenure", "housing", "pyeong"] },
{ title: "거주 형태", groupKeys: ["occupancy", "housing", "houseSize"] },
{ title: "거주 지역 및 소득 수준", groupKeys: ["region", "income"] },
];
@@ -105,7 +105,7 @@ const BannerSummary = ({ data, useChart, useYear }: BannerSummaryProps) => {
};
const signStyleGap: SignStyle<ServerBannerRow> = {
rowSelector: (row) => row.rowLabel === "gap",
rowSelector: (row) => isGapRow(row.rowLabel),
display: "arrow",
arrowWithNumber: true,
paint: "text",
@@ -121,7 +121,12 @@ const BannerSummary = ({ data, useChart, useYear }: BannerSummaryProps) => {
const columns = buildColumns(spec, useYear? filterValue.year : "");
// rows가 spec마다 다르면 여기서 가져오도록 구성
const rows = wrapSampleRow(useYear? data.filter((d) => d.year === filterValue.year) : data);
const rows =
wrapSampleRow(useYear? data.filter((d) => d.year === filterValue.year) : data)
.map((row) => {
row.rowLabel = formatRowLabel(row.rowLabel);
return row
})
const chartData = buildChartData(rows, bannerKeys);
return {
@@ -197,7 +202,6 @@ const BannerSummary = ({ data, useChart, useYear }: BannerSummaryProps) => {
starUnder30Sample={true}
/>
}
<div className="float-right content-text-sm">{SAMPLE_SIZE_NOTICE}</div>
</div>
);
})}