From 73ce3b9e781cb99c3ef9361e6a0c26c6ba132518 Mon Sep 17 00:00:00 2001 From: Michael Wood Date: Tue, 14 Dec 2021 12:17:49 +0000 Subject: [PATCH] templates: progress-bars: Improve readability of result charts * Create better visual distinction between a progress bar and a chart to avoid confusion * Show the failed portion of the chart in matching colour with reduced opacity rather than black * Add tooltip texts on overview graphs * Add explanation text in overview of what is being shown Fixes: https://github.com/pwyf/data-quality-tester/issues/40 --- DataQualityTester/templates/overview.html | 12 +++++++----- DataQualityTester/templates/partials/_totaliser.html | 5 +++-- .../templates/quality_by_component.html | 5 +++-- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/DataQualityTester/templates/overview.html b/DataQualityTester/templates/overview.html index 2450e98..2c002cf 100644 --- a/DataQualityTester/templates/overview.html +++ b/DataQualityTester/templates/overview.html @@ -5,7 +5,7 @@
{% for component in components %} -
+

{{ component.name }}

@@ -17,7 +17,6 @@

{{ component.name }}

-
More…
@@ -35,14 +34,15 @@

{{ component.name }}

@@ -74,10 +74,12 @@

{{ component.name }}

int_fail: parseInt(100 - data.score), colour: data.colour, component: data.name, - more_url: $el.data('more-url') + more_url: $el.data('more-url'), + title: $el.data('title'), }; $el.find('.panel-body .loading').fadeOut(function() { $el.find('.panel-body').html(tmpl(ctx)); + $('[data-toggle="tooltip"]').tooltip(); }); } else { $el.find('.panel-body .loading').fadeOut(function() { diff --git a/DataQualityTester/templates/partials/_totaliser.html b/DataQualityTester/templates/partials/_totaliser.html index 704616f..2a471cc 100644 --- a/DataQualityTester/templates/partials/_totaliser.html +++ b/DataQualityTester/templates/partials/_totaliser.html @@ -1,10 +1,11 @@ {% macro totaliser(results) %} +{% set bg_color=results|colorify %}
-
+
{{ (100 * results)|int }}% Pass {{ (100 * results)|int }}%
-
+
{{ (100 * (1 - results))|ceil|int }}% Fail
diff --git a/DataQualityTester/templates/quality_by_component.html b/DataQualityTester/templates/quality_by_component.html index a1aea8f..1121f93 100644 --- a/DataQualityTester/templates/quality_by_component.html +++ b/DataQualityTester/templates/quality_by_component.html @@ -16,12 +16,13 @@

{{ test_name }}

{% if result_dict|percent is not none %} + {% set bg_color=result_dict|percent|colorify %}
-
+
{{ result_dict|percent|int }}% Pass {{ result_dict|percent|int }}%
-
+
{{ 100 - result_dict|percent|int }}% Fail