Simple tools for visualising data at the repl using swing
(data-table data {:keys [override-column-labels])
Returns a swing JTable containing the data, laid out as sensibly as possible. Handles lists, maps and beans, both homogeneous and heterogeneous.
override-column-labels
to override inferred column headingsClicking on a cell in a data-table
will show a new data-table
for the data within the cell.
(watcher reference {:keys [limit elide-duplicates?]
:or {limit 0 elide-duplicates? false)
Watches for changes to the reference, returns a data-table
containing the history of changes.
limit
restricts the length of history kept, 0 means unlimited historyelide-duplicates?
will not record changes that maintain the same state as before(show! component)
Pops up a small scrollable window containing the swing component passed in.
; watching changes on an atom
(def x (atom [1]))
(show! (watcher x {:limit 10 :elide-duplicates? true}))
(swap! x conj 2)
(swap! x conj 3)
; showing various pieces of data
(show! (data-table [1 2 3]))
(show! (data-table [[1 "jon" :user]
[56 "dave" :admin]
[24 "roger" :user :optional-value]]
{:override-column-labels ["id" "name" "role" "other"]}))
(show! (data-table [{:id 1 :name "jon" :role :user}
{:id 56 :name "dave" :role :admin}
{:id 24 :name "roger" :role :user :optional-key :optional-value}]))
(show! (data-table {:a 1 :b 2 :c {:hello [1 2 3] :test "world" :other #{2 4}}))
(show! (data-table (new java.util.Date)))
Can you improve this documentation?Edit on GitHub
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close