From d39b911a1beff15896b7b8bb31cbe1546484bd17 Mon Sep 17 00:00:00 2001 From: Kenneth Cheung Date: Fri, 27 Mar 2026 13:31:21 -0400 Subject: [PATCH 1/2] separate map units results --- .../behave/components/results/matrices.cljs | 119 ++++++++++-------- 1 file changed, 66 insertions(+), 53 deletions(-) diff --git a/projects/behave/src/cljs/behave/components/results/matrices.cljs b/projects/behave/src/cljs/behave/components/results/matrices.cljs index 7d6d314f7..aea8f3166 100644 --- a/projects/behave/src/cljs/behave/components/results/matrices.cljs +++ b/projects/behave/src/cljs/behave/components/results/matrices.cljs @@ -125,26 +125,32 @@ (let [map-units-settings-entity @(subscribe [:worksheet/map-units-settings-entity ws-uuid]) map-units (:map-units-settings/units map-units-settings-entity) map-rep-frac (:map-units-settings/map-rep-fraction map-units-settings-entity) - rows (reduce (fn [acc {output-gv-uuid :bp/uuid + regular-rows (reduce (fn [acc {output-gv-uuid :bp/uuid units :units}] (let [value @(subscribe [:worksheet/first-row-results-gv-uuid->value ws-uuid output-gv-uuid]) fmt-fn (get formatters output-gv-uuid identity) var-name @(subscribe [:wizard/gv-uuid->resolve-result-variable-name output-gv-uuid])] - (cond-> acc - :always (conj {:output var-name - :value (if (neg? value) - "-" - (fmt-fn value)) - :units units}) - - (process-map-units? output-gv-uuid) - (conj {:output (gstring/format @( value - (to-map-units units map-units map-rep-frac) - fmt-fn) - "-") - :units map-units})))) + (conj acc {:output var-name + :value (if (neg? value) + "-" + (fmt-fn value)) + :units units}))) + [] + output-entities) + map-units-rows (reduce (fn [acc {output-gv-uuid :bp/uuid + units :units}] + (if (process-map-units? output-gv-uuid) + (let [value @(subscribe [:worksheet/first-row-results-gv-uuid->value ws-uuid output-gv-uuid]) + fmt-fn (get formatters output-gv-uuid identity) + var-name @(subscribe [:wizard/gv-uuid->resolve-result-variable-name output-gv-uuid])] + (conj acc {:output (gstring/format @( value + (to-map-units units map-units map-rep-frac) + fmt-fn) + "-") + :units map-units})) + acc)) [] output-entities)] [:div.print__result-table @@ -153,7 +159,14 @@ @(resolve-result-variable-name output-gv-uuid])] - (cond-> acc - (process-map-units? output-gv-uuid) - (conj {:name (gstring/format @( acc - (process-map-units? col) - (assoc [(input-fmt-fn row) (map-units-column-key col)] - (format-matrix-cell - (convert-to-map-units value (get units-lookup col) units rep-fraction) - fmt-fn - shaded?))))) - matrix-data-formatted - matrix-data-raw)] + common-matrix-props {:rows-label (header-label multi-var-name multi-var-units) + :cols-label @( Date: Fri, 27 Mar 2026 13:51:32 -0400 Subject: [PATCH 2/2] add padding --- projects/behave/resources/public/css/app-style.css | 4 ++++ .../src/cljs/behave/components/results/matrices.cljs | 9 +++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/projects/behave/resources/public/css/app-style.css b/projects/behave/resources/public/css/app-style.css index 5d5fae156..f5e33ed99 100644 --- a/projects/behave/resources/public/css/app-style.css +++ b/projects/behave/resources/public/css/app-style.css @@ -1455,6 +1455,10 @@ body { text-align: left; } +.result-matrix__map-units-table { + margin-top: 5px; +} + .wizard-results__pivot-tables .table { margin-bottom: 20px; } diff --git a/projects/behave/src/cljs/behave/components/results/matrices.cljs b/projects/behave/src/cljs/behave/components/results/matrices.cljs index aea8f3166..a0868e741 100644 --- a/projects/behave/src/cljs/behave/components/results/matrices.cljs +++ b/projects/behave/src/cljs/behave/components/results/matrices.cljs @@ -223,10 +223,11 @@ :column-headers regular-column-headers :data matrix-data-formatted})) (when (seq map-units-column-headers) - (c/matrix-table (merge common-matrix-props - {:title (gstring/format @(