module.tsx 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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>
  34. <div className="section gf-form-group">
  35. <h5 className="page-heading">Draw Modes</h5>
  36. <Switch label="Lines" labelClass="width-5" checked={true} onChange={this.onChange} />
  37. <Switch label="Bars" labelClass="width-5" checked={false} onChange={this.onChange} />
  38. <Switch label="Points" labelClass="width-5" checked={false} onChange={this.onChange} />
  39. </div>
  40. <div className="section gf-form-group">
  41. <h5 className="page-heading">Modes Options</h5>
  42. <Switch label="Lines" labelClass="width-5" checked={true} onChange={this.onChange} />
  43. <Switch label="Bars" labelClass="width-5" checked={false} onChange={this.onChange} />
  44. <Switch label="Points" labelClass="width-5" checked={false} onChange={this.onChange} />
  45. </div>
  46. </div>
  47. );
  48. }
  49. }
  50. export { Graph2 as PanelComponent, TextOptions as PanelOptions };