ES6 Plato on Github
Report Home
Summary Display
components/Instrument/InstrumentMonochromatorWidget.js
Maintainability
84.43
Lines of code
38
Difficulty
13.42
Estimated Errors
0.22
Function weight
By Complexity
By SLOC
import React from 'react'; import { Panel, Grid, Row, Col } from 'react-bootstrap'; import { getDatasetParameterByName, getDatasetParameterByPrefixName } from '../../helpers/DatasetHelper.js'; class InstrumentMonochromatorWidget extends React.Component { constructor(props) { super(props); } getParameter(parameterName){ return getDatasetParameterByName(this.props.dataset, parameterName); } render(){ var monochromatorParameters = getDatasetParameterByPrefixName(this.props.dataset, "InstrumentMonochromator"); return <div className="container-fluid"> <h3>Monochromator</h3> <div className="row"> <div className="col-sm-2"> <table className="table table-condensed"> <tbody> <tr><td>Energy</td><td>{getDatasetParameterByName(this.props.dataset, "InstrumentMonochromator_energy")}</td></tr> <tr><td>Wavelength</td><td>{getDatasetParameterByName(this.props.dataset, "InstrumentMonochromator_wavelength")}</td></tr> <tr><td>d_spacing</td><td>{getDatasetParameterByName(this.props.dataset, "InstrumentMonochromatorCrystal_d_spacing")}</td></tr> <tr><td>Reflection</td><td>{getDatasetParameterByName(this.props.dataset, "InstrumentMonochromatorCrystal_reflection")}</td></tr> <tr><td>Type</td><td>{getDatasetParameterByName(this.props.dataset, "InstrumentMonochromatorCrystal_type")}</td></tr> <tr><td>Usage</td><td>{getDatasetParameterByName(this.props.dataset, "InstrumentMonochromatorCrystal_usage")}</td></tr> </tbody> </table> </div> </div> </div>; } } export default InstrumentMonochromatorWidget;