Merge branch 'iipbs/common/main' into iipbs/sn/ii
This commit is contained in:
@@ -118,15 +118,21 @@ export default function LineBarchart({
|
||||
if (!isFinite(maxValue) || maxValue <= 0) {
|
||||
return { max: 0, ticks: [0] };
|
||||
}
|
||||
|
||||
|
||||
const exponent = Math.floor(Math.log10(maxValue));
|
||||
const base = Math.pow(10, exponent);
|
||||
const fraction = maxValue / base;
|
||||
|
||||
let niceFraction: number;
|
||||
if (fraction <= 1) niceFraction = 1;
|
||||
else if (fraction <= 2) niceFraction = 3;
|
||||
else if (fraction <= 2) niceFraction = 2;
|
||||
else if (fraction <= 3) niceFraction = 3;
|
||||
else if (fraction <= 4) niceFraction = 4;
|
||||
else if (fraction <= 5) niceFraction = 5;
|
||||
else if (fraction <= 6) niceFraction = 6;
|
||||
else if (fraction <= 7) niceFraction = 7;
|
||||
else if (fraction <= 8) niceFraction = 8;
|
||||
else if (fraction <= 9) niceFraction = 9;
|
||||
else niceFraction = 10;
|
||||
|
||||
const niceMax = niceFraction * base; // round up to 1/2/5 * 10^k
|
||||
@@ -164,7 +170,7 @@ export default function LineBarchart({
|
||||
return (
|
||||
<text
|
||||
x={x - padding} // 맨 좌측 바깥
|
||||
y={y + height / 2} // 수직 중앙
|
||||
y={y + height / 2 - 12} // 수직 중앙
|
||||
textAnchor="middle"
|
||||
transform={`rotate(-90, ${x - padding}, ${y + height / 2})`}
|
||||
className="text-[12px] font-bold"
|
||||
@@ -195,12 +201,12 @@ export default function LineBarchart({
|
||||
</div>
|
||||
) : null}
|
||||
<div className="h-[calc(100%-42px)] w-[calc(100%-40px)] ">
|
||||
<ChartContainer config={chartConfig ?? {}} className="h-full w-full">
|
||||
<ChartContainer config={chartConfig ?? {}} className="h-full w-[100%] ml-5">
|
||||
<ComposedChart
|
||||
data={chartData}
|
||||
height={graphSize * 7.5}
|
||||
width={graphSize * 12.5}
|
||||
margin={{ top: 5, right: 30, left: 20, bottom: 5 }}
|
||||
margin={{ top: 5, right: 20, left: 30, bottom: 5 }}
|
||||
>
|
||||
<CartesianGrid strokeDasharray="3 3" />
|
||||
{setXAxisYearTick?
|
||||
@@ -210,7 +216,7 @@ export default function LineBarchart({
|
||||
{/* 왼쪽 Y축: lineVal */}
|
||||
{yFieldText && <YAxis
|
||||
yAxisId="left"
|
||||
className="text-[12px] font-bold"
|
||||
className="text-[12px] font-bold"
|
||||
tickFormatter={(value) =>
|
||||
typeof value === "number" ? value.toLocaleString() : value
|
||||
}
|
||||
@@ -218,7 +224,6 @@ export default function LineBarchart({
|
||||
ticks={leftScale.ticks}
|
||||
orientation="left"
|
||||
label={(props) => <CustomAxisText {...props} fieldText={yFieldText} position="left" />}
|
||||
|
||||
/>}
|
||||
{/* 오른쪽 Y축: barVal */}
|
||||
{yFieldText2 && <YAxis
|
||||
|
||||
@@ -316,11 +316,7 @@ function Gis({
|
||||
)}
|
||||
{/* SearchView가 존재할 때만 렌더링 */}
|
||||
{SearchView && (
|
||||
<SearchView
|
||||
open={isSearchModalOpen}
|
||||
onOpenChange={setIsSearchModalOpen}
|
||||
onFeatureSelect={handleFeatureSelect}
|
||||
/>
|
||||
<SearchView />
|
||||
)}
|
||||
{/* 시도/시군구 조회 영역 */}
|
||||
{SearchBar && (
|
||||
|
||||
Reference in New Issue
Block a user