(compute-layout items window-base)
Given a sequence of items and the window dimensions, return a sequence of sequences containing item entries laid out according to the partition algorithm.
Given a sequence of items and the window dimensions, return a sequence of sequences containing item entries laid out according to the partition algorithm.
(compute-partitions aspects num-rows)
Given a sequence of item aspects and the number of rows, return a sequence of rows, each of which is a sequence of item aspects whose sum is as equal as possible to the sums of other rows.
Given a sequence of item aspects and the number of rows, return a sequence of rows, each of which is a sequence of item aspects whose sum is as equal as possible to the sums of other rows.
(compute-rows {:keys [width height]} items)
Given the window dimensions and a sequence of item aspect ratios, return the ideal number of rows for the gallery layout.
Given the window dimensions and a sequence of item aspect ratios, return the ideal number of rows for the gallery layout.
(fill-partitions partitions items)
Replace each aspect ratio in the partition sequence with an item of the same aspect ratio. Each item is used only once.
Replace each aspect ratio in the partition sequence with an item of the same aspect ratio. Each item is used only once.
(row-scale-factor row-width row-height items)
Given the row width, ideal row height, and a sequence of items, return the scale factor s, where the actual row height is given by multiplying the ideal row height by s.
Given the row width, ideal row height, and a sequence of items, return the scale factor s, where the actual row height is given by multiplying the ideal row height by s.
(scale-layout {:keys [box] :as window} layout)
Return a layout which contains explicit dimensions for items.
Return a layout which contains explicit dimensions for items.
(scale-row row-width row-height items)
Given the row dimensions and a sequence of items, return a new sequence of items which have :width, :height keys. These items are scaled so that the sum of their widths is equal to the the row width.
Given the row dimensions and a sequence of items, return a new sequence of items which have :width, :height keys. These items are scaled so that the sum of their widths is equal to the the row width.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close