<commit_before>(ns desdemona.ui.table)

(defn table-component
  [state]
  [:div [:h2 "Table"]])<commit_msg>display results in sorted table<commit_after>(ns desdemona.ui.table
  (:require [wilson.dom :as wd]
            [reagent.session :as session]))

(defn table-component
  [state]
  (let [state-deref @state
        rows (:results state-deref)
        all-keys (-> (mapcat wd/get-all-keys rows) distinct wd/prepare-keys)]
    (wd/sorted-table all-keys rows session/state)))
{'fraction_non_alphanumeric': 0.14915966386554622, 'fraction_numerical': 0.0021008403361344537, 'mean_word_length': 3.5428571428571427, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, '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': '213664', 'n_tokens_mistral': 173, 'n_tokens_neox': 166, 'n_words': 39}