mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
* remove text alignment, per-box hover for grid, fix mergeValues * unconditionally set spanNulls = -1 * fix stroke width offset math * split multi-hover, so only single mark overlays in grid mode * restore alignValue in state-timeline * better descriptions, maybe * init field.config.custom if necessary * don't show last out-of-view value Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
49 lines
1.1 KiB
TypeScript
Executable File
49 lines
1.1 KiB
TypeScript
Executable File
import React from 'react';
|
|
import { PanelProps } from '@grafana/data';
|
|
import { useTheme2, ZoomPlugin } from '@grafana/ui';
|
|
import { StatusPanelOptions } from './types';
|
|
import { TimelineChart } from '../state-timeline/TimelineChart';
|
|
import { TimelineMode } from '../state-timeline/types';
|
|
|
|
interface TimelinePanelProps extends PanelProps<StatusPanelOptions> {}
|
|
|
|
/**
|
|
* @alpha
|
|
*/
|
|
export const StatusGridPanel: React.FC<TimelinePanelProps> = ({
|
|
data,
|
|
timeRange,
|
|
timeZone,
|
|
options,
|
|
width,
|
|
height,
|
|
onChangeTimeRange,
|
|
}) => {
|
|
const theme = useTheme2();
|
|
|
|
if (!data || !data.series?.length) {
|
|
return (
|
|
<div className="panel-empty">
|
|
<p>No data found in response</p>
|
|
</div>
|
|
);
|
|
}
|
|
|
|
return (
|
|
<TimelineChart
|
|
theme={theme}
|
|
frames={data.series}
|
|
structureRev={data.structureRev}
|
|
timeRange={timeRange}
|
|
timeZone={timeZone}
|
|
width={width}
|
|
height={height}
|
|
{...options}
|
|
// hardcoded
|
|
mode={TimelineMode.Samples}
|
|
>
|
|
{(config) => <ZoomPlugin config={config} onZoom={onChangeTimeRange} />}
|
|
</TimelineChart>
|
|
);
|
|
};
|