|
4 | 4 | goog.string]))) |
5 | 5 |
|
6 | 6 | (defn keypath->grid-line-name [keypath] |
7 | | - (str/join "-" (into ["rc"] keypath))) |
| 7 | + (->> keypath |
| 8 | + (into (if (:branch-end? (meta keypath)) |
| 9 | + ["rc-b"] |
| 10 | + ["rc"])) |
| 11 | + (str/join "-"))) |
8 | 12 |
|
9 | 13 | (defn path->grid-line-name [path] |
10 | 14 | (str "rc" (hash path))) |
|
124 | 128 | (header-size node default-size))] |
125 | 129 | (when (or (intersection? sum leaf-size window-start window-end) |
126 | 130 | collect-anyway?) |
127 | | - (let [new-path (cond-> (mapv remove-size leaf-path) |
| 131 | + (let [path-meta (merge (if is-leaf? {:leaf? true} {:branch? true}) |
| 132 | + (when branch-end? {:branch-end? true}) |
| 133 | + (when show-above? {:show-above? true}) |
| 134 | + (when last-child? {:last-child? true})) |
| 135 | + new-path (cond-> (mapv remove-size leaf-path) |
128 | 136 | (or is-leaf? show-above?) |
129 | | - (vary-meta merge {} |
130 | | - (when is-leaf? {:leaf? true}) |
131 | | - (when-not is-leaf? {:branch? true}) |
132 | | - (when branch-end? {:branch-end? true}) |
133 | | - (when show-above? {:show-above? true}) |
134 | | - (when last-child? {:last-child? true})))] |
| 137 | + (vary-meta merge path-meta))] |
135 | 138 | #_(when show? |
136 | 139 | (vswap! spans |
137 | 140 | (fn [m] (reduce #(update %1 %2 inc) m (ancestry leaf-path))))) |
138 | 141 | (vswap! depth max cached-depth (count new-path)) |
139 | 142 | (vswap! paths conj new-path) |
140 | 143 | (vswap! sums conj sum) |
141 | 144 | (vswap! sizes conj leaf-size) |
142 | | - (vswap! keypaths conj keypath))) |
| 145 | + (vswap! keypaths conj (vary-meta keypath merge path-meta)))) |
143 | 146 | (vswap! sum-size + leaf-size) |
144 | 147 | leaf-size))))] |
145 | 148 | (walk [] header-tree {:hide? hide-root?}) |
|
179 | 182 | (defn grid-template [header-traversal] |
180 | 183 | (str/replace |
181 | 184 | (str/join " " |
182 | | - (map #(cond (string? %) % |
| 185 | + (map #(do |
| 186 | + (cond (string? %) % |
183 | 187 | (vector? %) (str "[" (keypath->grid-line-name %) "]") |
184 | | - (number? %) (str % "px")) |
| 188 | + (number? %) (str % "px"))) |
185 | 189 | (grid-tokens header-traversal))) |
186 | 190 | "] [" " ")) |
187 | 191 |
|
|
0 commit comments