grafana/public/app/plugins/panel/nodeGraph/NodeGraphPanel.tsx
Josh Hunt 3c6e0e8ef8
Chore: ESlint import order (#44959)
* Add and configure eslint-plugin-import

* Fix the lint:ts npm command

* Autofix + prettier all the files

* Manually fix remaining files

* Move jquery code in jest-setup to external file to safely reorder imports

* Resolve issue caused by circular dependencies within Prometheus

* Update .betterer.results

* Fix missing // @ts-ignore

* ignore iconBundle.ts

* Fix missing // @ts-ignore
2022-04-22 14:33:13 +01:00

29 lines
850 B
TypeScript

import memoizeOne from 'memoize-one';
import React from 'react';
import { PanelProps } from '@grafana/data';
import { useLinks } from '../../../features/explore/utils/links';
import { NodeGraph } from './NodeGraph';
import { Options } from './types';
import { getNodeGraphDataFrames } from './utils';
export const NodeGraphPanel: React.FunctionComponent<PanelProps<Options>> = ({ width, height, data }) => {
const getLinks = useLinks(data.timeRange);
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)} getLinks={getLinks} />
</div>
);
};