File tree Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change 163
163
(defn tree-grid
164
164
" Build a lazy sheet grid from `tree`, whose leaves are shaped key->number.
165
165
166
- E.g. (tree {:assets {:cash {:usd 100 :eur 100}}})
166
+ E.g. (tree-grid {:assets {:cash {:usd 100 :eur 100}}})
167
167
168
168
See the comment form below this definition for examples."
169
- [tree]
170
- (let [ks (into [" " ] (keys (tree/fold + tree)))]
171
- (table-grid ks (tree->rows tree))))
169
+ ([tree]
170
+ (let [ks (into [" " ] (keys (tree/fold + tree)))]
171
+ (tree-grid ks tree)))
172
+ ([ks tree]
173
+ (let [ks (into [" " ] (remove #{" " }) ks)] ; ; force the "" col to come first
174
+ (table-grid ks (tree->rows tree)))))
172
175
173
176
174
177
(comment
Original file line number Diff line number Diff line change 41
41
(let [temp-file (io/file (temp " .xlsx" ))]
42
42
(try
43
43
(testing " Example code snippet writes successfully."
44
+ (println " Writing example workbook..." )
44
45
(write! example-workbook-data temp-file))
45
46
(finally
46
47
(io/delete-file temp-file)))))
50
51
(let [temp-file (io/file (temp " .xlsx" ))]
51
52
(try
52
53
(testing " Example code snippet writes successfully."
54
+ (println " Writing example template..." )
53
55
(let [template (clojure.java.io/resource " uptime-template.xlsx" )
54
56
new-data {" raw" (table-grid example-template-data)}]
55
57
(append! new-data template " filled-in-template.xlsx" )))
You can’t perform that action at this time.
0 commit comments