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 7d6d314f7..a0868e741 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 @(