Skip to content

Commit

Permalink
feat: beforeResetZoom 시 초기 xmin, xmax 지정
Browse files Browse the repository at this point in the history
  • Loading branch information
yoopark committed Dec 5, 2023
1 parent bae24c4 commit 0d392a7
Show file tree
Hide file tree
Showing 7 changed files with 63 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,14 @@ const ScoreRecordsPerCoalitionChart = ({
},
};
},
beforeResetZoom: (ctx) => {
return {
xaxis: {
min: subMonths(new Date(), 8).getTime(),
max: ctx.maxX,
},
};
},
},
},
xaxis: {
Expand Down
8 changes: 8 additions & 0 deletions app/src/Home/dashboard-contents/Eval/EvalCountRecords.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,14 @@ const EvalCountRecordsChart = ({ series }: EvalCountRecordsChartProps) => {
},
};
},
beforeResetZoom: (ctx) => {
return {
xaxis: {
min: subDays(new Date(), 18).getTime(),
max: ctx.maxX,
},
};
},
},
},
xaxis: {
Expand Down
8 changes: 8 additions & 0 deletions app/src/Home/dashboard-contents/Team/TeamCloseRecords.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,14 @@ const EvalCountRecordsChart = ({ series }: EvalCountRecordsChartProps) => {
},
};
},
beforeResetZoom: (ctx) => {
return {
xaxis: {
min: subDays(new Date(), 18).getTime(),
max: ctx.maxX,
},
};
},
},
},
xaxis: {
Expand Down
10 changes: 9 additions & 1 deletion app/src/Home/dashboard-contents/User/AliveUserCountRecords.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import {
DashboardContentNotFound,
} from '@shared/components/DashboardContentView/Error';
import { InfoTooltip } from '@shared/components/InfoTooltip';
import { numberWithUnitFormatter } from '@shared/utils/formatters/numberWithUnitFormatter';
import { MILLISECONDS } from '@shared/constants/date';
import { numberWithUnitFormatter } from '@shared/utils/formatters/numberWithUnitFormatter';

const GET_DAILY_ALIVE_USER_COUNT_RECORDS = gql(/* GraphQL */ `
query GetDailyAliveUserCountRecords($last: Int!) {
Expand Down Expand Up @@ -102,6 +102,14 @@ const ActiveUserCountRecordsChart = ({
},
};
},
beforeResetZoom: (ctx) => {
return {
xaxis: {
min: subDays(new Date(), 18).getTime(),
max: ctx.maxX,
},
};
},
},
},
xaxis: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,14 @@ const BlackholedCountRecordsChart = ({
},
};
},
beforeResetZoom: (ctx) => {
return {
xaxis: {
min: subMonths(new Date(), 12).getTime(),
max: ctx.maxX,
},
};
},
},
},
xaxis: {
Expand Down
11 changes: 11 additions & 0 deletions app/src/Profile/dashboard-contents/Eval/CountRecords.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,17 @@ const CountRecordsChart = ({ series }: CountRecordsChartProps) => {
},
};
},
beforeResetZoom: (ctx) => {
return {
xaxis: {
min: Math.max(
beginAt.getTime(),
subMonths(new Date(), 12).getTime(),
),
max: ctx.maxX,
},
};
},
},
},
xaxis: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,17 @@ const LogtimeRecordsChart = ({ series }: LogtimeRecordsChartProps) => {
},
};
},
beforeResetZoom: (ctx) => {
return {
xaxis: {
min: Math.max(
beginAt.getTime(),
subMonths(new Date(), 12).getTime(),
),
max: ctx.maxX,
},
};
},
},
},
xaxis: {
Expand Down

0 comments on commit 0d392a7

Please sign in to comment.