<commit_before>import React from 'react'
import Reflux from 'reflux'

import DataBrowserTableStore from 'stores/DataBrowserTableStore'
import DataBrowserTableActions from 'actions/DataBrowserTableActions'
import SimpleDataTable from 'components/organisms/SimpleDataTable'

const {Datascope, LocalDatascope, SimpleDataTableColumn, Paginator} = require('react-datascope')

let DatabrowserTable = React.createClass({

  mixins: [
    Reflux.connect(DataBrowserTableStore)
  ],

  propTypes: {
    data: React.PropTypes.object,
    editable: React.PropTypes.bool,
    selected_locations: React.PropTypes.array.isRequired,
    selected_indicators: React.PropTypes.array.isRequired
  },

  render: function () {
    console.info('-------- DatabrowserTable.render')
    DataBrowserTableActions.getTableData(this.props.selected_locations, this.props.selected_indicators, this.props.data)
    if (!this.state || !this.state.data) {
      return (<div className='medium-12 columns ds-data-table-empty'>No data.</div>)
    } else {
      let columns = this.state.columns.map(column => (<SimpleDataTableColumn name={column}/>))
      let table = ''
      if (this.props.editable) {
        table = <SimpleDataTable editable>{columns}</SimpleDataTable>
      } else {
        table = <SimpleDataTable>{columns}</SimpleDataTable>
      }

      return (
        <LocalDatascope data={this.state.data} schema={this.state.schema} pageSize={10}>
          <Datascope>
            { table }
            <Paginator />
          </Datascope>
        </LocalDatascope>
      )
    }
  }
})

export default DatabrowserTable<commit_msg>check props not state for render<commit_after>import React from 'react'
import Reflux from 'reflux'

import DataBrowserTableStore from 'stores/DataBrowserTableStore'
import DataBrowserTableActions from 'actions/DataBrowserTableActions'
import SimpleDataTable from 'components/organisms/SimpleDataTable'

const {Datascope, LocalDatascope, SimpleDataTableColumn, Paginator} = require('react-datascope')

let DatabrowserTable = React.createClass({

  mixins: [
    Reflux.connect(DataBrowserTableStore)
  ],

  propTypes: {
    data: React.PropTypes.object,
    editable: React.PropTypes.bool,
    selected_locations: React.PropTypes.array.isRequired,
    selected_indicators: React.PropTypes.array.isRequired
  },

  render: function () {
    console.info('-------- DatabrowserTable.render')
    DataBrowserTableActions.getTableData(this.props.selected_locations, this.props.selected_indicators, this.props.data)
    console.log('this.state.data', this.state.data)
    console.log('this.props.data', this.props.data)
    if (!this.state || !this.props.data) {
      return (<div className='medium-12 columns ds-data-table-empty'>No data.</div>)
    } else {
      let columns = this.state.columns.map(column => (<SimpleDataTableColumn name={column}/>))
      let table = ''
      if (this.props.editable) {
        table = <SimpleDataTable editable>{columns}</SimpleDataTable>
      } else {
        table = <SimpleDataTable>{columns}</SimpleDataTable>
      }
      return (
        <LocalDatascope data={this.state.data} schema={this.state.schema} pageSize={10}>
          <Datascope>
            { table }
            <Paginator />
          </Datascope>
        </LocalDatascope>
      )
    }
  }
})

export default DatabrowserTable
{'fraction_non_alphanumeric': 0.12126642771804062, 'fraction_numerical': 0.0023894862604540022, 'mean_word_length': 3.5317997293640055, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 29, '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': '6982397', 'n_tokens_mistral': 1007, 'n_tokens_neox': 979, 'n_words': 178}