<commit_before>import React from 'react';
// import rd3 from 'react-d3';
import { PieChart } from 'react-d3';

export default class HeaderNavBar extends React.Component {
  constructor(props) {
    super(props);
    this.props.getEmotions();
  }
  
  render() {
    const pieData = [
      { label: 'anger', value: Math.floor(this.props.emotions.anger * 100) },
      { label: 'disgust', value: Math.floor(this.props.emotions.disgust * 100) },
      { label: 'fear', value: Math.floor(this.props.emotions.fear * 100) },
      { label: 'joy', value: Math.floor(this.props.emotions.joy * 100) },
      { label: 'sadness', value: Math.floor(this.props.emotions.sadness * 100) },<commit_msg>React D3 PieChart fix<commit_after>import React from 'react';
// import rd3 from 'react-d3';
import { PieChart } from 'react-d3';

export default class HeaderNavBar extends React.Component {
  constructor(props) {
    super(props);
    this.props.getEmotions();
  }

  render() {
    if (!this.props.emotions.anger) {
      return <div></div>;
    }
    const pieData = [
      { label: 'anger', value: Math.floor(this.props.emotions.anger * 100) },
      { label: 'disgust', value: Math.floor(this.props.emotions.disgust * 100) },
      { label: 'fear', value: Math.floor(this.props.emotions.fear * 100) },
      { label: 'joy', value: Math.floor(this.props.emotions.joy * 100) },
      { label: 'sadness', value: Math.floor(this.props.emotions.sadness * 100) },
{'fraction_non_alphanumeric': 0.16413793103448276, 'fraction_numerical': 0.025517241379310347, 'mean_word_length': 3.423780487804878, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '5272588', 'n_tokens_mistral': 542, 'n_tokens_neox': 491, 'n_words': 105}