@rcsb/rcsb-saguaro-app
Version:
RCSB 1D Saguaro Web App
15 lines (14 loc) • 1.34 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.HistogramChartComponent = void 0;
const jsx_runtime_1 = require("react/jsx-runtime");
const AbsractChartComponent_1 = require("./AbsractChartComponent");
const ChartComponent_1 = require("@rcsb/rcsb-charts/lib/RcsbChartComponent/ChartComponent");
const HistogramChartDataProvider_1 = require("@rcsb/rcsb-charts/lib/RcsbChartDataProvider/HistogramChartDataProvider");
const ChartJsHistogramComponent_1 = require("@rcsb/rcsb-charts/lib/RcsbChartImplementations/ChatJsImplementations/ChartJsHistogramComponent");
class HistogramChartComponent extends AbsractChartComponent_1.AbstractChartComponent {
render() {
return ((0, jsx_runtime_1.jsx)(ChartComponent_1.ChartComponent, { data: this.state.data.map(d => d.map(d => { var _a, _b; return (Object.assign(Object.assign({}, d), { label: (parseFloat(d.label.toString()) + ((_b = (_a = this.props.chartConfig) === null || _a === void 0 ? void 0 : _a.histogramBinIncrement) !== null && _b !== void 0 ? _b : 0) * 0.5) })); })), chartComponentImplementation: ChartJsHistogramComponent_1.ChartJsHistogramComponent, dataProvider: new HistogramChartDataProvider_1.HistogramChartDataProvider(), chartConfig: this.props.chartConfig }));
}
}
exports.HistogramChartComponent = HistogramChartComponent;