260330_02_ENH: 연도별 사례수 row에서 Column으로 이동
This commit is contained in:
@@ -517,12 +517,16 @@ function colToLetters(col: number) {
|
||||
*/
|
||||
export function buildHeader_ProductKeyMap(
|
||||
productKeyMap: Record<string, string>,
|
||||
sampleHeadKey? :string,
|
||||
rowHeadKey = "rowLabel"
|
||||
): HeaderBlock {
|
||||
const entries = typedEntries(productKeyMap);
|
||||
|
||||
const headerRow: HeaderCell[] = [
|
||||
{ text: "", styleKey: "header", align: "center" },
|
||||
...(sampleHeadKey
|
||||
? [{ text: "사례수", styleKey: "header", align: "center" } as const]
|
||||
: []),
|
||||
...entries.map(([, label]) => ({
|
||||
text: String(label),
|
||||
styleKey: "header" as const,
|
||||
@@ -530,7 +534,8 @@ export function buildHeader_ProductKeyMap(
|
||||
})),
|
||||
];
|
||||
|
||||
const leafKeys = [rowHeadKey, ...entries.map(([k]) => String(k))];
|
||||
|
||||
const leafKeys = [rowHeadKey, ...(sampleHeadKey? [sampleHeadKey]: []), ...entries.map(([k]) => String(k))];
|
||||
return { headerRows: [headerRow], leafKeys, totalCols: headerRow.length };
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user