<commit_before>Flow.Plot = (_config, go) ->

  renderTextTable = (config, go) ->
    [ table, thead, tbody, tr, th, td ] = Flow.HTML.template 'table', '=thead', 'tbody', 'tr', '=th', '=td'
    
    ths = for column in config.data.columns
      th column.name

    trs = for row in config.data.rows
      tds = for column in config.data.columns
        #XXX formatting
        td row[column.name]
      tr tds

    go null, Flow.HTML.render 'div',
      table [
        thead tr ths
        tbody trs
      ]

  initialize = (config) ->
    switch config.type
      when 'text'
        renderTextTable config, go
      else
        go new Error 'Not implemented'

  initialize _config<commit_msg>Prettier text tables<commit_after>Flow.Plot = (_config, go) ->

  renderInterval = (config, go) ->


  renderTextTable = (config, go) ->
    [ table, thead, tbody, tr, th, td, tdr ] = Flow.HTML.template 'table', '=thead', 'tbody', 'tr', '=th', '=td', '=td.rt'
    
    ths = for column in config.data.columns
      th column.name

    trs = for row in config.data.rows
      tds = for column in config.data.columns
        #XXX formatting
        value = row[column.name]
        switch column.type
          when Flow.Data.StringEnum
            td if value is null then '-' else column.domain[value]
          when Flow.Data.Integer, Flow.Data.Real
            tdr if value is null then '-' else value
          else
            td if value is null then '-' else value
      tr tds

    go null, Flow.HTML.render 'div',
      table [
        thead tr ths
        tbody trs
      ]

  initialize = (config) ->
    switch config.type
      when 'interval'
        renderInterval config, go
      when 'text'
        renderTextTable config, go
      else
        go new Error 'Not implemented'

  initialize _config
{'fraction_non_alphanumeric': 0.10724156992813709, 'fraction_numerical': 0.0, 'mean_word_length': 1.9867986798679869, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 10, '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': '95887', 'n_tokens_mistral': 569, 'n_tokens_neox': 542, 'n_words': 181}