<commit_before>import React from 'react'
import PropTypes from 'prop-types'
import { translate } from 'react-i18next'
import { get } from 'lodash'

import Counter from '../counter'
import Percent from '../percent'

import Chart from './chart'

// import { DoughnutChart } from '../CatalogCharts'

const Statistics = ({ metrics, t }) => {
  const openness = get(metrics, 'datasets.partitions.openness.yes', 0)
  const download = get(metrics, 'datasets.partitions.download.yes', 0)

  return (
    <div className='container'>
      <div className='block'>
        <h3>
          {t('details.statistics.recordsCount')}
        </h3>
        <Counter
          size='medium'
          value={metrics.records.totalCount}
        />
      </div>

      <div className='block'>
        <h3>
          {t('details.statistics.openDataPercent')}
        </h3>
        <Percent
          value={openness}
          total={metrics.datasets.totalCount}
          size='medium'
        />
      </div>

      <div className='block'>
        <h3>
          {t('details.statistics.downloadablePercent')}
        </h3>
        <Percent
          value={download}
          total={metrics.datasets.totalCount}
          size='medium'
        />
      </div>

      <div className='block'>
        <h3>
          {t('details.statistics.recordTypeChart')}
        </h3>
        <div>
          <Chart data={metrics.records.partitions.recordType} />
        </div>
      </div>

      <div className='block'>
        <h3>
          {t('details.statistics.metadataTypeChart')}
        </h3>
        <div>
          <Chart data={metrics.records.partitions.metadataType} />
        </div>
      </div>

      <div className='block'>
        <h3>
          {t('details.statistics.dataTypeChart')}
        </h3>
        <div>
          <Chart data={metrics.datasets.partitions.dataType} />
        </div>
      </div><commit_msg>Switch order of catalog stats blocks<commit_after>import React from 'react'
import PropTypes from 'prop-types'
import { translate } from 'react-i18next'
import { get } from 'lodash'

import Counter from '../counter'
import Percent from '../percent'

import Chart from './chart'

// import { DoughnutChart } from '../CatalogCharts'

const Statistics = ({ metrics, t }) => {
  const openness = get(metrics, 'datasets.partitions.openness.yes', 0)
  const download = get(metrics, 'datasets.partitions.download.yes', 0)

  return (
    <div className='container'>
      <div className='block'>
        <h3>
          {t('details.statistics.recordsCount')}
        </h3>
        <Counter
          size='medium'
          value={metrics.records.totalCount}
        />
      </div>

      <div className='block'>
        <h3>
          {t('details.statistics.openDataPercent')}
        </h3>
        <Percent
          value={openness}
          total={metrics.datasets.totalCount}
          size='medium'
        />
      </div>

      <div className='block'>
        <h3>
          {t('details.statistics.downloadablePercent')}
        </h3>
        <Percent
          value={download}
          total={metrics.datasets.totalCount}
          size='medium'
        />
      </div>

      <div className='block'>
        <h3>
          {t('details.statistics.recordTypeChart')}
        </h3>
        <div>
          <Chart data={metrics.records.partitions.recordType} />
        </div>
      </div>

      <div className='block'>
        <h3>
          {t('details.statistics.dataTypeChart')}
        </h3>
        <div>
          <Chart data={metrics.datasets.partitions.dataType} />
        </div>
      </div>

      <div className='block'>
        <h3>
          {t('details.statistics.metadataTypeChart')}
        </h3>
        <div>
          <Chart data={metrics.records.partitions.metadataType} />
        </div>
      </div>
{'fraction_non_alphanumeric': 0.14729694437189866, 'fraction_numerical': 0.00835727343954035, 'mean_word_length': 1.9281345565749235, 'pattern_counts': {'":': 0, '<': 77, '<?xml version=': 0, '>': 79, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1342026', 'n_tokens_mistral': 1155, 'n_tokens_neox': 1132, 'n_words': 220}