<commit_before>(ns client.views.viz.table
  (:require-macros [cljs.core.async.macros :refer [go-loop]]
                   [cljs.core.match.macros :refer [match]])
  (:require [dommy.utils :as utils]
            [dommy.core :as dommy]
            [om-tools.core :refer-macros [defcomponent]]
            [cljs.core.match :as m]
            [cljs.core.async :as async :refer [<! put! chan sub sliding-buffer]]
            [cljs-log.core :as log]
            [om.dom :as dom :include-macros true]
            [om.core :as om :include-macros true]
            [sablono.core :as html :refer-macros [html]]))

(def ^:private l (log/get-logger "table"))

(defn print-data "" [data]
  (str "{ " (map (fn [[k v]] (str k " " v "\n")) data) " }"))

(defn ^:private filter-range [x low high]
  (println (<= x high) (>= x low))
  (and  (<= x high) (>= x low)) )

(defn hide? [bounds d]
  (let [{:keys [low high]} bounds
        t (get-in d [:data :timestamp])]
    (and (>= t low) (< t high))))

(defn ^:private update-selected [data owner e]
  (let [c (om/get-state owner :chan ) ]
    (put! c data)))

(defcomponent data-row-view [data owner]
  (render
    [_]
    (let [d (:data data)]
    (html
      [:tr {:on-click #(update-selected data owner %) }
       [:td (:x d)]
       [:td (:y d)]
       [:td (:z d)]<commit_msg>unwrap data passed ot table view<commit_after>(ns client.views.viz.table
  (:require-macros [cljs.core.async.macros :refer [go-loop]]
                   [cljs.core.match.macros :refer [match]])
  (:require [dommy.utils :as utils]
            [dommy.core :as dommy]
            [om-tools.core :refer-macros [defcomponent]]
            [cljs.core.match :as m]
            [cljs.core.async :as async :refer [<! put! chan sub sliding-buffer]]
            [cljs-log.core :as log]
            [om.dom :as dom :include-macros true]
            [om.core :as om :include-macros true]
            [sablono.core :as html :refer-macros [html]]))

(def ^:private l (log/get-logger "table"))

(defn print-data "" [data]
  (str "{ " (map (fn [[k v]] (str k " " v "\n")) data) " }"))

(defn ^:private filter-range [x low high]
  (println (<= x high) (>= x low))
  (and  (<= x high) (>= x low)) )

(defn hide? [bounds d]
  (let [{:keys [low high]} bounds
        t (get-in d [:timestamp])]
    (and (>= t low) (< t high))))

(defn ^:private update-selected [data owner e]
  (let [c (om/get-state owner :chan ) ]
    (put! c data)))

(defcomponent data-row-view [data owner]
  (render
    [_]
    (let [d data]
    (html
      [:tr {:on-click #(update-selected data owner %) }
       [:td (:x d)]
       [:td (:y d)]
       [:td (:z d)]
{'fraction_non_alphanumeric': 0.18852147472443936, 'fraction_numerical': 0.0, 'mean_word_length': 2.331645569620253, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 9, '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': '7625041', 'n_tokens_mistral': 983, 'n_tokens_neox': 964, 'n_words': 280}