Skip to content

Commit a4b90fd

Browse files
committed
Fix bug of HC historical results not showing top 20/30 (#91)
Signed-off-by: Tyler Ohlsen <[email protected]>
1 parent b52598d commit a4b90fd

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

public/pages/AnomalyCharts/containers/AnomalyHeatmapChart.tsx

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,13 +230,22 @@ export const AnomalyHeatmapChart = React.memo(
230230
};
231231

232232
// Custom hook to refresh all of the heatmap data when running a historical task
233+
//
234+
// TODO: this hook is actually getting updated more often than just when there
235+
// is a change to the props.detectorTaskProgress. This is due to a remounting
236+
// issue that is triggering this after every AnomaliesChart re-render. More details here:
237+
// https://github.com/opensearch-project/anomaly-detection-dashboards-plugin/issues/90
233238
useEffect(() => {
234239
if (props.isHistorical) {
235240
const updateHeatmapPlotData = getAnomaliesHeatmapData(
236241
props.anomalies,
237242
props.dateRange,
238243
sortByFieldValue,
239-
get(COMBINED_OPTIONS.options[0], 'value')
244+
get(
245+
currentViewOptions[0],
246+
'value',
247+
get(COMBINED_OPTIONS.options[0], 'value')
248+
)
240249
);
241250
setOriginalHeatmapData(updateHeatmapPlotData);
242251
setHeatmapData(updateHeatmapPlotData);

0 commit comments

Comments
 (0)