text: import * as React from "react";
  import styled from "@alethio/ui/lib/styled-components";
  import { BarChartItem } from "./BarChartItem";
  const BarChartRoot = styled("div") `
      display: flex;
      overflow: hidden;
      height: ${({ height }) => height}px;
      align-items: flex-end;
      justify-content: center;
      padding: 16px 0 20px 0;
  `;
  export class BarChart extends React.Component {
      getMaxValue() {
          return this.props.data.reduce((acc, dataItem) => Math.max(acc, !dataItem.value ? 0 : dataItem.value), 0);
      }
      render() {
          let maxValue = this.getMaxValue();
          return (React.createElement(BarChartRoot, { height: this.props.height, innerRef: (r) => {
                  if (this.props.innerRef) {
                      this.props.innerRef(r);
                  }
              } }, this.props.data.map((d, i) => React.createElement(BarChartItem, { key: d.key, value: d.value ? Math.floor(d.value / maxValue * 100) : 0, maxHeight: this.props.height, link: this.props.linkThunk ? this.props.linkThunk(d) : "", tooltip: this.props.tooltipThunk ? this.props.tooltipThunk(d) : null, active: this.props.activeThunk ? this.props.activeThunk(d) : false }))));
      }
  }
  //# sourceMappingURL=BarChart.js.map