ES6 Plato on Github
Report Home
Summary Display
components/ManagerStats/DataVolumeManagerStats/VolumePanel.js
Maintainability
73.32
Lines of code
95
Difficulty
16.52
Estimated Errors
0.43
Function weight
By Complexity
By SLOC
import React from 'react'; import PropTypes from 'prop-types'; import { Panel, Grid, Row, Col } from 'react-bootstrap'; import { FlexibleXYPlot, GradientDefs, DiscreteColorLegend, AreaSeries, VerticalRectSeries, MarkSeriesCanvas, XYPlot, LineSeriesCanvas, VerticalBarSeries, VerticalGridLines, HorizontalGridLines, XAxis, YAxis } from 'react-vis'; class VolumePanel extends React.Component { getLegend() { return [ { title: 'Data volume released', color: 'green' }, { title: 'Data volume produced', color: 'blue' } ]; }; render() { if (this.props.fetching){ return null; } return <Grid fluid> <Row> <Col sm={12} md={this.props.showTable ? 6 : 12}> <FlexibleXYPlot height={400} //yType="log" xType="time" margin={{ left: 100 }} > <XAxis tickLabelAngle={-45} style={{ fontSize: '9px' }} /> <YAxis tickLabelAngle={-45} tickFormat={(t, i) => { return t; }} title={this.props.yTitle} /> <HorizontalGridLines /> <VerticalGridLines /> <LineSeriesCanvas colorType="literal" color="blue" opacity={1} data={this.props.median} /> <AreaSeries colorType="literal" opacity={0.7} color="blue" data={this.props.sum} /> <AreaSeries colorType="literal" opacity={0.7} color="green" data={this.props.releaseSum} /> <AreaSeries colorType="literal" opacity={0.2} color="green" data={this.props.releaseSumAcc} /> <AreaSeries colorType="literal" opacity={0.2} color="blue" data={this.props.sumAcc} /> <DiscreteColorLegend orientation="horizontal" width={300} items={this.getLegend()} /> </FlexibleXYPlot> </Col> </Row> </Grid>; } } VolumePanel.propTypes = { /** the error message itself */ message: PropTypes.string.isRequired, /* the type of the message */ type: PropTypes.string.isRequired, }; export default VolumePanel;