nextjournal

2022-02-07T21:14:10.349829Z

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

mkvlr 2022-02-07T21:18:16.971989Z

I know, hope I was going to fix it before anybody noticed πŸ˜… https://github.com/nextjournal/clerk/blob/ec07ed2701fb82ecac94c786a1310d7e324cab18/src/nextjournal/clerk/viewer.cljc#L222

2022-02-07T21:19:57.698559Z

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

Ethan Miller 2022-03-01T06:36:45.286769Z

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

Ethan Miller 2022-03-01T06:43:44.821069Z

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

mkvlr 2022-02-07T21:23:26.269259Z

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

mkvlr 2022-02-07T21:24:51.047879Z

but don’t think this is ideal as-is

2022-02-07T21:25:29.742829Z

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

mkvlr 2022-02-07T21:25:58.298749Z

but it’s ordered when iterating over it?

mkvlr 2022-02-07T21:32:38.580319Z

also open to providing other means for controlling column order

mkvlr 2022-02-07T21:33:08.327049Z

to also support things like https://github.com/clj-commons/ordered

2022-02-07T21:35:14.727249Z

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
2022-02-07T21:36:22.837379Z

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

2022-02-07T21:37:25.242509Z

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

2022-02-07T21:38:53.700699Z

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

mkvlr 2022-02-07T22:04:25.973869Z

can also directly return a map with rows and head https://github.com/nextjournal/clerk/blob/main/src/nextjournal/clerk/viewer.cljc#L133

Ethan Miller 2022-02-10T18:42:37.600619Z

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

Ethan Miller 2022-02-10T18:42:41.253599Z

So this is helpful!

Ethan Miller 2022-02-10T18:43:01.309509Z

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

2022-02-10T21:10:42.605719Z

yes.

πŸ™ 1