From d902e30c10a2e26eaf7b86750df2738733310703 Mon Sep 17 00:00:00 2001 From: kric_jspark Date: Wed, 19 Aug 2026 15:13:00 +0900 Subject: [PATCH 01/12] =?UTF-8?q?260819=5F01=5FENH:=20=EC=82=AC=EC=9D=B4?= =?UTF-8?q?=ED=8A=B8=20=ED=83=80=EC=9D=B4=ED=8B=80=20=ED=8F=B0=ED=8A=B8=20?= =?UTF-8?q?=EC=82=AC=EC=9D=B4=EC=A6=88=20=ED=82=A4=EC=9B=80,=20=EC=B0=A8?= =?UTF-8?q?=ED=8A=B8=20=EB=A0=88=EC=9D=B4=EB=B8=94=20=EA=B0=80=EB=B3=80=20?= =?UTF-8?q?=EC=A4=84=EB=B0=94=EA=BF=88=20=EC=B2=98=EB=A6=AC,=20=EB=84=A4?= =?UTF-8?q?=EB=B9=84=EA=B2=8C=EC=9D=B4=EC=85=98=20=ED=8C=8C=ED=8A=B8=20?= =?UTF-8?q?=EA=B0=80=EB=B3=80=20=EC=A4=84=EB=B0=94=EA=BF=88=20=EC=A0=81?= =?UTF-8?q?=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dashboard/[waveCd]/[partCd]/page.tsx | 73 +++++++++++++------ src/components/app-shell/AppHeader.tsx | 2 +- src/components/layout/KriSidebar.tsx | 2 +- 3 files changed, 53 insertions(+), 24 deletions(-) diff --git a/src/app/(pages)/(main)/dashboard/[waveCd]/[partCd]/page.tsx b/src/app/(pages)/(main)/dashboard/[waveCd]/[partCd]/page.tsx index 4c50fef..17f4111 100644 --- a/src/app/(pages)/(main)/dashboard/[waveCd]/[partCd]/page.tsx +++ b/src/app/(pages)/(main)/dashboard/[waveCd]/[partCd]/page.tsx @@ -2,7 +2,7 @@ import { ChevronDown } from "lucide-react"; import { useParams, useRouter } from "next/navigation"; -import { useEffect, useState } from "react"; +import { useEffect, useRef, useState } from "react"; import { KriBarChart } from "@/components/chart"; import { AppPageTitle } from "@/components/app-shell/AppPageTitle"; import { Badge } from "@/components/ui/badge"; @@ -58,35 +58,64 @@ function buildHiddenCategoryNote(group: ResultGroup): string | null { return `※ ${parts.join(isSingleSeries ? ", " : " | ")}`; } +// x축 카테고리 라벨 폭을 컨테이너 실측 폭 기준으로 계산한다(카테고리당 슬롯 폭에 여유를 둔 값). +// 고정값을 쓰면 화면이 넓을 때는 불필요하게 줄바꿈되고, 좁을 때는 라벨이 겹치는 문제가 생긴다. +const MIN_AXIS_LABEL_WIDTH = 48; + function ResultGroupChart({ group }: { group: ResultGroup }) { const chartData = toChartData(group.categories, group.series); const hasChartData = chartData.categories.length > 0 && chartData.series.length > 0; + const chartWrapperRef = useRef(null); + const [axisLabelWidth, setAxisLabelWidth] = useState(); + + useEffect(() => { + const el = chartWrapperRef.current; + if (!el || chartData.categories.length === 0) return; + + const updateAxisLabelWidth = () => { + const width = (el.clientWidth / chartData.categories.length) * 0.85; + setAxisLabelWidth(Math.max(MIN_AXIS_LABEL_WIDTH, width)); + }; + + updateAxisLabelWidth(); + const observer = new ResizeObserver(updateAxisLabelWidth); + observer.observe(el); + return () => observer.disconnect(); + }, [chartData.categories.length]); if (!hasChartData) return null; return ( - ({ - name: seriesLegendName(item.label, item.baseCount), - data: item.values.map(round1), - color: item.color, - option: { - label: { - show: true, - position: "top", - fontSize: CHART_FONT_SIZE, - formatter: (params: { value: number }) => formatDecimal1(params.value), +
+ ({ + name: seriesLegendName(item.label, item.baseCount), + data: item.values.map(round1), + color: item.color, + option: { + label: { + show: true, + position: "top", + fontSize: CHART_FONT_SIZE, + formatter: (params: { value: number }) => formatDecimal1(params.value), + }, }, - }, - }))} - legend={{ left: 0, top: 0, textStyle: { fontSize: CHART_FONT_SIZE } }} - grid={{ top: 55, right: 25, bottom: 5, left: 0, containLabel: true }} - xAxis={{ axisLabel: { fontSize: CHART_FONT_SIZE, interval: 0 } }} - yAxis={{ min: 0, max: 100, interval: 25, axisLabel: { fontSize: CHART_FONT_SIZE } }} - barMaxWidth={CHART_BAR_MAX_WIDTH} - height={CHART_HEIGHT} - /> + }))} + legend={{ left: 0, top: 0, textStyle: { fontSize: CHART_FONT_SIZE } }} + grid={{ top: 55, right: 25, bottom: 5, left: 0, containLabel: true }} + xAxis={{ + axisLabel: { + fontSize: CHART_FONT_SIZE, + interval: 0, + ...(axisLabelWidth ? { width: axisLabelWidth, overflow: "break" as const } : {}), + }, + }} + yAxis={{ min: 0, max: 100, interval: 25, axisLabel: { fontSize: CHART_FONT_SIZE } }} + barMaxWidth={CHART_BAR_MAX_WIDTH} + height={CHART_HEIGHT} + /> +
); } diff --git a/src/components/app-shell/AppHeader.tsx b/src/components/app-shell/AppHeader.tsx index c3b1ef7..14f8c63 100644 --- a/src/components/app-shell/AppHeader.tsx +++ b/src/components/app-shell/AppHeader.tsx @@ -30,7 +30,7 @@ export function AppHeader({ menuOpen, showMenuButton, activeMenuId, topMenus, us className="h-6 w-auto object-contain brightness-0 invert" priority /> - 2026년 에너지 국민인식조사 + 2026년 에너지 국민인식조사 } menus={topMenus} diff --git a/src/components/layout/KriSidebar.tsx b/src/components/layout/KriSidebar.tsx index d206860..9f22a2f 100644 --- a/src/components/layout/KriSidebar.tsx +++ b/src/components/layout/KriSidebar.tsx @@ -85,7 +85,7 @@ export function KriSidebar({ onClick={() => item.path && onNavigate?.(item.path, item)} > {Icon ? : null} - {item.label} + {item.label} {questionCount}문항 -- 2.49.0.windows.1 From 1d20055f7d3e538df1cbe64a9407f4f825596ad8 Mon Sep 17 00:00:00 2001 From: kric_jspark Date: Wed, 19 Aug 2026 15:49:36 +0900 Subject: [PATCH 02/12] =?UTF-8?q?260819=5F02=5FENH:=20=EC=B0=A8=ED=8A=B8?= =?UTF-8?q?=20=EB=A0=88=EC=9D=B4=EB=B8=94=20=EA=B0=80=EB=B3=80=20=EC=A4=84?= =?UTF-8?q?=EB=B0=94=EA=BF=88=20=EB=8B=A8=EC=96=B4=20=EA=B8=B0=EB=B0=98?= =?UTF-8?q?=EC=9C=BC=EB=A1=9C=20=EC=B2=98=EB=A6=AC=EB=90=98=EA=B2=8C=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dashboard/[waveCd]/[partCd]/page.tsx | 33 ++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/src/app/(pages)/(main)/dashboard/[waveCd]/[partCd]/page.tsx b/src/app/(pages)/(main)/dashboard/[waveCd]/[partCd]/page.tsx index 17f4111..87f7ce7 100644 --- a/src/app/(pages)/(main)/dashboard/[waveCd]/[partCd]/page.tsx +++ b/src/app/(pages)/(main)/dashboard/[waveCd]/[partCd]/page.tsx @@ -62,6 +62,35 @@ function buildHiddenCategoryNote(group: ResultGroup): string | null { // 고정값을 쓰면 화면이 넓을 때는 불필요하게 줄바꿈되고, 좁을 때는 라벨이 겹치는 문제가 생긴다. const MIN_AXIS_LABEL_WIDTH = 48; +// echarts axisLabel의 overflow:'break'는 한글을 알파벳 "단어"로 인식하지 못해 음절 단위로 강제 개행한다 +// (zrender wrapText의 isWordBreakChar가 비알파벳 문자를 전부 break 지점으로 취급함). +// 그래서 공백 기준으로 단어를 유지한 채 줄바꿈 문자열을 직접 만들고, 단어 하나가 라인 폭을 넘을 때만 강제로 자른다. +function wrapLabelByWord(value: string, maxWidth: number, charWidth: number) { + const maxChars = Math.max(1, Math.floor(maxWidth / charWidth)); + const words = value.split(" "); + const lines: string[] = []; + let currentLine = ""; + + for (const word of words) { + const candidate = currentLine ? `${currentLine} ${word}` : word; + + if (candidate.length > maxChars && currentLine) { + lines.push(currentLine); + currentLine = word; + } else { + currentLine = candidate; + } + + while (currentLine.length > maxChars) { + lines.push(currentLine.slice(0, maxChars)); + currentLine = currentLine.slice(maxChars); + } + } + if (currentLine) lines.push(currentLine); + + return lines.join("\n"); +} + function ResultGroupChart({ group }: { group: ResultGroup }) { const chartData = toChartData(group.categories, group.series); const hasChartData = chartData.categories.length > 0 && chartData.series.length > 0; @@ -108,7 +137,9 @@ function ResultGroupChart({ group }: { group: ResultGroup }) { axisLabel: { fontSize: CHART_FONT_SIZE, interval: 0, - ...(axisLabelWidth ? { width: axisLabelWidth, overflow: "break" as const } : {}), + ...(axisLabelWidth + ? { formatter: (value: string) => wrapLabelByWord(value, axisLabelWidth, CHART_FONT_SIZE) } + : {}), }, }} yAxis={{ min: 0, max: 100, interval: 25, axisLabel: { fontSize: CHART_FONT_SIZE } }} -- 2.49.0.windows.1 From 75385bd452d81bf8f87b66ac6f70a7df651972a8 Mon Sep 17 00:00:00 2001 From: kric_jspark Date: Tue, 25 Aug 2026 14:48:49 +0900 Subject: [PATCH 03/12] =?UTF-8?q?260825=5F01=5FENH:=20=EC=B0=A8=ED=8A=B8?= =?UTF-8?q?=20=EB=AC=B8=ED=95=AD=EB=B3=84=20=EC=83=89=EC=83=81=EC=A7=80?= =?UTF-8?q?=EC=A0=95=20=EB=B0=8F=20=EC=B0=A8=ED=8A=B8=20=ED=95=98=EC=9D=B4?= =?UTF-8?q?=EB=9D=BC=EC=9D=B4=ED=8A=B8=20=EB=AA=A8=EB=93=9C=20=EC=A0=81?= =?UTF-8?q?=EC=9A=A9,=20=EB=AC=B8=ED=95=AD=EB=B3=84=20=EC=A0=9C=EB=AA=A9?= =?UTF-8?q?=EA=B3=BC=20=EB=B2=94=EB=A1=80=20=EC=82=AC=EC=9D=B4=EC=97=90=20?= =?UTF-8?q?=EB=AC=B8=ED=95=AD=20=ED=85=8D=EC=8A=A4=ED=8A=B8=20=EC=82=BD?= =?UTF-8?q?=EC=9E=85,=20gap=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dashboard/[waveCd]/[partCd]/page.tsx | 147 ++++++++++++++---- src/components/layout/KriSidebar.tsx | 4 +- src/const/epolicy-dash.const.ts | 11 +- src/lib/chart-utils.ts | 80 +++++++++- src/types/wave.ts | 17 +- 5 files changed, 220 insertions(+), 39 deletions(-) diff --git a/src/app/(pages)/(main)/dashboard/[waveCd]/[partCd]/page.tsx b/src/app/(pages)/(main)/dashboard/[waveCd]/[partCd]/page.tsx index 87f7ce7..26a045c 100644 --- a/src/app/(pages)/(main)/dashboard/[waveCd]/[partCd]/page.tsx +++ b/src/app/(pages)/(main)/dashboard/[waveCd]/[partCd]/page.tsx @@ -3,14 +3,22 @@ import { ChevronDown } from "lucide-react"; import { useParams, useRouter } from "next/navigation"; import { useEffect, useRef, useState } from "react"; +import type { CSSProperties } from "react"; import { KriBarChart } from "@/components/chart"; import { AppPageTitle } from "@/components/app-shell/AppPageTitle"; import { Badge } from "@/components/ui/badge"; import { Button } from "@/components/ui/button"; import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "@/components/ui/table"; -import { CHART_BAR_MAX_WIDTH, CHART_FONT_SIZE, CHART_HEIGHT } from "@/const/epolicy-dash.const"; +import { + CHART_BAR_MAX_WIDTH, + CHART_FONT_SIZE, + CHART_GAP_MARKER_BG_COLOR, + CHART_GAP_MARKER_TEXT_COLOR, + CHART_HEIGHT, + SUBITEM_NEGATIVE_COLOR, +} from "@/const/epolicy-dash.const"; import { cn } from "@/lib/utils"; -import { toChartData } from "@/lib/chart-utils"; +import { getGapPoints, getHighlightedIndexes, toChartData } from "@/lib/chart-utils"; import { formatDecimal1, formatThousands, round1 } from "@/lib/format"; import { isSessionInvalid, resolveApiErrorMessage } from "@/lib/api-error-message"; import { usePartDetailQuery } from "@/query/waves"; @@ -26,6 +34,17 @@ function findAudienceColor(item: Item): string | undefined { return undefined; } +// 서브 탭 hover 배경처럼 색상에 알파를 입힌 은은한 톤이 필요한 곳에서 사용한다. +function hexToRgba(hex: string, alpha: number): string { + const normalized = hex.replace("#", ""); + const isShorthand = normalized.length === 3; + const r = parseInt(isShorthand ? normalized[0] + normalized[0] : normalized.slice(0, 2), 16); + const g = parseInt(isShorthand ? normalized[1] + normalized[1] : normalized.slice(2, 4), 16); + const b = parseInt(isShorthand ? normalized[2] + normalized[2] : normalized.slice(4, 6), 16); + if ([r, g, b].some((channel) => Number.isNaN(channel))) return hex; + return `rgba(${r}, ${g}, ${b}, ${alpha})`; +} + function seriesLegendName(label: string, baseCount: number | null) { return baseCount === null ? label : `${label} (N=${formatThousands(baseCount)})`; } @@ -118,19 +137,59 @@ function ResultGroupChart({ group }: { group: ResultGroup }) {
({ - name: seriesLegendName(item.label, item.baseCount), - data: item.values.map(round1), - color: item.color, - option: { - label: { - show: true, - position: "top", - fontSize: CHART_FONT_SIZE, - formatter: (params: { value: number }) => formatDecimal1(params.value), + series={chartData.series.map((item) => { + const highlightedIndexes = item.chartHighlightMode ? getHighlightedIndexes(group.categories, item) : []; + const gapPoints = getGapPoints(group.categories, item); + + return { + name: seriesLegendName(item.label, item.baseCount), + data: item.values.map((value, index) => + highlightedIndexes.includes(index) && item.chartHighlightColor + ? { value: round1(value), itemStyle: { color: item.chartHighlightColor } } + : round1(value), + ), + color: item.color, + option: { + label: { + show: true, + position: "top", + fontSize: CHART_FONT_SIZE, + formatter: (params: { value: number }) => formatDecimal1(params.value), + }, + ...(gapPoints.length + ? { + markPoint: { + // 점 마커 없이, 라운딩된 사각형 배경을 가진 라벨 자체를 도형처럼 사용한다. + symbol: "circle", + symbolSize: 0, + label: { + show: true, + position: "top", + // 막대 자체의 값 라벨(position:"top")과 겹치지 않도록 그 위로 띄운다. + distance: 15, + color: CHART_GAP_MARKER_TEXT_COLOR, + backgroundColor: CHART_GAP_MARKER_BG_COLOR, + borderRadius: 20, + padding: [10, 10, 7, 10], + fontWeight: "bold", + fontSize: CHART_FONT_SIZE, + formatter: ({ value }: { value: number }) => + `${value >= 0 ? "▲" : "▼"} ${formatDecimal1(Math.abs(value))}%p`, + }, + // ALL: 현재 막대 바로 위. LAST_VISIBLE: 직전 막대와의 중간 지점(두 막대 사이)에 표시한다. + data: gapPoints.map(({ index, previousIndex, value, previousValue, gap }) => ({ + coord: + item.chartGapMode === "LAST_VISIBLE" + ? [(index + previousIndex) / 2, Math.max(value, previousValue)] + : [index, value], + value: gap, + })), + }, + } + : {}), }, - }, - }))} + }; + })} legend={{ left: 0, top: 0, textStyle: { fontSize: CHART_FONT_SIZE } }} grid={{ top: 55, right: 25, bottom: 5, left: 0, containLabel: true }} xAxis={{ @@ -195,6 +254,8 @@ function ItemCard({ item }: { item: Item }) { const hasSubItems = item.resultGroups.some((group) => group.subItem !== null); const activeGroup = item.resultGroups[activeGroupIndex] ?? item.resultGroups[0]; const hiddenCategoryNote = activeGroup ? buildHiddenCategoryNote(activeGroup) : null; + // subItem 코멘트가 있으면 그것을 우선 표시하고, 없으면 문항 공통 코멘트로 대체한다. + const activeComment = activeGroup?.subItem?.partItemSubComment || item.comment || null; return (
@@ -217,22 +278,46 @@ function ItemCard({ item }: { item: Item }) {
- {hasSubItems ? ( -
-
- {item.resultGroups.map((group, index) => ( - - ))} + {hasSubItems || activeComment ? ( +
+
+ {activeComment ?

{activeComment}

: null}
+ {hasSubItems ? ( +
+ {item.resultGroups.map((group, index) => { + const isActive = index === activeGroupIndex; + const isNegativeSubItem = group.subItem?.partItemSubCd === 2; + + return ( + + ); + })} +
+ ) : null}
) : null} @@ -247,8 +332,6 @@ function ItemCard({ item }: { item: Item }) { ) : null}
) : null} - - {item.comment ?

{item.comment}

: null}
); } @@ -281,7 +364,7 @@ export default function PartDetailPage() { } return ( -
+
{data.items.map((item) => ( diff --git a/src/components/layout/KriSidebar.tsx b/src/components/layout/KriSidebar.tsx index 9f22a2f..e532699 100644 --- a/src/components/layout/KriSidebar.tsx +++ b/src/components/layout/KriSidebar.tsx @@ -36,7 +36,7 @@ export function KriSidebar({
- + {activeComment && +

{activeComment}

+ } {hasSubItems || activeComment ? (
-
- {activeComment ?

{activeComment}

: null} -
{hasSubItems ? (
{item.resultGroups.map((group, index) => { -- 2.49.0.windows.1 From bcf4b258b2d7ef05a33c731687487a29eabde87f Mon Sep 17 00:00:00 2001 From: kric_jspark Date: Tue, 25 Aug 2026 16:43:10 +0900 Subject: [PATCH 06/12] =?UTF-8?q?260825=5F04=5FENH:=20=EC=B0=A8=ED=8A=B8?= =?UTF-8?q?=20=EC=83=89=EC=83=81=EC=9D=84=20t=5Fsurvey=20=EC=A2=85?= =?UTF-8?q?=EC=86=8D=EC=A0=81=EC=9C=BC=EB=A1=9C=20=EB=B3=80=EA=B2=BD=20?= =?UTF-8?q?=EB=B0=8F=20=ED=9B=84=EC=86=8D=EC=B2=98=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dashboard/[waveCd]/[partCd]/page.tsx | 53 ++++++++++------- src/lib/chart-utils.ts | 57 ++++++++++++++----- src/types/wave.ts | 12 +++- 3 files changed, 85 insertions(+), 37 deletions(-) diff --git a/src/app/(pages)/(main)/dashboard/[waveCd]/[partCd]/page.tsx b/src/app/(pages)/(main)/dashboard/[waveCd]/[partCd]/page.tsx index c868dee..86c7fe0 100644 --- a/src/app/(pages)/(main)/dashboard/[waveCd]/[partCd]/page.tsx +++ b/src/app/(pages)/(main)/dashboard/[waveCd]/[partCd]/page.tsx @@ -18,7 +18,7 @@ import { SUBITEM_NEGATIVE_COLOR, } from "@/const/epolicy-dash.const"; import { cn } from "@/lib/utils"; -import { getGapPoints, getHighlightedIndexes, toChartData } from "@/lib/chart-utils"; +import { getGapPoints, getHighlightedIndexes, isNegativeCategory, toChartData } from "@/lib/chart-utils"; import { formatDecimal1, formatThousands, round1 } from "@/lib/format"; import { isSessionInvalid, resolveApiErrorMessage } from "@/lib/api-error-message"; import { usePartDetailQuery } from "@/query/waves"; @@ -110,8 +110,11 @@ function wrapLabelByWord(value: string, maxWidth: number, charWidth: number) { return lines.join("\n"); } -function ResultGroupChart({ group }: { group: ResultGroup }) { +function ResultGroupChart({ group, item }: { group: ResultGroup; item: Item }) { const chartData = toChartData(group.categories, group.series); + const visibleCategories = group.categories.filter((category) => category.chartVisible); + const negativeMode = group.subItem === null ? item.negativeMode : group.subItem.negativeMode; + const negativeOrder = group.subItem === null ? item.negativeOrder : group.subItem.negativeOrder; const hasChartData = chartData.categories.length > 0 && chartData.series.length > 0; const chartWrapperRef = useRef(null); const [axisLabelWidth, setAxisLabelWidth] = useState(); @@ -137,18 +140,29 @@ function ResultGroupChart({ group }: { group: ResultGroup }) {
{ - const highlightedIndexes = item.chartHighlightMode ? getHighlightedIndexes(group.categories, item) : []; - const gapPoints = getGapPoints(group.categories, item); + series={chartData.series.map((series) => { + const highlightedIndexes = series.chartHighlightMode + ? getHighlightedIndexes(group.categories, series) + : []; + const gapPoints = getGapPoints(group.categories, series); return { - name: seriesLegendName(item.label, item.baseCount), - data: item.values.map((value, index) => - highlightedIndexes.includes(index) && item.chartHighlightColor - ? { value: round1(value), itemStyle: { color: item.chartHighlightColor } } - : round1(value), - ), - color: item.color, + name: seriesLegendName(series.label, series.baseCount), + data: series.values.map((value, index) => { + const category = visibleCategories[index]; + const isNegative = category ? isNegativeCategory(negativeMode, negativeOrder, category) : false; + const isHighlighted = highlightedIndexes.includes(index); + const color = isNegative + ? isHighlighted + ? series.negativeHighlightColor + : series.negativeColor + : isHighlighted + ? series.highlightColor + : series.color; + + return { value: round1(value), itemStyle: { color } }; + }), + color: negativeMode === "NEGATIVE" ? series.negativeColor : series.color, option: { label: { show: true, @@ -166,7 +180,7 @@ function ResultGroupChart({ group }: { group: ResultGroup }) { show: true, position: "top", // 막대 자체의 값 라벨(position:"top")과 겹치지 않도록 그 위로 띄운다. - distance: 15, + distance: 30, color: CHART_GAP_MARKER_TEXT_COLOR, backgroundColor: CHART_GAP_MARKER_BG_COLOR, borderRadius: 20, @@ -176,12 +190,9 @@ function ResultGroupChart({ group }: { group: ResultGroup }) { formatter: ({ value }: { value: number }) => `${value >= 0 ? "▲" : "▼"} ${formatDecimal1(Math.abs(value))}%p`, }, - // ALL: 현재 막대 바로 위. LAST_VISIBLE: 직전 막대와의 중간 지점(두 막대 사이)에 표시한다. - data: gapPoints.map(({ index, previousIndex, value, previousValue, gap }) => ({ - coord: - item.chartGapMode === "LAST_VISIBLE" - ? [(index + previousIndex) / 2, Math.max(value, previousValue)] - : [index, value], + // ALL: 각 현재 막대 위치. LAST_VISIBLE: 마지막 표시 막대 위치에 표시한다. + data: gapPoints.map(({ index, value, gap }) => ({ + coord: [index, value], value: gap, })), }, @@ -286,7 +297,7 @@ function ItemCard({ item }: { item: Item }) {
{item.resultGroups.map((group, index) => { const isActive = index === activeGroupIndex; - const isNegativeSubItem = group.subItem?.partItemSubCd === 2; + const isNegativeSubItem = group.subItem?.negativeMode === "NEGATIVE"; return (