The open and composable observability and data visualization platform. Visualize metrics, logs, and traces from multiple sources like Prometheus, Loki, Elasticsearch, InfluxDB, Postgres and many more.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
grafana/public/app/plugins/panel/nodeGraph/NodeGraphPanel.tsx

34 lines
948 B

import memoizeOne from 'memoize-one';
import React, { useId } from 'react';
import { PanelProps } from '@grafana/data';
import { useLinks } from '../../../features/explore/utils/links';
import { NodeGraph } from './NodeGraph';
import { NodeGraphOptions } from './types';
import { getNodeGraphDataFrames } from './utils';
export const NodeGraphPanel = ({ width, height, data, options }: PanelProps<NodeGraphOptions>) => {
const getLinks = useLinks(data.timeRange);
const panelId = useId();
if (!data || !data.series.length) {
return (
<div className="panel-empty">
<p>No data found in response</p>
</div>
);
}
const memoizedGetNodeGraphDataFrames = memoizeOne(getNodeGraphDataFrames);
return (
<div style={{ width, height }}>
<NodeGraph
dataFrames={memoizedGetNodeGraphDataFrames(data.series, options)}
getLinks={getLinks}
panelId={panelId}
/>
</div>
);
};