StateTimeline: Comment and metadata cleanup (#112960)

This commit is contained in:
Paul Marbach
2025-10-24 15:04:33 -04:00
committed by GitHub
parent f019d58a99
commit eabb348152
3 changed files with 26 additions and 3 deletions
+19
View File
@@ -485,6 +485,25 @@ module.exports = [
},
},
// dataviz prefers to use `clsx` over `cx` to compose classes as a rule for performance reasons
{
files: ['public/app/plugins/panel/state-timeline/**/*.{ts,tsx}'],
rules: {
'no-restricted-imports': [
'error',
withBaseRestrictedImportsConfig({
patterns: [
{
group: ['@emotion/css'],
importNames: ['cx'],
message: 'Do not use "cx" from @emotion/css. Instead, use `clsx` and compose together only strings.',
},
],
}),
],
},
},
// Old betterer rules config:
{
files: ['**/*.{js,jsx,ts,tsx}'],
@@ -29,9 +29,6 @@ import { containerStyles } from './styles';
interface TimelinePanelProps extends PanelProps<Options> {}
/**
* @alpha
*/
export const StateTimelinePanel = ({
data,
timeRange,
@@ -17,6 +17,13 @@ const paginationStyles = {
}),
};
/**
* a React hook used to encapsulate the rendering and state for pagination in StateTimeline.
* @param frames DataFrames to paginate
* @param perPage number of series per page
* @returns the current frames rendered, the pagination element to render, the height of the pagination element,
* and a paginationRev which GraphNG uses to trigger re-renders.
*/
export function usePagination(frames?: DataFrame[], perPage?: number) {
const [currentPage, setCurrentPage] = useState(1);