Fork me on GitHub
#nextjournal
<
2022-02-07
>
Carsten Behring21:02:10

In the case of table with lots of columns, the "full" option does not use max width:

Carsten Behring21:02:57

If I render a table from seq-of-maps, can I control column order ?

mkvlr21:02:26

by being sorted? making your coll an instance of clojure.lang.Sorted

mkvlr21:02:51

but don’t think this is ideal as-is

Carsten Behring21:02:29

My frequent use case is to render a tmd dataset. It has a ->maps function, which looses column sorting ..

mkvlr21:02:58

but it’s ordered when iterating over it?

mkvlr21:02:38

also open to providing other means for controlling column order

Carsten Behring21:02:14

I solved it by using use-headers

(defn ->table [df]
  (->
   (concat [(tc/column-names df)]
           (tc/rows df :as-seqs))
   clerk/use-headers
   clerk/table))

👍 2
Carsten Behring21:02:22

So I think clerk itself does not need more. use-headers is there.

Carsten Behring21:02:25

I was just thinking that maybe use-headers could become an option of table instead of own function.

Carsten Behring21:02:53

(clerk/table
   {:headers [a b c]}
   ....

Ethan Miller18:02:37

Hey @U7CAHM72M I think I ran into this same problem when trying to view a tmd dataset using clerk/table.

Ethan Miller18:02:41

So this is helpful!

Ethan Miller18:02:01

I guess this also means that clerk/table is the what we need to use to view a tmd dataset in clerk?

Ethan Miller06:03:45

I tried this approach with a dataset that has a bunch of columns. It rendered like this:

Ethan Miller06:03:44

Is there a way to force showing the full column name, and then just make it possible to scroll off to the right?