data-science

pwrflx 2024-08-11T19:10:56.029259Z

hi! Is there a graphical viewer for tablecloth? I mean something like in R Studio where I have the view() function, so a graphical dataset viewer appears in the development environment. It would be even better if I can search, order, filter in it

pwrflx 2024-08-18T20:52:30.627069Z

Thank you!! I'll look into this

🙏 1
Daniel Slutsky 2024-08-11T19:31:26.140769Z

hi! If you use the https://scicloj.github.io/clay/ notebook, you can do the following:

(require '[tablecloth.api :as tc])
(require '[scicloj.kindly.v4.kind :as kind])

(def my-dataset (tc/dataset {:x (range 1000) :y (map [:A :B :C :D] (repeatedly 1000 #(rand-int 4)))}))

(kind/table my-dataset {:use-datatables true})
In the Clay notebook, this last value will be displayed using https://datatables.net/, and you specify https://datatables.net/manual/options (see https://datatables.net/reference/option/). E.g.:
(kind/table my-dataset {:use-datatables true :datatables {:scrollY 300}})

👍 1
Daniel Slutsky 2024-08-11T19:32:12.721859Z

Relevant examples in the Clay docs: https://scicloj.github.io/clay/clay_book.examples.html#tables

Daniel Slutsky 2024-08-11T19:32:55.097169Z

Please let me know if you need help setting things up. What editor do you use? For some editors, Clay has some commands to make interactive usage easier.

Daniel Slutsky 2024-08-11T19:34:42.152079Z

The equivalent of R's View function will be: make!

(require '[scicloj.clay.v2.api :as clay])

(scicloj.clay.v2.api/make! {:single-value ...})
but it is recommended to use the editor bindings, in my opinion.