This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-05-23
Channels
- # ai (1)
- # aleph (1)
- # announcements (7)
- # babashka (87)
- # beginners (34)
- # biff (9)
- # clerk (4)
- # clojars (37)
- # clojure (144)
- # clojure-art (12)
- # clojure-europe (13)
- # clojure-nl (1)
- # clojure-norway (4)
- # clojure-uk (2)
- # clr (5)
- # conjure (1)
- # data-science (1)
- # datahike (7)
- # datalevin (6)
- # datomic (13)
- # events (1)
- # fulcro (1)
- # graalvm (5)
- # gratitude (1)
- # honeysql (4)
- # hyperfiddle (122)
- # malli (26)
- # nbb (2)
- # off-topic (16)
- # portal (93)
- # practicalli (1)
- # re-frame (1)
- # reitit (15)
- # releases (3)
- # remote-jobs (1)
- # shadow-cljs (5)
- # tools-deps (6)
- # xtdb (4)
Is there a way to show ALL the rows of an auto-expanded table by default? My clerk/table
viewer is showing only the first 20 rows (can click to show the rest). There are only about 40 rows total, so I dont think it needs to be limited for perf reasons.. I am using this metadata:
^{:nextjournal.clerk/visibility {:result :show}
:nextjournal.clerk/auto-expand-results? true
:nextjournal.clerk/budget 1000}
(clerk/table items)
this is one of the aspects that we need to make easier or at least document better, this has been asked a lot but (I think) it didn’t make it in the https://book.clerk.vision/#elisions yet. The table viewer injects their own sub-viewers at “runtime” so you need to take this into account if you want to disable pagination. So one way to achieve this is
(ns scratch.pagination
(:require [nextjournal.clerk :as clerk]
[nextjournal.clerk.viewer :as viewer]))
(clerk/add-viewers! [(update viewer/table-viewer :transform-fn #(comp %2 %1)
(fn [wrapped-value]
(update wrapped-value :nextjournal/viewers
clerk/update-viewers {:page-size #(dissoc % :page-size)})))])
(clerk/table (map vector (range 30)))
that disables pagination for all clerk/table
calls in the namespace, while if you want to restrict to single values you can do
(def unpaginated-table-viewer
(update viewer/table-viewer :transform-fn #(comp %2 %1)
(fn [wrapped-value]
(update wrapped-value :nextjournal/viewers
clerk/update-viewers {:page-size #(dissoc % :page-size)}))))
(clerk/with-viewer unpaginated-table-viewer
(map vector (range 30)))
That works for me!! Thanks, dont think I would have figured that out. for already great but evolving docs.