diff --git a/public/app/plugins/panel/flamegraph/components/FlameGraphContainer.test.tsx b/public/app/plugins/panel/flamegraph/components/FlameGraphContainer.test.tsx
index f39ff0c5fb3..c3f5dc8f397 100644
--- a/public/app/plugins/panel/flamegraph/components/FlameGraphContainer.test.tsx
+++ b/public/app/plugins/panel/flamegraph/components/FlameGraphContainer.test.tsx
@@ -39,11 +39,11 @@ describe('FlameGraphContainer', () => {
it('should update search when row selected in top table', async () => {
render();
- await userEvent.click((await screen.findAllByRole('row'))[1]);
+ await userEvent.click((await screen.findAllByTitle('Highlight symbol'))[0]);
expect(screen.getByDisplayValue('net/http.HandlerFunc.ServeHTTP')).toBeInTheDocument();
- await userEvent.click(screen.getAllByRole('row')[2]);
+ await userEvent.click((await screen.findAllByTitle('Highlight symbol'))[1]);
expect(screen.getByDisplayValue('total')).toBeInTheDocument();
- await userEvent.click(screen.getAllByRole('row')[2]);
+ await userEvent.click((await screen.findAllByTitle('Highlight symbol'))[1]);
expect(screen.queryByDisplayValue('total')).not.toBeInTheDocument();
});
diff --git a/public/app/plugins/panel/flamegraph/components/FlameGraphHeader.tsx b/public/app/plugins/panel/flamegraph/components/FlameGraphHeader.tsx
index c539e8f1ecf..8b062c10bef 100644
--- a/public/app/plugins/panel/flamegraph/components/FlameGraphHeader.tsx
+++ b/public/app/plugins/panel/flamegraph/components/FlameGraphHeader.tsx
@@ -39,6 +39,7 @@ const FlameGraphHeader = ({
{ value: SelectedView.TopTable, label: 'Top Table', description: 'Only show top table' },
{ value: SelectedView.FlameGraph, label: 'Flame Graph', description: 'Only show flame graph' },
];
+
if (containerWidth >= MIN_WIDTH_TO_SHOW_BOTH_TOPTABLE_AND_FLAMEGRAPH) {
viewOptions.push({
value: SelectedView.Both,
@@ -47,6 +48,14 @@ const FlameGraphHeader = ({
});
}
+ const onResetView = () => {
+ setTopLevelIndex(0);
+ setSelectedBarIndex(0);
+ setRangeMin(0);
+ setRangeMax(1);
+ setSearch('');
+ };
+
return (
@@ -57,22 +66,11 @@ const FlameGraphHeader = ({
setSearch(v.currentTarget.value);
}}
placeholder={'Search..'}
- width={24}
+ width={44}
/>
-
diff --git a/public/app/plugins/panel/flamegraph/components/TopTable/FlameGraphTopTable.tsx b/public/app/plugins/panel/flamegraph/components/TopTable/FlameGraphTopTable.tsx
deleted file mode 100644
index ddbfb006c1d..00000000000
--- a/public/app/plugins/panel/flamegraph/components/TopTable/FlameGraphTopTable.tsx
+++ /dev/null
@@ -1,265 +0,0 @@
-import { css, cx } from '@emotion/css';
-import React, { CSSProperties, useCallback, useMemo } from 'react';
-import { SortByFn, useSortBy, useAbsoluteLayout, useTable, CellProps } from 'react-table';
-import { FixedSizeList } from 'react-window';
-
-import { GrafanaTheme2 } from '@grafana/data';
-import { Icon, useStyles2, CustomScrollbar } from '@grafana/ui';
-
-import { TOP_TABLE_COLUMN_WIDTH } from '../../constants';
-import { ColumnTypes, TopTableData, TopTableValue } from '../types';
-
-type Props = {
- width: number;
- height: number;
- data: TopTableData[];
- search: string;
- setSearch: (search: string) => void;
- setTopLevelIndex: (level: number) => void;
- setSelectedBarIndex: (bar: number) => void;
- setRangeMin: (range: number) => void;
- setRangeMax: (range: number) => void;
-};
-
-const FlameGraphTopTable = ({
- width,
- height,
- data,
- search,
- setSearch,
- setTopLevelIndex,
- setSelectedBarIndex,
- setRangeMin,
- setRangeMax,
-}: Props) => {
- const styles = useStyles2((theme) => getStyles(theme));
-
- const sortSymbols: SortByFn