<commit_before>// eslint-disable-next-line no-unused-vars
import style from './style.less';

const POPUP_WIDTH = 300;
const POPUP_HEIGHT = 75;

class DonutPopup extends React.Component {
  render() {
    const { x, y, points } = this.props;
    const { v: value, label } = points[0];
    const left = x - (POPUP_WIDTH / 2) + 30;
    const top = y - POPUP_HEIGHT - 12;
    return (
      <div
        className="crd-popup donut-popup text-center"
        style={{
          width: POPUP_WIDTH,
          height: POPUP_HEIGHT,
          left,
          top,
          color: 'white'
        }}
      >
        {label.replace('$#$', value.toFixed(2))}
        <div className="arrow" />
      </div>
    )
  }
}

export default DonutPopup;<commit_msg>OCE-405 Formatting value only when required and fixed replace<commit_after>// eslint-disable-next-line no-unused-vars
import style from './style.less';

const POPUP_WIDTH = 300;
const POPUP_HEIGHT = 75;

class DonutPopup extends React.Component {
  render() {
    const { x, y, points } = this.props;
    const { v: value, label } = points[0];
    const left = x - (POPUP_WIDTH / 2) + 30;
    const top = y - POPUP_HEIGHT - 12;
    const formattedValue = Math.round(value) === value ?
      value :
      value.toFixed(2);
    return (
      <div
        className="crd-popup donut-popup text-center"
        style={{
          width: POPUP_WIDTH,
          height: POPUP_HEIGHT,
          left,
          top,
          color: 'white'
        }}
      >
        {label.replace(/\$\#\$/g, formattedValue)}
        <div className="arrow" />
      </div>
    )
  }
}

export default DonutPopup;
{'fraction_non_alphanumeric': 0.13178767541183647, 'fraction_numerical': 0.01647345942647956, 'mean_word_length': 2.0711610486891385, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '6201567', 'n_tokens_mistral': 570, 'n_tokens_neox': 541, 'n_words': 135}