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.
Files changed (123) hide show
  1. {gov_uk_dashboards-24.1.1/gov_uk_dashboards.egg-info → gov_uk_dashboards-25.0.0}/PKG-INFO +1 -1
  2. {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/__init__.py +1 -0
  3. {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/assets/__init__.py +1 -0
  4. {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/assets/get_assets_folder.py +1 -0
  5. {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/axes.py +1 -0
  6. {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/colours.py +1 -0
  7. {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/components/__init__.py +1 -0
  8. {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
  9. {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/components/dash/banners.py +1 -0
  10. {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/components/dash/card.py +1 -0
  11. {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/components/dash/card_full_width.py +1 -0
  12. {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/components/dash/collapsible_panel.py +1 -0
  13. {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/components/dash/comparison_la_filter_button.py +1 -0
  14. {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/components/dash/context_banner.py +1 -0
  15. {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/components/dash/details.py +1 -0
  16. {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/components/dash/download_button.py +1 -0
  17. {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/components/dash/filter_panel.py +1 -0
  18. {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/components/dash/footer.py +25 -14
  19. {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/components/dash/graph.py +1 -0
  20. {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/components/dash/heading.py +1 -0
  21. {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/components/dash/home_page_link_button.py +4 -3
  22. {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/components/dash/html_list.py +1 -0
  23. {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/components/dash/key_value_pair.py +1 -0
  24. {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/components/dash/main_content.py +1 -0
  25. {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/components/dash/notification_banner.py +1 -0
  26. {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/components/dash/paragraph.py +1 -0
  27. {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/components/dash/phase_banner.py +6 -3
  28. {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/components/dash/row_component.py +1 -0
  29. {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/components/dash/table.py +48 -26
  30. {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/components/dash/tooltip.py +1 -0
  31. {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/components/dash/tooltip_title.py +1 -0
  32. {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/components/dash/visualisation_commentary.py +1 -0
  33. {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/components/dash/visualisation_title.py +1 -0
  34. {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/components/dash/warning_text.py +1 -0
  35. {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
  36. {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/components/helpers/get_chart_for_download.py +18 -15
  37. {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/components/helpers/plotting_helper_functions.py +0 -1
  38. {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/components/plotly/captioned_figure.py +6 -3
  39. {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/constants.py +1 -1
  40. {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/figures/__init__.py +1 -0
  41. {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/figures/chart_data.py +1 -0
  42. {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/figures/enums/__init__.py +1 -0
  43. {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/figures/enums/dash_patterns.py +1 -0
  44. {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/figures/styles/__init__.py +1 -0
  45. {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/figures/styles/line_style.py +1 -0
  46. {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/formatting/human_readable.py +1 -0
  47. {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
  48. {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/lib/dap/dap_deployment.py +1 -0
  49. {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/lib/dap/get_dataframe_from_cds.py +2 -1
  50. {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
  51. {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/lib/http_headers.py +0 -1
  52. {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/lib/logging.py +1 -0
  53. {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/symbols.py +1 -0
  54. {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/template.py +1 -0
  55. {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0/gov_uk_dashboards.egg-info}/PKG-INFO +1 -1
  56. {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/setup.py +1 -1
  57. {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/LICENSE +0 -0
  58. {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/MANIFEST.in +0 -0
  59. {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/README.md +0 -0
  60. {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/assets/attach-event-to-dash.js +0 -0
  61. {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/assets/custom_map_style_functions.js +0 -0
  62. {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/assets/dashboard.css +0 -0
  63. {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/assets/download-map.js +0 -0
  64. {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/assets/fonts/bold-affa96571d-v2.woff +0 -0
  65. {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/assets/fonts/bold-b542beb274-v2.woff2 +0 -0
  66. {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/assets/fonts/light-94a07e06a1-v2.woff2 +0 -0
  67. {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/assets/fonts/light-f591b13f7d-v2.woff +0 -0
  68. {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
  69. {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
  70. {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/assets/images/MHCLG-favicon.png +0 -0
  71. {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/assets/images/MHCLG_favicon.png +0 -0
  72. {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/assets/images/dcms_coatofarms.png +0 -0
  73. {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/assets/images/dluhc_favicon.ico +0 -0
  74. {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/assets/images/gov_favicon.ico +0 -0
  75. {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/assets/images/govuk-crest.svg +0 -0
  76. {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/assets/images/hm-government-logo.png +0 -0
  77. {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/assets/images/mhclg_coat_of_arms.png +0 -0
  78. {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/assets/images/mhclg_white_no_background.png +0 -0
  79. {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/assets/images/oflog/MedianAbsolute.png +0 -0
  80. {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
  81. {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
  82. {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
  83. {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
  84. {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
  85. {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/assets/index.html +0 -0
  86. {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/assets/mobile-nav.js +0 -0
  87. {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/assets/scripts.js +0 -0
  88. {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/assets/topojson/usa_110m.json +0 -0
  89. {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/assets/topojson/world_110m.json +0 -0
  90. {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/components/dash/__init__.py +0 -0
  91. {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/components/dash/dashboard_container.py +0 -0
  92. {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/components/dash/header.py +0 -0
  93. {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/components/dash/navbar.py +0 -0
  94. {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/components/dash/no_data_message.py +0 -0
  95. {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/components/dash/side_navbar.py +0 -0
  96. {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/components/helpers/__init__.py +0 -0
  97. {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
  98. {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/components/helpers/update_layout_bgcolor_margin.py +0 -0
  99. {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/components/leaflet/__init__.py +0 -0
  100. {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/components/leaflet/leaflet_choropleth_map.py +0 -0
  101. {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/components/plotly/__init__.py +0 -0
  102. {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/components/plotly/choropleth_map.py +0 -0
  103. {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/components/plotly/enums.py +0 -0
  104. {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/components/plotly/stacked_barchart.py +0 -0
  105. {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/components/plotly/time_series_chart.py +0 -0
  106. {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/figures/line_chart.py +0 -0
  107. {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/formatting/__init__.py +0 -0
  108. {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/formatting/number_formatting.py +0 -0
  109. {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/formatting/rounding.py +0 -0
  110. {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/formatting/text_functions.py +0 -0
  111. {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/lib/__init__.py +0 -0
  112. {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/lib/dap/__init__.py +0 -0
  113. {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/lib/datetime_functions/__init__.py +0 -0
  114. {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/lib/datetime_functions/datetime_functions.py +0 -0
  115. {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/lib/download_functions/__init__.py +0 -0
  116. {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
  117. {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/lib/enable_basic_auth.py +0 -0
  118. {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards/template.html +0 -0
  119. {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards.egg-info/SOURCES.txt +0 -0
  120. {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards.egg-info/dependency_links.txt +0 -0
  121. {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards.egg-info/requires.txt +0 -0
  122. {gov_uk_dashboards-24.1.1 → gov_uk_dashboards-25.0.0}/gov_uk_dashboards.egg-info/top_level.txt +0 -0
  123. {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: 24.1.1
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
@@ -22,6 +22,7 @@ Contains the following modules:
22
22
  Contains the following function:
23
23
  - read_template: Return the government html template as a str for Plotly.
24
24
  """
25
+
25
26
  from . import components
26
27
  from . import figures
27
28
  from . import axes
@@ -1,2 +1,3 @@
1
1
  """Module containing the shared front end assets"""
2
+
2
3
  from .get_assets_folder import get_assets_folder
@@ -5,6 +5,7 @@ Contains:
5
5
  axis is at the origin or the lowest negative value in the column, whichever
6
6
  is lower.
7
7
  """
8
+
8
9
  # from math import floor, ceil
9
10
 
10
11
  # import pandas as pd
@@ -5,6 +5,7 @@ Contains:
5
5
  https://design-system.service.gov.uk/styles/colour/
6
6
  - ONSAccessibleColours: ONS colours taken from the Subnational Indicators Explorer.
7
7
  """
8
+
8
9
  from enum import Enum
9
10
 
10
11
 
@@ -4,4 +4,5 @@ using different systems.
4
4
  Contains:
5
5
  - plotly: Module containing Plotly/Dash components
6
6
  """
7
+
7
8
  from . import dash
@@ -1,4 +1,5 @@
1
1
  """apply_and_reset_filters_buttons"""
2
+
2
3
  from dash import html
3
4
 
4
5
 
@@ -1,4 +1,5 @@
1
1
  """HTML components for displaying messages to the user in a banner format"""
2
+
2
3
  from dash import html
3
4
 
4
5
 
@@ -1,4 +1,5 @@
1
1
  """comparison_la_filter_button"""
2
+
2
3
  from dash import html
3
4
 
4
5
 
@@ -1,4 +1,5 @@
1
1
  """download_button"""
2
+
2
3
  from typing import Union
3
4
  import warnings
4
5
  from dash import html
@@ -1,4 +1,5 @@
1
1
  """filter_panel"""
2
+
2
3
  from typing import Optional
3
4
  from dash import html
4
5
 
@@ -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
- html.H2("Support Links", className="govuk-visually-hidden")
26
- if footer_links
27
- else None,
28
- html.Ul(
29
- children=[
30
- html.Li(
31
- item, className="govuk-footer__inline-list-item"
32
- )
33
- for item in footer_links
34
- ],
35
- className="govuk-footer__inline-list govuk-!-display-none-print",
36
- )
37
- if footer_links
38
- else None,
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
  """Create a graph"""
2
+
2
3
  import warnings
3
4
  from dash import dcc
4
5
 
@@ -1,4 +1,5 @@
1
1
  """heading components"""
2
+
2
3
  from enum import Enum
3
4
 
4
5
  from dash import html
@@ -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="govuk-heading-l"
47
- if info is not None
48
- else None,
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
  """html list component"""
2
+
2
3
  from dash import html
3
4
 
4
5
 
@@ -1,4 +1,5 @@
1
1
  """key_value_pair"""
2
+
2
3
  import numpy as np
3
4
  from dash import html
4
5
 
@@ -1,4 +1,5 @@
1
1
  """notification_banner"""
2
+
2
3
  from dash import html
3
4
 
4
5
 
@@ -1,4 +1,5 @@
1
1
  """paragraph component"""
2
+
2
3
  from enum import Enum
3
4
  from typing import Union
4
5
 
@@ -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="noopener noreferrer"
35
- if link_target == "_blank"
36
- else "", # conditional attribute for security
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
  ],
@@ -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
- html.Button(
116
- dcc.Markdown(header)
117
- if format_column_headers_as_markdown
118
- else header,
119
- id={"type": f"{table_id}-header-button", "index": idx},
120
- n_clicks=0,
121
- )
122
- if header not in non_sortable_columns
123
- else dcc.Markdown(header)
124
- if format_column_headers_as_markdown
125
- else header,
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
- dcc.Markdown(header)
146
- if format_column_headers_as_markdown
147
- else header,
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={"text-align": "right"}
189
- if column_name in columns_to_right_align
190
- else {},
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": create_id_from_string(row[0])
197
- if assign_ids_to_rows and create_id_from_string(row[0])
198
- else {}
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={"text-align": "right"}
209
- if column_name in columns_to_right_align
210
- else {},
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": create_id_from_string(row[0])
217
- if assign_ids_to_rows and create_id_from_string(row[0])
218
- else {}
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
  )
@@ -1,4 +1,5 @@
1
1
  """tooltip"""
2
+
2
3
  from dash import html
3
4
  import dash_bootstrap_components as dbc
4
5
 
@@ -1,4 +1,5 @@
1
1
  """tooltip_title"""
2
+
2
3
  from dash import html
3
4
  import dash_bootstrap_components as dbc
4
5
 
@@ -1,4 +1,5 @@
1
1
  """format_visualisation_commentary"""
2
+
2
3
  from dash import html
3
4
 
4
5
 
@@ -1,4 +1,5 @@
1
1
  """format_visualisation_title"""
2
+
2
3
  from dash import html
3
4
 
4
5
 
@@ -69,21 +69,29 @@ def display_chart_or_table_with_header(
69
69
  [
70
70
  html.Div(
71
71
  [
72
- create_download_button_with_icon(
73
- "Download chart", download_button_id, instance
74
- )
75
- if download_button_id
76
- else [],
77
- create_download_button_with_icon(
78
- "Download map", download_map_button_id, instance
79
- )
80
- if download_map_button_id
81
- else [],
82
- create_download_button_with_icon(
83
- "Download data", download_data_button_id, instance
84
- )
85
- if download_data_button_id
86
- else [],
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
- "text": f"<span style='color: black; font-size: 18px;'>{footnote}</span>",
23
- "x": -0.01,
24
- "y": -0.4, # Bottom of the plotting area
25
- "xref": "paper",
26
- "yref": "paper",
27
- "xanchor": "left",
28
- "yanchor": "top",
29
- "showarrow": False,
30
- "align": "left",
31
- }
32
- ]
33
- if footnote is not None
34
- else [],
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,6 +1,5 @@
1
1
  """Helper functions for use to plot charts"""
2
2
 
3
-
4
3
  from gov_uk_dashboards.constants import CHART_LABEL_FONT_SIZE
5
4
 
6
5
 
@@ -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="govuk-visually-hidden-desktop-only"
71
- if desktop_only
72
- else "govuk-visually-hidden",
71
+ className=(
72
+ "govuk-visually-hidden-desktop-only"
73
+ if desktop_only
74
+ else "govuk-visually-hidden"
75
+ ),
73
76
  ),
74
77
  ]
75
78
  )
@@ -17,7 +17,7 @@ YEAR = "Year"
17
17
  UNIT_SIZE = "Unit size"
18
18
  DEFAULT_COLOURSCALE = "tealgrn"
19
19
 
20
- LEGEND_SPACING = "\u00A0" * 5
20
+ LEGEND_SPACING = "\u00a0" * 5
21
21
 
22
22
  DOWNLOAD_BUTTON_CLASSES = (
23
23
  "govuk-button govuk-button--primary "
@@ -11,6 +11,7 @@ Contains:
11
11
  - LineStyle: Dataclass containing information on how to style a line on a line
12
12
  chart.
13
13
  """
14
+
14
15
  from . import enums
15
16
  from . import styles
16
17
 
@@ -1,4 +1,5 @@
1
1
  """ChartData dataclass"""
2
+
2
3
  # from dataclasses import dataclass
3
4
  # from typing import Optional
4
5
 
@@ -3,4 +3,5 @@
3
3
  Contains:
4
4
  - DashPatterns: Sets out valid dash patterns used by plotly/plotly express.
5
5
  """
6
+
6
7
  from .dash_patterns import DashPatterns
@@ -1,4 +1,5 @@
1
1
  """DashPatterns enum"""
2
+
2
3
  from enum import Enum
3
4
 
4
5
 
@@ -4,4 +4,5 @@ Contains:
4
4
  - LineStyle: Dataclass containing information on how to style a line on a line
5
5
  chart.
6
6
  """
7
+
7
8
  from .line_style import LineStyle
@@ -1,4 +1,5 @@
1
1
  """LineStyle dataclass"""
2
+
2
3
  from dataclasses import dataclass
3
4
  from typing import Union
4
5
  from ..enums.dash_patterns import DashPatterns
@@ -1,4 +1,5 @@
1
1
  """Functions for converting values to human readable format."""
2
+
2
3
  import math
3
4
  from typing import Optional
4
5
 
@@ -2,6 +2,7 @@
2
2
  Function to add a prefix and suffix to a number and also show the number of decimal places
3
3
  specified.
4
4
  """
5
+
5
6
  import math
6
7
  import decimal
7
8
 
@@ -2,6 +2,7 @@
2
2
  Scripts for deploying dashboard code to the DLUHC DAP Hosting Area.
3
3
  The DAP Hosting area is maintained by the DLUHC DAP Support team.
4
4
  """
5
+
5
6
  import subprocess
6
7
  import tempfile
7
8
 
@@ -1,4 +1,5 @@
1
- """ Returns a dataframe after connecting to CDS, otherwise uses a csv already saved in the file"""
1
+ """Returns a dataframe after connecting to CDS, otherwise uses a csv already saved in the file"""
2
+
2
3
  # import os
3
4
  # import json
4
5
  # import pyodbc
@@ -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,5 @@
1
1
  """http_headers"""
2
2
 
3
-
4
3
  import os
5
4
  import dash
6
5
 
@@ -1,4 +1,5 @@
1
1
  """Module for logging configuration"""
2
+
2
3
  import os
3
4
 
4
5
  import logging
@@ -4,6 +4,7 @@ Contains:
4
4
  - Symbols from the Plotly graphing library
5
5
  https://plotly.com/python/marker-style/#custom-marker-symbols
6
6
  """
7
+
7
8
  from enum import Enum
8
9
 
9
10
 
@@ -1,6 +1,7 @@
1
1
  """
2
2
  Read government dashboard template
3
3
  """
4
+
4
5
  import os
5
6
 
6
7
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: gov_uk_dashboards
3
- Version: 24.1.1
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="24.1.1",
13
+ version="25.0.0",
14
14
  long_description=long_description,
15
15
  long_description_content_type="text/markdown",
16
16
  packages=find_packages(),