Skip to content

Commit 79c94e2

Browse files
committed
[#12240] Set heatmap as default
1 parent 8147baa commit 79c94e2

File tree

4 files changed

+3
-35
lines changed

4 files changed

+3
-35
lines changed

web-frontend/src/main/v3/packages/ui/src/atoms/serverMap.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,4 @@ export const currentServerAgentIdAtom = atom<string | undefined>((get) => {
7070

7171
export const realtimeDateRanage = atom<{ from: Date; to: Date } | undefined>(undefined);
7272

73-
export const serverMapChartTypeAtom = atom<'scatter' | 'heatmap'>(
74-
window?.localStorage?.getItem(EXPERIMENTAL_CONFIG_KEYS.ENABLE_HEATMAP) ? 'heatmap' : 'scatter',
75-
);
73+
export const serverMapChartTypeAtom = atom<'scatter' | 'heatmap'>('heatmap');

web-frontend/src/main/v3/packages/ui/src/components/ServerMap/ChartTypeButtons.tsx

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,12 @@
1-
import React from 'react';
2-
import { useAtom, useAtomValue } from 'jotai';
1+
import { useAtom } from 'jotai';
32
import { Button } from '..';
4-
import { configurationAtom, serverMapChartTypeAtom } from '@pinpoint-fe/ui/src/atoms';
5-
import { useLocalStorage } from '@pinpoint-fe/ui/src/hooks';
6-
import { EXPERIMENTAL_CONFIG_KEYS } from '@pinpoint-fe/ui/src/constants';
3+
import { serverMapChartTypeAtom } from '@pinpoint-fe/ui/src/atoms';
74
import { PiChartScatterBold } from 'react-icons/pi';
85
import { AiOutlineTable } from 'react-icons/ai';
96

107
export const ChartTypeButtons = () => {
11-
const configuration = useAtomValue(configurationAtom);
12-
const [enableHeatmap] = useLocalStorage(
13-
EXPERIMENTAL_CONFIG_KEYS.ENABLE_HEATMAP,
14-
!!configuration?.['experimental.enableHeatmap.value'],
15-
);
16-
178
const [chartType, setChartType] = useAtom(serverMapChartTypeAtom);
189

19-
React.useEffect(() => {
20-
if (!enableHeatmap) {
21-
setChartType('scatter');
22-
}
23-
}, [enableHeatmap]);
24-
25-
if (!enableHeatmap) {
26-
return null;
27-
}
28-
2910
return (
3011
<div>
3112
<Button

web-frontend/src/main/v3/packages/ui/src/constants/ExperimentalConfigKeys.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,4 @@ export enum EXPERIMENTAL_CONFIG_KEYS {
55
// UPDATE_SERVER_MAP_LAYOUT_MANUALLY = 'updateServerMapLayoutManually',
66
// USE_SCATTER_CHART_V2 = 'useScatterChartV2',
77
USE_STATISTICS_AGENT_STATE = 'statisticsAgentState',
8-
ENABLE_HEATMAP = 'enableHeatmap',
98
}

web-frontend/src/main/v3/packages/ui/src/hooks/utility/useExperimentals.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,6 @@ export const useExperimentals = (initialValue?: Configuration) => {
1111
EXPERIMENTAL_CONFIG_KEYS.USE_STATISTICS_AGENT_STATE,
1212
!!initialValue?.['experimental.useStatisticsAgentState.value'],
1313
);
14-
const [enableHeatmap, setEnableHeatmap] = useLocalStorage(
15-
EXPERIMENTAL_CONFIG_KEYS.ENABLE_HEATMAP,
16-
!!initialValue?.['experimental.enableHeatmap.value'],
17-
);
1814

1915
useUpdateEffect(() => {
2016
enableServerMapRealTime ??
@@ -25,7 +21,6 @@ export const useExperimentals = (initialValue?: Configuration) => {
2521
setUseStatisticsAgentState(
2622
initialValue?.['experimental.useStatisticsAgentState.value'] || false,
2723
);
28-
enableHeatmap ?? setEnableHeatmap(initialValue?.['experimental.enableHeatmap.value'] || false);
2924
}, [initialValue]);
3025

3126
const experimentalMap = {
@@ -39,11 +34,6 @@ export const useExperimentals = (initialValue?: Configuration) => {
3934
value: useStatisticsAgentState,
4035
setter: setUseStatisticsAgentState,
4136
},
42-
[EXPERIMENTAL_CONFIG_KEYS.ENABLE_HEATMAP]: {
43-
description: initialValue?.['experimental.enableHeatmap.description'],
44-
value: enableHeatmap,
45-
setter: setEnableHeatmap,
46-
},
4737
};
4838

4939
return experimentalMap;

0 commit comments

Comments
 (0)