gov-uk-dashboards 24.1.1__tar.gz → 25.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {gov_uk_dashboards-24.1.1/gov_uk_dashboards.egg-info → gov_uk_dashboards-25.0.0}/PKG-INFO +1 -1
- {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/__init__.py +1 -0
- {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/assets/__init__.py +1 -0
- {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/assets/get_assets_folder.py +1 -0
- {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/axes.py +1 -0
- {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/colours.py +1 -0
- {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/components/__init__.py +1 -0
- {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/components/dash/apply_and_reset_filters_buttons.py +1 -0
- {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/components/dash/banners.py +1 -0
- {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/components/dash/card.py +1 -0
- {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/components/dash/card_full_width.py +1 -0
- {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/components/dash/collapsible_panel.py +1 -0
- {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/components/dash/comparison_la_filter_button.py +1 -0
- {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/components/dash/context_banner.py +1 -0
- {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/components/dash/details.py +1 -0
- {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/components/dash/download_button.py +1 -0
- {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/components/dash/filter_panel.py +1 -0
- {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/components/dash/footer.py +25 -14
- {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/components/dash/graph.py +1 -0
- {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/components/dash/heading.py +1 -0
- {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/components/dash/home_page_link_button.py +4 -3
- {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/components/dash/html_list.py +1 -0
- {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/components/dash/key_value_pair.py +1 -0
- {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/components/dash/main_content.py +1 -0
- {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/components/dash/notification_banner.py +1 -0
- {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/components/dash/paragraph.py +1 -0
- {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/components/dash/phase_banner.py +6 -3
- {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/components/dash/row_component.py +1 -0
- {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/components/dash/table.py +48 -26
- {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/components/dash/tooltip.py +1 -0
- {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/components/dash/tooltip_title.py +1 -0
- {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/components/dash/visualisation_commentary.py +1 -0
- {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/components/dash/visualisation_title.py +1 -0
- {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/components/dash/warning_text.py +1 -0
- {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/components/helpers/display_chart_or_table_with_header.py +23 -15
- {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/components/helpers/get_chart_for_download.py +18 -15
- {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/components/helpers/plotting_helper_functions.py +0 -1
- {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/components/plotly/captioned_figure.py +6 -3
- {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/constants.py +1 -1
- {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/figures/__init__.py +1 -0
- {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/figures/chart_data.py +1 -0
- {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/figures/enums/__init__.py +1 -0
- {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/figures/enums/dash_patterns.py +1 -0
- {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/figures/styles/__init__.py +1 -0
- {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/figures/styles/line_style.py +1 -0
- {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/formatting/human_readable.py +1 -0
- {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/formatting/round_and_add_prefix_and_suffix.py +1 -0
- {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/lib/dap/dap_deployment.py +1 -0
- {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/lib/dap/get_dataframe_from_cds.py +2 -1
- {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/lib/download_functions/download_csv_with_headers.py +9 -0
- {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/lib/http_headers.py +0 -1
- {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/lib/logging.py +1 -0
- {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/symbols.py +1 -0
- {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/template.py +1 -0
- {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0/gov_uk_dashboards.egg-info}/PKG-INFO +1 -1
- {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/setup.py +1 -1
- {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/LICENSE +0 -0
- {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/MANIFEST.in +0 -0
- {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/README.md +0 -0
- {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/assets/attach-event-to-dash.js +0 -0
- {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/assets/custom_map_style_functions.js +0 -0
- {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/assets/dashboard.css +0 -0
- {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/assets/download-map.js +0 -0
- {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/assets/fonts/bold-affa96571d-v2.woff +0 -0
- {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/assets/fonts/bold-b542beb274-v2.woff2 +0 -0
- {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/assets/fonts/light-94a07e06a1-v2.woff2 +0 -0
- {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/assets/fonts/light-f591b13f7d-v2.woff +0 -0
- {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/assets/govuk-frontend-3.14.0.min.js +0 -0
- {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/assets/images/DLUHC_WHITE_Master_AW_sm.png +0 -0
- {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/assets/images/MHCLG-favicon.png +0 -0
- {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/assets/images/MHCLG_favicon.png +0 -0
- {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/assets/images/dcms_coatofarms.png +0 -0
- {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/assets/images/dluhc_favicon.ico +0 -0
- {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/assets/images/gov_favicon.ico +0 -0
- {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/assets/images/govuk-crest.svg +0 -0
- {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/assets/images/hm-government-logo.png +0 -0
- {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/assets/images/mhclg_coat_of_arms.png +0 -0
- {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/assets/images/mhclg_white_no_background.png +0 -0
- {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/assets/images/oflog/MedianAbsolute.png +0 -0
- {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/assets/images/oflog/how_to_1_selecting_data.png +0 -0
- {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/assets/images/oflog/how_to_2_viewing_tabs.png +0 -0
- {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/assets/images/oflog/how_to_3_viewing_charts.png +0 -0
- {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/assets/images/oflog/how_to_4_viewing_trends.png +0 -0
- {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/assets/images/oflog/how_to_5_viewing_tables.png +0 -0
- {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/assets/index.html +0 -0
- {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/assets/mobile-nav.js +0 -0
- {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/assets/scripts.js +0 -0
- {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/assets/topojson/usa_110m.json +0 -0
- {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/assets/topojson/world_110m.json +0 -0
- {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/components/dash/__init__.py +0 -0
- {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/components/dash/dashboard_container.py +0 -0
- {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/components/dash/header.py +0 -0
- {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/components/dash/navbar.py +0 -0
- {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/components/dash/no_data_message.py +0 -0
- {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/components/dash/side_navbar.py +0 -0
- {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/components/helpers/__init__.py +0 -0
- {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/components/helpers/generate_dash_graph_from_figure.py +0 -0
- {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/components/helpers/update_layout_bgcolor_margin.py +0 -0
- {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/components/leaflet/__init__.py +0 -0
- {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/components/leaflet/leaflet_choropleth_map.py +0 -0
- {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/components/plotly/__init__.py +0 -0
- {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/components/plotly/choropleth_map.py +0 -0
- {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/components/plotly/enums.py +0 -0
- {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/components/plotly/stacked_barchart.py +0 -0
- {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/components/plotly/time_series_chart.py +0 -0
- {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/figures/line_chart.py +0 -0
- {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/formatting/__init__.py +0 -0
- {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/formatting/number_formatting.py +0 -0
- {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/formatting/rounding.py +0 -0
- {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/formatting/text_functions.py +0 -0
- {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/lib/__init__.py +0 -0
- {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/lib/dap/__init__.py +0 -0
- {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/lib/datetime_functions/__init__.py +0 -0
- {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/lib/datetime_functions/datetime_functions.py +0 -0
- {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/lib/download_functions/__init__.py +0 -0
- {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/lib/download_functions/convert_fig_to_image_and_download.py +0 -0
- {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/lib/enable_basic_auth.py +0 -0
- {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/template.html +0 -0
- {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards.egg-info/SOURCES.txt +0 -0
- {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards.egg-info/dependency_links.txt +0 -0
- {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards.egg-info/requires.txt +0 -0
- {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards.egg-info/top_level.txt +0 -0
- {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: gov_uk_dashboards
|
3
|
-
Version:
|
3
|
+
Version: 25.0.0
|
4
4
|
Summary: Provides access to functionality common to creating a data dashboard.
|
5
5
|
Author: Department for Levelling Up, Housing and Communities
|
6
6
|
Description-Content-Type: text/markdown
|
{gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/components/dash/footer.py
RENAMED
@@ -1,4 +1,5 @@
|
|
1
1
|
"""footer"""
|
2
|
+
|
2
3
|
from typing import Optional
|
3
4
|
from dash import html
|
4
5
|
|
@@ -22,20 +23,30 @@ def footer(footer_links: Optional[list[any]]):
|
|
22
23
|
[
|
23
24
|
html.Div(
|
24
25
|
[
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
26
|
+
(
|
27
|
+
html.H2(
|
28
|
+
"Support Links", className="govuk-visually-hidden"
|
29
|
+
)
|
30
|
+
if footer_links
|
31
|
+
else None
|
32
|
+
),
|
33
|
+
(
|
34
|
+
html.Ul(
|
35
|
+
children=[
|
36
|
+
html.Li(
|
37
|
+
item,
|
38
|
+
className="govuk-footer__inline-list-item",
|
39
|
+
)
|
40
|
+
for item in footer_links
|
41
|
+
],
|
42
|
+
className=(
|
43
|
+
"govuk-footer__inline-list "
|
44
|
+
"govuk-!-display-none-print"
|
45
|
+
),
|
46
|
+
)
|
47
|
+
if footer_links
|
48
|
+
else None
|
49
|
+
),
|
39
50
|
html.Span(
|
40
51
|
[
|
41
52
|
"All content is available under the ",
|
@@ -1,4 +1,5 @@
|
|
1
1
|
"""home_page_link_button"""
|
2
|
+
|
2
3
|
from typing import Optional
|
3
4
|
from dash import html
|
4
5
|
|
@@ -43,9 +44,9 @@ def home_page_link_button(
|
|
43
44
|
[
|
44
45
|
html.Div(
|
45
46
|
[title],
|
46
|
-
className=
|
47
|
-
|
48
|
-
|
47
|
+
className=(
|
48
|
+
"govuk-heading-l" if info is not None else None
|
49
|
+
),
|
49
50
|
),
|
50
51
|
(
|
51
52
|
html.Div(
|
@@ -1,4 +1,5 @@
|
|
1
1
|
"""phase_banner"""
|
2
|
+
|
2
3
|
from dash import html
|
3
4
|
|
4
5
|
|
@@ -31,9 +32,11 @@ def phase_banner_with_feedback(
|
|
31
32
|
className="govuk-link",
|
32
33
|
id=link_id,
|
33
34
|
target=link_target,
|
34
|
-
rel=
|
35
|
-
|
36
|
-
|
35
|
+
rel=(
|
36
|
+
"noopener noreferrer"
|
37
|
+
if link_target == "_blank"
|
38
|
+
else ""
|
39
|
+
), # conditional attribute for security
|
37
40
|
),
|
38
41
|
" will help us to improve it.",
|
39
42
|
],
|
{gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/components/dash/table.py
RENAMED
@@ -1,4 +1,5 @@
|
|
1
1
|
"""Function for creating a table component from a dataframe"""
|
2
|
+
|
2
3
|
from typing import Optional
|
3
4
|
import polars as pl
|
4
5
|
from dash import html, dcc
|
@@ -112,17 +113,26 @@ def table_from_polars_dataframe(
|
|
112
113
|
# If sortable_headers is True, use a button for the header with sorting
|
113
114
|
# functionality
|
114
115
|
html.Th(
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
116
|
+
(
|
117
|
+
html.Button(
|
118
|
+
(
|
119
|
+
dcc.Markdown(header)
|
120
|
+
if format_column_headers_as_markdown
|
121
|
+
else header
|
122
|
+
),
|
123
|
+
id={
|
124
|
+
"type": f"{table_id}-header-button",
|
125
|
+
"index": idx,
|
126
|
+
},
|
127
|
+
n_clicks=0,
|
128
|
+
)
|
129
|
+
if header not in non_sortable_columns
|
130
|
+
else (
|
131
|
+
dcc.Markdown(header)
|
132
|
+
if format_column_headers_as_markdown
|
133
|
+
else header
|
134
|
+
)
|
135
|
+
),
|
126
136
|
**(
|
127
137
|
{"aria-sort": sorted_header_dict.get(header, "none")}
|
128
138
|
if header
|
@@ -142,9 +152,11 @@ def table_from_polars_dataframe(
|
|
142
152
|
)
|
143
153
|
if sortable_headers
|
144
154
|
else html.Th(
|
145
|
-
|
146
|
-
|
147
|
-
|
155
|
+
(
|
156
|
+
dcc.Markdown(header)
|
157
|
+
if format_column_headers_as_markdown
|
158
|
+
else header
|
159
|
+
),
|
148
160
|
scope="col",
|
149
161
|
className="govuk-table__header",
|
150
162
|
style={
|
@@ -185,17 +197,22 @@ def table_from_polars_dataframe(
|
|
185
197
|
html.Td(
|
186
198
|
cell,
|
187
199
|
className="govuk-table__cell",
|
188
|
-
style=
|
189
|
-
|
190
|
-
|
200
|
+
style=(
|
201
|
+
{"text-align": "right"}
|
202
|
+
if column_name in columns_to_right_align
|
203
|
+
else {}
|
204
|
+
),
|
191
205
|
)
|
192
206
|
for cell, column_name in zip(row[1:], dataframe.columns[1:])
|
193
207
|
],
|
194
208
|
**(
|
195
209
|
{
|
196
|
-
"id":
|
197
|
-
|
198
|
-
|
210
|
+
"id": (
|
211
|
+
create_id_from_string(row[0])
|
212
|
+
if assign_ids_to_rows
|
213
|
+
and create_id_from_string(row[0])
|
214
|
+
else {}
|
215
|
+
)
|
199
216
|
}
|
200
217
|
),
|
201
218
|
)
|
@@ -205,17 +222,22 @@ def table_from_polars_dataframe(
|
|
205
222
|
html.Td(
|
206
223
|
cell,
|
207
224
|
className="govuk-table__cell",
|
208
|
-
style=
|
209
|
-
|
210
|
-
|
225
|
+
style=(
|
226
|
+
{"text-align": "right"}
|
227
|
+
if column_name in columns_to_right_align
|
228
|
+
else {}
|
229
|
+
),
|
211
230
|
)
|
212
231
|
for cell, column_name in zip(row, dataframe.columns)
|
213
232
|
],
|
214
233
|
**(
|
215
234
|
{
|
216
|
-
"id":
|
217
|
-
|
218
|
-
|
235
|
+
"id": (
|
236
|
+
create_id_from_string(row[0])
|
237
|
+
if assign_ids_to_rows
|
238
|
+
and create_id_from_string(row[0])
|
239
|
+
else {}
|
240
|
+
)
|
219
241
|
}
|
220
242
|
),
|
221
243
|
)
|
@@ -69,21 +69,29 @@ def display_chart_or_table_with_header(
|
|
69
69
|
[
|
70
70
|
html.Div(
|
71
71
|
[
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
72
|
+
(
|
73
|
+
create_download_button_with_icon(
|
74
|
+
"Download chart", download_button_id, instance
|
75
|
+
)
|
76
|
+
if download_button_id
|
77
|
+
else []
|
78
|
+
),
|
79
|
+
(
|
80
|
+
create_download_button_with_icon(
|
81
|
+
"Download map", download_map_button_id, instance
|
82
|
+
)
|
83
|
+
if download_map_button_id
|
84
|
+
else []
|
85
|
+
),
|
86
|
+
(
|
87
|
+
create_download_button_with_icon(
|
88
|
+
"Download data",
|
89
|
+
download_data_button_id,
|
90
|
+
instance,
|
91
|
+
)
|
92
|
+
if download_data_button_id
|
93
|
+
else []
|
94
|
+
),
|
87
95
|
],
|
88
96
|
className="govuk-button-group",
|
89
97
|
style={"padding-top": "20px"},
|
@@ -1,4 +1,5 @@
|
|
1
1
|
"""get_chart_for_download"""
|
2
|
+
|
2
3
|
from gov_uk_dashboards.constants import MAIN_TITLE, SUBTITLE
|
3
4
|
|
4
5
|
|
@@ -17,20 +18,22 @@ def get_chart_for_download(self, fig):
|
|
17
18
|
title_subtitle={
|
18
19
|
"text": f"<b><span style='color: black; margin: 0px 0px 5px'>{subtitle}</span></b>"
|
19
20
|
},
|
20
|
-
annotations=
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
21
|
+
annotations=(
|
22
|
+
[
|
23
|
+
{
|
24
|
+
"text": f"<span style='color: black; font-size: 18px;'>{footnote}</span>",
|
25
|
+
"x": -0.01,
|
26
|
+
"y": -0.4, # Bottom of the plotting area
|
27
|
+
"xref": "paper",
|
28
|
+
"yref": "paper",
|
29
|
+
"xanchor": "left",
|
30
|
+
"yanchor": "top",
|
31
|
+
"showarrow": False,
|
32
|
+
"align": "left",
|
33
|
+
}
|
34
|
+
]
|
35
|
+
if footnote is not None
|
36
|
+
else []
|
37
|
+
),
|
35
38
|
)
|
36
39
|
return fig
|
@@ -1,4 +1,5 @@
|
|
1
1
|
"""captioned_figure function"""
|
2
|
+
|
2
3
|
from typing import Any, Optional, Union
|
3
4
|
import plotly
|
4
5
|
import dash
|
@@ -67,9 +68,11 @@ def captioned_figure(
|
|
67
68
|
dash.html.Figcaption(
|
68
69
|
children=captions,
|
69
70
|
id=f"{figure_name}-caption",
|
70
|
-
className=
|
71
|
-
|
72
|
-
|
71
|
+
className=(
|
72
|
+
"govuk-visually-hidden-desktop-only"
|
73
|
+
if desktop_only
|
74
|
+
else "govuk-visually-hidden"
|
75
|
+
),
|
73
76
|
),
|
74
77
|
]
|
75
78
|
)
|
@@ -1,4 +1,5 @@
|
|
1
1
|
"""download_csv_with_headers"""
|
2
|
+
|
2
3
|
import io
|
3
4
|
import polars as pl
|
4
5
|
from dash import dcc
|
@@ -11,6 +12,7 @@ def download_csv_with_headers(
|
|
11
12
|
list_of_df_title_subtitle_dicts: list[dict[str, str]],
|
12
13
|
name: str,
|
13
14
|
sensitivity_label: str,
|
15
|
+
last_updated_date: str = None,
|
14
16
|
additional_text: list[str] = None,
|
15
17
|
): # pylint: disable=too-many-locals
|
16
18
|
"""Adds a header above multiple dataframes,
|
@@ -21,6 +23,7 @@ def download_csv_with_headers(
|
|
21
23
|
"title" and "subtitle"
|
22
24
|
name (str): Filename for CSV.
|
23
25
|
sensitivity_label (str): Sensitivity label. Str or None.
|
26
|
+
last_updated_date (str): Date data was last updated.
|
24
27
|
additional_text (list[str]): Additional text to inlcude in headers after data downloaded.
|
25
28
|
Str or None.
|
26
29
|
"""
|
@@ -41,6 +44,12 @@ def download_csv_with_headers(
|
|
41
44
|
footnote = list_of_df_title_subtitle_dicts[0].get("footnote")
|
42
45
|
header_data = [
|
43
46
|
{column_list[0]: "Date downloaded: " + get_todays_date_for_downloaded_csv()},
|
47
|
+
(
|
48
|
+
{column_list[0]: "Last updated: " + last_updated_date}
|
49
|
+
if last_updated_date
|
50
|
+
else None
|
51
|
+
),
|
52
|
+
{column_list[0]: None},
|
44
53
|
*(
|
45
54
|
[{column_list[0]: text} for text in additional_text]
|
46
55
|
+ [{column_list[0]: None}]
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: gov_uk_dashboards
|
3
|
-
Version:
|
3
|
+
Version: 25.0.0
|
4
4
|
Summary: Provides access to functionality common to creating a data dashboard.
|
5
5
|
Author: Department for Levelling Up, Housing and Communities
|
6
6
|
Description-Content-Type: text/markdown
|
@@ -10,7 +10,7 @@ setup(
|
|
10
10
|
author="Department for Levelling Up, Housing and Communities",
|
11
11
|
description="Provides access to functionality common to creating a data dashboard.",
|
12
12
|
name="gov_uk_dashboards",
|
13
|
-
version="
|
13
|
+
version="25.0.0",
|
14
14
|
long_description=long_description,
|
15
15
|
long_description_content_type="text/markdown",
|
16
16
|
packages=find_packages(),
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/assets/dashboard.css
RENAMED
File without changes
|
{gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/assets/download-map.js
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/assets/mobile-nav.js
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/components/dash/__init__.py
RENAMED
File without changes
|
File without changes
|
{gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/components/dash/header.py
RENAMED
File without changes
|
{gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/components/dash/navbar.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/components/plotly/enums.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/figures/line_chart.py
RENAMED
File without changes
|
{gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/formatting/__init__.py
RENAMED
File without changes
|
File without changes
|
{gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/formatting/rounding.py
RENAMED
File without changes
|
{gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/formatting/text_functions.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/lib/enable_basic_auth.py
RENAMED
File without changes
|
File without changes
|
{gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards.egg-info/SOURCES.txt
RENAMED
File without changes
|
File without changes
|
{gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards.egg-info/requires.txt
RENAMED
File without changes
|
{gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards.egg-info/top_level.txt
RENAMED
File without changes
|
File without changes
|