260312_01_ENH: API_DECIMAL_POINT, VIEW_DECIMAL_POINT 적용, 스택 차트 색상 변경, 그룹 스택 차트 하단에 연도 레이블 출력, Total 페이지 설명문 수정
This commit is contained in:
@@ -7,7 +7,7 @@ import {BannerRow, CategoryResolvedField, StatisticsRequest} from "@/types/lg";
|
||||
import {useDebouncedValue} from "@/hooks/useDebouncedValue";
|
||||
import {CategoryFilterValue} from "@/components/layout/CategoryFilter";
|
||||
import {buildCategoryFilter, buildPageModeConfig} from "@/lib/lg-dashboard";
|
||||
import {BANNER_GROUP_KEY, USE_CACHE} from "@/const/lgConst";
|
||||
import {BANNER_GROUP_KEY, API_DECIMAL_POINT, USE_CACHE} from "@/const/lgConst";
|
||||
import Profile from "./category-page/Profile";
|
||||
import PenetrationChange from "./category-page/PenetrationChange";
|
||||
import CategoryDetail from "./category-page/CategoryDetail";
|
||||
@@ -42,7 +42,7 @@ const CategoryPage = () => {
|
||||
variableIdMap,
|
||||
bannerIdList: BANNER_GROUP_KEY,
|
||||
filterCondition: buildCategoryFilter(debouncedFilterValue),
|
||||
option: { useCache: USE_CACHE, lastYear: false, decimalPoint: 0 },
|
||||
option: { useCache: USE_CACHE, lastYear: false, decimalPoint: API_DECIMAL_POINT },
|
||||
};
|
||||
}, [variableIdMap, debouncedFilterValue]);
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ import {
|
||||
} from "@/components/lge-dashboard";
|
||||
import {
|
||||
CHART_COLOR_BY_YEAR,
|
||||
CHART_FOCUS_COLOR_BY_YEAR,
|
||||
CHART_FOCUS_COLOR_BY_YEAR, API_DECIMAL_POINT,
|
||||
LIFE_STAGE_COLUMNS,
|
||||
LIFE_STAGE_GROUPS,
|
||||
PRODUCT_KEY_MAP,
|
||||
@@ -48,7 +48,7 @@ const LGPenetrationPage = () => {
|
||||
variableIdMap: {penetration: "KQA1", penetration_lg: "KQA3_3_LG"},
|
||||
bannerIdList: ["product"],
|
||||
filterCondition: normalizeFilterCondition(debouncedFilterValue),
|
||||
option: {useCache: USE_CACHE, lastYear: false, decimalPoint: 0},
|
||||
option: {useCache: USE_CACHE, lastYear: false, decimalPoint: API_DECIMAL_POINT },
|
||||
};
|
||||
}, [debouncedFilterValue]);
|
||||
|
||||
@@ -59,7 +59,7 @@ const LGPenetrationPage = () => {
|
||||
variableIdMap: {lifestage_lg: "KQA3_3_LG"},
|
||||
bannerIdList: ["product|lifeStage"],
|
||||
filterCondition: normalizeFilterCondition(filter),
|
||||
option: {useCache: USE_CACHE, lastYear: true, decimalPoint: 0},
|
||||
option: {useCache: USE_CACHE, lastYear: true, decimalPoint: API_DECIMAL_POINT },
|
||||
};
|
||||
}, [debouncedFilterValue]);
|
||||
|
||||
@@ -181,6 +181,8 @@ const LGPenetrationPage = () => {
|
||||
"KLIFEstAGE#4": lifeStageData[`${key}|KLIFEstAGE#4`] ?? "",
|
||||
"KLIFEstAGE#5": lifeStageData[`${key}|KLIFEstAGE#5`] ?? "",
|
||||
"KLIFEstAGE#6": lifeStageData[`${key}|KLIFEstAGE#6`] ?? "",
|
||||
"KLIFEstAGE#7": lifeStageData[`${key}|KLIFEstAGE#7`] ?? "",
|
||||
"KLIFEstAGE#8": lifeStageData[`${key}|KLIFEstAGE#8`] ?? "",
|
||||
};
|
||||
});
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
import {useEffect, useMemo} from "react";
|
||||
import {
|
||||
CHART_COLOR_BY_YEAR, CHART_FOCUS_COLOR_BY_YEAR,
|
||||
CHART_COLOR_BY_YEAR, CHART_FOCUS_COLOR_BY_YEAR, API_DECIMAL_POINT,
|
||||
PRODUCT_KEY_MAP,
|
||||
PRODUCT_KEYS,
|
||||
SITE_TITLE, USE_CACHE,
|
||||
@@ -39,7 +39,7 @@ const LGPurchasePage = () => {
|
||||
variableIdMap: {purchase: "KQB0", purchase_lg: "KQX3_3_LG"},
|
||||
bannerIdList: ["product"],
|
||||
filterCondition: normalizeFilterCondition(debouncedFilterValue),
|
||||
option: {useCache: USE_CACHE, lastYear: false, decimalPoint: 0},
|
||||
option: {useCache: USE_CACHE, lastYear: false, decimalPoint: API_DECIMAL_POINT },
|
||||
};
|
||||
}, [debouncedFilterValue]);
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ import {
|
||||
PRODUCTS,
|
||||
YEARS,
|
||||
AXIS_HIDE_STYLE,
|
||||
GRID_X_NOT_PADDING, PRODUCT_KEY_MAP, SITE_TITLE, USE_CACHE
|
||||
GRID_X_NOT_PADDING, PRODUCT_KEY_MAP, SITE_TITLE, USE_CACHE, API_DECIMAL_POINT
|
||||
} from "@/const/lgConst";
|
||||
import {
|
||||
calcCagrRow, calcGapProductRow,
|
||||
@@ -37,19 +37,12 @@ const PenetrationPage = () => {
|
||||
const debouncedFilterValue = useDebouncedValue<SelectedMap>(filterValue as SelectedMap, 500);
|
||||
const [isBrandShare, setIsBrandShare] = useState(false);
|
||||
|
||||
const chartColorByYear = Object.fromEntries(
|
||||
YEARS.map((year, i) => [
|
||||
year,
|
||||
[`--chart-cbrand-${i + 1}`,`--chart-samsung-${i + 1}`,`--chart-lg-${i + 1}`],
|
||||
])
|
||||
) as Record<(typeof YEARS)[number], string[]>;
|
||||
|
||||
const req = useMemo<StatisticsRequest>(() => {
|
||||
return {
|
||||
variableIdMap: { penetration: "KQA1", penetration_brand: "KQA3_3_NET" },
|
||||
bannerIdList: ["product"],
|
||||
filterCondition: normalizeFilterCondition(debouncedFilterValue),
|
||||
option: { useCache: USE_CACHE, lastYear: false, decimalPoint: 0 },
|
||||
option: { useCache: USE_CACHE, lastYear: false, decimalPoint: API_DECIMAL_POINT },
|
||||
};
|
||||
}, [debouncedFilterValue]);
|
||||
|
||||
@@ -175,11 +168,11 @@ const PenetrationPage = () => {
|
||||
isBrandShare ? (
|
||||
<GroupedStackBar
|
||||
data={brandShareChartData}
|
||||
grid={{ ...GRID_X_NOT_PADDING, top: 60 }}
|
||||
grid={{...GRID_X_NOT_PADDING, bottom: 20}}
|
||||
xAxis={{ type: "category", data: PRODUCTS, ...AXIS_HIDE_STYLE }}
|
||||
yAxis={{ type: "value", ...AXIS_HIDE_STYLE }}
|
||||
showFocusLabel={"none"}
|
||||
yearBrandPalette={chartColorByYear}
|
||||
yearBrandPalette={["--chart-lg","--chart-samsung","--chart-cbrand"]}
|
||||
height={260}
|
||||
/>
|
||||
) : (
|
||||
|
||||
@@ -7,7 +7,7 @@ import {
|
||||
AXIS_HIDE_STYLE,
|
||||
GRID_X_NOT_PADDING,
|
||||
PRODUCT_KEY_MAP,
|
||||
SITE_TITLE, USE_CACHE
|
||||
SITE_TITLE, USE_CACHE, API_DECIMAL_POINT
|
||||
} from "@/const/lgConst";
|
||||
import {
|
||||
BottomDescription,
|
||||
@@ -34,7 +34,7 @@ const PurchasePage = () => {
|
||||
variableIdMap: { purchase: "KQB0"},
|
||||
bannerIdList: ["product"],
|
||||
filterCondition: normalizeFilterCondition(debouncedFilterValue),
|
||||
option: { useCache: USE_CACHE, lastYear: false, decimalPoint: 0 },
|
||||
option: { useCache: USE_CACHE, lastYear: false, decimalPoint: API_DECIMAL_POINT },
|
||||
};
|
||||
}, [debouncedFilterValue]);
|
||||
|
||||
|
||||
@@ -54,17 +54,6 @@
|
||||
--color-warning: var(--warning);
|
||||
--color-info: var(--info);
|
||||
|
||||
/* Chart */
|
||||
--color-chart-1: var(--chart-1);
|
||||
--color-chart-2: var(--chart-2);
|
||||
--color-chart-3: var(--chart-3);
|
||||
--color-chart-4: var(--chart-4);
|
||||
--color-chart-5: var(--chart-5);
|
||||
--color-chart-6: var(--chart-6);
|
||||
--color-chart-7: var(--chart-7);
|
||||
--color-chart-8: var(--chart-8);
|
||||
--color-chart-9: var(--chart-9);
|
||||
--color-chart-10: var(--chart-10);
|
||||
--color-chart-border: var(--chart-border);
|
||||
|
||||
/* Sidebar (shadcn sidebar 토큰) */
|
||||
@@ -183,26 +172,21 @@
|
||||
--chart-2-t: 0 0% 70%;
|
||||
--chart-3-t: 0 0% 88%;
|
||||
|
||||
--chart-4: var(--lg-pink-400);
|
||||
--chart-5: var(--lg-pink-600);
|
||||
--chart-6: var(--lg-gray-500);
|
||||
--chart-7: var(--lg-gray-600);
|
||||
--chart-8: var(--lg-gray-700);
|
||||
--chart-9: var(--lg-gray-800);
|
||||
--chart-10: var(--lg-gray-900);
|
||||
--chart-stack-1: 334 81% 41%;
|
||||
--chart-stack-2: 334 81% 53%;
|
||||
--chart-stack-3: 334 82% 64%;
|
||||
--chart-stack-4: 335 82% 75%;
|
||||
--chart-stack-5: 335 83% 84%;
|
||||
--chart-stack-6: 17 80% 84%;
|
||||
--chart-stack-7: 17 80% 73%;
|
||||
--chart-stack-8: 0 0% 25%;
|
||||
--chart-stack-9: 0 0% 50%;
|
||||
--chart-stack-10: 0 0% 65%;
|
||||
--chart-stack-11: 0 0% 85%;
|
||||
|
||||
--chart-lg-1: var(--lg-pink-300);
|
||||
--chart-lg-2: var(--lg-red-300);
|
||||
--chart-lg-3: var(--lg-red-600);
|
||||
--chart-total-1: var(--lg-gray-300);
|
||||
--chart-total-2: var(--lg-gray-400);
|
||||
--chart-total-3: var(--lg-gray-700);
|
||||
--chart-cbrand-1: var(--lg-gray-300);
|
||||
--chart-cbrand-2: var(--lg-gray-400);
|
||||
--chart-cbrand-3: var(--lg-gray-700);
|
||||
--chart-samsung-1: var(--samsung-blue-400);
|
||||
--chart-samsung-2: var(--samsung-blue-500);
|
||||
--chart-samsung-3: var(--samsung-blue-600);
|
||||
--chart-lg: var(--chart-1);
|
||||
--chart-samsung: 218 48% 58%;
|
||||
--chart-cbrand: var(--chart-2);
|
||||
|
||||
--chart-border: hsl(0 0% 95%);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user