module.tsx 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. // Libraries
  2. import _ from 'lodash';
  3. import React, { PureComponent } from 'react';
  4. // Components
  5. import Graph from 'app/viz/Graph';
  6. import { getTimeSeriesVMs } from 'app/viz/state/timeSeries';
  7. import { Switch } from 'app/core/components/Switch/Switch';
  8. // Types
  9. import { PanelProps, NullValueMode } from 'app/types';
  10. interface Options {
  11. showBars: boolean;
  12. }
  13. interface Props extends PanelProps {
  14. options: Options;
  15. }
  16. export class Graph2 extends PureComponent<Props> {
  17. constructor(props) {
  18. super(props);
  19. }
  20. render() {
  21. const { timeSeries, timeRange } = this.props;
  22. const vmSeries = getTimeSeriesVMs({
  23. timeSeries: timeSeries,
  24. nullValueMode: NullValueMode.Ignore,
  25. });
  26. return <Graph timeSeries={vmSeries} timeRange={timeRange} />;
  27. }
  28. }
  29. export class TextOptions extends PureComponent<any> {
  30. onChange = () => {};
  31. render() {
  32. return (
  33. <div className="section gf-form-group">
  34. <h5 className="section-heading">Draw Modes</h5>
  35. <Switch label="Lines" checked={true} onChange={this.onChange} />
  36. </div>
  37. );
  38. }
  39. }
  40. export { Graph2 as PanelComponent, TextOptions as PanelOptions };