<commit_before>import React from "react";
import {connect} from "react-redux";
import Radium from "radium";
import {populateConversationStatsStore} from "../../actions";
import _ from "lodash";
import Spinner from "../framework/spinner";
import Flex from "../framework/flex";
import NumberCards from "./conversation-stats-number-cards";
import Votes from "./conversation-stats-votes-timescale";
import VotesDistribution from "./conversation-stats-vote-distribution";
import CommentsTimescale from "./conversation-stats-comments-timescale";
import CommentersVoters from "./conversation-stats-commenters-voters";
import StarsSpinner from "../framework/stars-spinner";

const style = {
  chartCard: {
    backgroundColor: "rgb(253,253,253)",
    marginBottom: 14,
    borderRadius: 3,
    padding: 10,
    WebkitBoxShadow: "3px 3px 6px -1px rgba(220,220,220,1)",
    BoxShadow: "3px 3px 6px -1px rgba(220,220,220,1)",
  },
};

@connect((state) => state.stats)
@Radium
class ConversationStats extends React.Component {
  constructor(props) {
    super(props);
    this.state = {

    };
  }
  static propTypes = {
    dispatch: React.PropTypes.func,
    params: React.PropTypes.object,
    conversation_stats: React.PropTypes.object,
  }
  static defaultProps = {
    style: {
      backgroundColor: "orange",
      color: "white"
    }
  }
  loadStats() {
    this.props.dispatch(
      populateConversationStatsStore(this.props.params.conversation_id)
    );
  }
  componentWillMount() {
    this.getStatsRepeatedly = setInterval(()=>{
      this.loadStats();
    }, 10000);
  }
  componentDidMount() {
  }
  componentWillUnmount() {
    clearInterval(this.getStatsRepeatedly);
  }
  createCharts(data) {<commit_msg>trigger initial load stats immediately<commit_after>import React from "react";
import {connect} from "react-redux";
import Radium from "radium";
import {populateConversationStatsStore} from "../../actions";
import _ from "lodash";
import Spinner from "../framework/spinner";
import Flex from "../framework/flex";
import NumberCards from "./conversation-stats-number-cards";
import Votes from "./conversation-stats-votes-timescale";
import VotesDistribution from "./conversation-stats-vote-distribution";
import CommentsTimescale from "./conversation-stats-comments-timescale";
import CommentersVoters from "./conversation-stats-commenters-voters";
import StarsSpinner from "../framework/stars-spinner";

const style = {
  chartCard: {
    backgroundColor: "rgb(253,253,253)",
    marginBottom: 14,
    borderRadius: 3,
    padding: 10,
    WebkitBoxShadow: "3px 3px 6px -1px rgba(220,220,220,1)",
    BoxShadow: "3px 3px 6px -1px rgba(220,220,220,1)",
  },
};

@connect((state) => state.stats)
@Radium
class ConversationStats extends React.Component {
  constructor(props) {
    super(props);
    this.state = {

    };
  }
  static propTypes = {
    dispatch: React.PropTypes.func,
    params: React.PropTypes.object,
    conversation_stats: React.PropTypes.object,
  }
  static defaultProps = {
    style: {
      backgroundColor: "orange",
      color: "white"
    }
  }
  loadStats() {
    this.props.dispatch(
      populateConversationStatsStore(this.props.params.conversation_id)
    );
  }
  componentWillMount() {
    this.loadStats();
    this.getStatsRepeatedly = setInterval(()=>{
      this.loadStats();
    }, 10000);
  }
  componentDidMount() {
  }
  componentWillUnmount() {
    clearInterval(this.getStatsRepeatedly);
  }
  createCharts(data) {
{'fraction_non_alphanumeric': 0.13525179856115108, 'fraction_numerical': 0.027050359712230215, 'mean_word_length': 3.972818311874106, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '4888929', 'n_tokens_mistral': 1162, 'n_tokens_neox': 1077, 'n_words': 227}