GraphPanel.tsx 980 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. // Libraries
  2. import _ from 'lodash';
  3. import React, { PureComponent } from 'react';
  4. // Components
  5. import Graph from 'app/viz/Graph';
  6. // Services & Utils
  7. import { getTimeSeriesVMs } from 'app/viz/state/timeSeries';
  8. // Types
  9. import { PanelProps, NullValueMode } from '@grafana/ui';
  10. import { Options } from './types';
  11. interface Props extends PanelProps<Options> {}
  12. export class GraphPanel extends PureComponent<Props> {
  13. constructor(props) {
  14. super(props);
  15. }
  16. render() {
  17. const { timeSeries, timeRange, width, height } = this.props;
  18. const { showLines, showBars, showPoints } = this.props.options;
  19. const vmSeries = getTimeSeriesVMs({
  20. timeSeries: timeSeries,
  21. nullValueMode: NullValueMode.Ignore,
  22. });
  23. return (
  24. <Graph
  25. timeSeries={vmSeries}
  26. timeRange={timeRange}
  27. showLines={showLines}
  28. showPoints={showPoints}
  29. showBars={showBars}
  30. width={width}
  31. height={height}
  32. />
  33. );
  34. }
  35. }