diff --git a/packages/grafana-flamegraph/README.md b/packages/grafana-flamegraph/README.md index 5a0df9974c7..9bd09dfc6c6 100644 --- a/packages/grafana-flamegraph/README.md +++ b/packages/grafana-flamegraph/README.md @@ -26,17 +26,18 @@ import { Flamegraph } from '@grafana/flamegraph'; #### Props -| Name | Type | Description | -| ------------------- | ------------------------ | --------------------------------------------------------------------------------------------------------------------------- | -| data | DataFrame | DataFrame with the profile data. Optional, if missing or empty the flamegraph is not rendered | -| stickyHeader | boolean | Whether the header should be sticky and be always visible on the top when scrolling. | -| getTheme | () => GrafanaTheme2 | Provides a theme for the visualization on which colors and some sizes are based. | -| onTableSymbolClick | (symbol: string) => void | Interaction hook that can be used to report on the interaction. Fires when user click on a name in the table. | -| onViewSelected | (view: string) => void | Interaction hook that can be used to report on the interaction. Fires when user changes the view to show (table/graph/both) | -| onTextAlignSelected | (align: string) => void | Interaction hook that can be used to report on the interaction. Fires when user changes the text align. | -| onTableSort | (sort: string) => void | Interaction hook that can be used to report on the interaction. Fires when user changes the teble sorting. | -| extraHeaderElements | React.ReactNode | Elements that will be shown in the header on the right side of the header buttons. Useful for additional functionality. | -| vertical | boolean | If true the flamegraph will be rendered on top of the table. | +| Name | Type | Description | +| --------------------- | ------------------------ | --------------------------------------------------------------------------------------------------------------------------- | +| data | DataFrame | DataFrame with the profile data. Optional, if missing or empty the flamegraph is not rendered | +| stickyHeader | boolean | Whether the header should be sticky and be always visible on the top when scrolling. | +| getTheme | () => GrafanaTheme2 | Provides a theme for the visualization on which colors and some sizes are based. | +| onTableSymbolClick | (symbol: string) => void | Interaction hook that can be used to report on the interaction. Fires when user click on a name in the table. | +| onViewSelected | (view: string) => void | Interaction hook that can be used to report on the interaction. Fires when user changes the view to show (table/graph/both) | +| onTextAlignSelected | (align: string) => void | Interaction hook that can be used to report on the interaction. Fires when user changes the text align. | +| onTableSort | (sort: string) => void | Interaction hook that can be used to report on the interaction. Fires when user changes the teble sorting. | +| extraHeaderElements | React.ReactNode | Elements that will be shown in the header on the right side of the header buttons. Useful for additional functionality. | +| vertical | boolean | If true the flamegraph will be rendered on top of the table. | +| keepFocusOnDataChange | boolean | If true any focused block will stay focused when the profile data changes. Same for the sandwich view. | ##### DataFrame schema diff --git a/packages/grafana-flamegraph/src/FlameGraph/FlameGraph.tsx b/packages/grafana-flamegraph/src/FlameGraph/FlameGraph.tsx index ffd8c88d4f9..a6c78f8bbeb 100644 --- a/packages/grafana-flamegraph/src/FlameGraph/FlameGraph.tsx +++ b/packages/grafana-flamegraph/src/FlameGraph/FlameGraph.tsx @@ -136,40 +136,46 @@ const FlameGraph = ({ search, selectedView, }; - const canvas = levelsCallers ? ( - <> -