<commit_before>import React from 'react';
import Grid from '@mui/material/Grid';
import Typography from '@mui/material/Typography';

import Paper from '@mui/material/Paper';

import { useSelector } from 'react-redux';

import { RootState } from '../../../../store';

import HistoryEffort from './HistoryEffort';

const Charts = () => {
  const initiativeHistory = useSelector(
    (state: RootState) => state.initiatives.initiativeHistory,
  );
  const defaultPoints = useSelector(
    (state: RootState) => state.global.defaultPoints,
  );
  const metric = !defaultPoints ? 'issues' : 'points';

  if (initiativeHistory.length === 0) {
    return null;
  }

  const historyMetrics = initiativeHistory.sort(
    (a: any, b: any) =>
      new Date(a.updatedAt).getTime() - new Date(b.updatedAt).getTime(),
  );

  return (
    <React.Fragment>
      <Grid container spacing={3} direction="column">
        <Grid item xs={12}>
          <Paper>
            <Typography variant="subtitle1"><commit_msg>Fixed an issue loading chart<commit_after>import React from 'react';
import Grid from '@mui/material/Grid';
import Typography from '@mui/material/Typography';

import Paper from '@mui/material/Paper';

import { useSelector } from 'react-redux';

import { RootState } from '../../../../store';

import HistoryEffort from './HistoryEffort';

const Charts = () => {
  const initiativeHistory = useSelector(
    (state: RootState) => state.initiatives.initiativeHistory,
  );
  const defaultPoints = useSelector(
    (state: RootState) => state.global.defaultPoints,
  );
  const metric = !defaultPoints ? 'issues' : 'points';

  if (initiativeHistory.length === 0 || initiativeHistory === false) {
    return null;
  }

  const historyMetrics = initiativeHistory.sort(
    (a: any, b: any) =>
      new Date(a.updatedAt).getTime() - new Date(b.updatedAt).getTime(),
  );

  return (
    <React.Fragment>
      <Grid container spacing={3} direction="column">
        <Grid item xs={12}>
          <Paper>
            <Typography variant="subtitle1">
{'fraction_non_alphanumeric': 0.14921722113502936, 'fraction_numerical': 0.004892367906066536, 'mean_word_length': 3.514348785871965, 'pattern_counts': {'":': 0, '<': 13, '<?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': '6808909', 'n_tokens_mistral': 623, 'n_tokens_neox': 608, 'n_words': 155}