<commit_before>var React = require('react')
var fetchJson = require('./fetch-json.js')
var SqlpadTauChart = require('./SqlpadTauChart.js')

var QueryEditor = React.createClass({
  getInitialState: function () {
    return {
      isSaving: false,
      isRunning: false,
      runQueryStartTime: undefined,
      queryResult: undefined
    }
  },
  runQuery: function (queryId) {
    this.setState({
      isRunning: true,
      runQueryStartTime: new Date()
    })
    fetchJson('GET', this.props.config.baseUrl + '/api/queries/' + queryId)
      .then((json) => {
        if (json.error) console.error(json.error)
        this.setState({
          query: json.query
        })
      })
      .then(() => {
        return fetchJson('GET', this.props.config.baseUrl + '/api/query-result/' + queryId)
      })
      .then((json) => {
        if (json.error) console.error(json.error)
        this.setState({
          isRunning: false,
          queryError: json.error,
          queryResult: json.queryResult
        })
      })
      .catch((ex) => {
        console.error(ex.toString())
        this.setState({
          isRunning: false
        })
      })
  },
  componentDidMount: function () {
    this.runQuery(this.props.queryId)
  },
  render: function () {
    return (
      <SqlpadTauChart
        query={this.state.query}
        queryResult={this.state.queryResult}
        queryError={this.state.queryError}
        isRunning={this.state.isRunning} />
    )
  }
})

module.exports = QueryEditor
<commit_msg>pass config on to SqlpadTauChart<commit_after>var React = require('react')
var fetchJson = require('./fetch-json.js')
var SqlpadTauChart = require('./SqlpadTauChart.js')

var QueryEditor = React.createClass({
  getInitialState: function () {
    return {
      isSaving: false,
      isRunning: false,
      runQueryStartTime: undefined,
      queryResult: undefined
    }
  },
  runQuery: function (queryId) {
    this.setState({
      isRunning: true,
      runQueryStartTime: new Date()
    })
    fetchJson('GET', this.props.config.baseUrl + '/api/queries/' + queryId)
      .then((json) => {
        if (json.error) console.error(json.error)
        this.setState({
          query: json.query
        })
      })
      .then(() => {
        return fetchJson('GET', this.props.config.baseUrl + '/api/query-result/' + queryId)
      })
      .then((json) => {
        if (json.error) console.error(json.error)
        this.setState({
          isRunning: false,
          queryError: json.error,
          queryResult: json.queryResult
        })
      })
      .catch((ex) => {
        console.error(ex.toString())
        this.setState({
          isRunning: false
        })
      })
  },
  componentDidMount: function () {
    this.runQuery(this.props.queryId)
  },
  render: function () {
    return (
      <SqlpadTauChart
        query={this.state.query}
        config={this.props.config}
        queryResult={this.state.queryResult}
        queryError={this.state.queryError}
        isRunning={this.state.isRunning} />
    )
  }
})

module.exports = QueryEditor

{'fraction_non_alphanumeric': 0.14170432537120722, 'fraction_numerical': 0.0, 'mean_word_length': 2.2080745341614905, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 13, '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': '2458990', 'n_tokens_mistral': 943, 'n_tokens_neox': 950, 'n_words': 161}