<commit_before>import React from "react";
import Component from "../pure-render-component";

export default class BiddingPeriod extends Component{
  render(){
    return (
        <section>
          <h4 className="page-header">Bidding period</h4>
        </section>
    )
  }
}<commit_msg>OCVN-27 Implemented box and whiskers plot for bid period<commit_after>import React from "react";
import Component from "../pure-render-component";
import {Chart, Bar} from "react-d3-shape";
import XAxis from "react-d3-core/lib/axis/xaxis";
import XGrid from "react-d3-core/lib/grid/xgrid";
import BoxPlot from "react-boxplot";

var ensurePos = maybePos => maybePos >= 0 ? maybePos : 0;

class BoxAndWhiskers extends Component{
  render(){
    var boxPlotHeight = 25;
    var {data, width, height, margins} = this.props;
    var {max, median, min, q1, q3} = data;
    var translateY = (height - margins.top - margins.bottom - boxPlotHeight ) / 2;
    return (
        <g transform={`translate(0, ${translateY})`}>
          <BoxPlot
              width={ensurePos(width - margins.left - margins.right)}
              height={boxPlotHeight}
              orientation="horizontal"
              min={min - 50}
              max={max + 50}
              stats={{
                whiskerLow: min,
                quartile1: q1,
                quartile2: median,
                quartile3: q3,
                whiskerHigh: max
            }}
          />
        </g>
    )
  }
}

export default class BiddingPeriod extends Component{
  render(){
    var {data} = this.props;
    return (
        <section>
          <h4 className="page-header">Bidding period</h4>
          <Chart
              width= {this.props.width}
              height= {350}
              data={data}
              xDomain={[data.min-50, data.max + 50]}
              xScale="linear"
              yDomain={[0]}
          >
            <BoxAndWhiskers
                key={0}
                data={data}
            />
            <XGrid/>
            <XAxis/>
          </Chart>
        </section>
    )
  }
}
{'fraction_non_alphanumeric': 0.12318840579710146, 'fraction_numerical': 0.016908212560386472, 'mean_word_length': 1.743046357615894, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7646036', 'n_tokens_mistral': 631, 'n_tokens_neox': 595, 'n_words': 148}