gov-uk-dashboards 15.0.0__tar.gz → 15.0.2__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 (112) hide show
  1. {gov_uk_dashboards-15.0.0/gov_uk_dashboards.egg-info → gov_uk_dashboards-15.0.2}/PKG-INFO +1 -1
  2. {gov_uk_dashboards-15.0.0 → gov_uk_dashboards-15.0.2}/gov_uk_dashboards/components/plotly/choropleth_map.py +20 -1
  3. {gov_uk_dashboards-15.0.0 → gov_uk_dashboards-15.0.2}/gov_uk_dashboards/components/plotly/time_series_chart.py +10 -11
  4. {gov_uk_dashboards-15.0.0 → gov_uk_dashboards-15.0.2/gov_uk_dashboards.egg-info}/PKG-INFO +1 -1
  5. {gov_uk_dashboards-15.0.0 → gov_uk_dashboards-15.0.2}/setup.py +1 -1
  6. {gov_uk_dashboards-15.0.0 → gov_uk_dashboards-15.0.2}/LICENSE +0 -0
  7. {gov_uk_dashboards-15.0.0 → gov_uk_dashboards-15.0.2}/MANIFEST.in +0 -0
  8. {gov_uk_dashboards-15.0.0 → gov_uk_dashboards-15.0.2}/README.md +0 -0
  9. {gov_uk_dashboards-15.0.0 → gov_uk_dashboards-15.0.2}/gov_uk_dashboards/__init__.py +0 -0
  10. {gov_uk_dashboards-15.0.0 → gov_uk_dashboards-15.0.2}/gov_uk_dashboards/assets/__init__.py +0 -0
  11. {gov_uk_dashboards-15.0.0 → gov_uk_dashboards-15.0.2}/gov_uk_dashboards/assets/attach-event-to-dash.js +0 -0
  12. {gov_uk_dashboards-15.0.0 → gov_uk_dashboards-15.0.2}/gov_uk_dashboards/assets/dashboard.css +0 -0
  13. {gov_uk_dashboards-15.0.0 → gov_uk_dashboards-15.0.2}/gov_uk_dashboards/assets/fonts/bold-affa96571d-v2.woff +0 -0
  14. {gov_uk_dashboards-15.0.0 → gov_uk_dashboards-15.0.2}/gov_uk_dashboards/assets/fonts/bold-b542beb274-v2.woff2 +0 -0
  15. {gov_uk_dashboards-15.0.0 → gov_uk_dashboards-15.0.2}/gov_uk_dashboards/assets/fonts/light-94a07e06a1-v2.woff2 +0 -0
  16. {gov_uk_dashboards-15.0.0 → gov_uk_dashboards-15.0.2}/gov_uk_dashboards/assets/fonts/light-f591b13f7d-v2.woff +0 -0
  17. {gov_uk_dashboards-15.0.0 → gov_uk_dashboards-15.0.2}/gov_uk_dashboards/assets/get_assets_folder.py +0 -0
  18. {gov_uk_dashboards-15.0.0 → gov_uk_dashboards-15.0.2}/gov_uk_dashboards/assets/govuk-frontend-3.14.0.min.js +0 -0
  19. {gov_uk_dashboards-15.0.0 → gov_uk_dashboards-15.0.2}/gov_uk_dashboards/assets/images/DLUHC_WHITE_Master_AW_sm.png +0 -0
  20. {gov_uk_dashboards-15.0.0 → gov_uk_dashboards-15.0.2}/gov_uk_dashboards/assets/images/MHCLG-favicon.png +0 -0
  21. {gov_uk_dashboards-15.0.0 → gov_uk_dashboards-15.0.2}/gov_uk_dashboards/assets/images/MHCLG_favicon.png +0 -0
  22. {gov_uk_dashboards-15.0.0 → gov_uk_dashboards-15.0.2}/gov_uk_dashboards/assets/images/dcms_coatofarms.png +0 -0
  23. {gov_uk_dashboards-15.0.0 → gov_uk_dashboards-15.0.2}/gov_uk_dashboards/assets/images/dluhc_favicon.ico +0 -0
  24. {gov_uk_dashboards-15.0.0 → gov_uk_dashboards-15.0.2}/gov_uk_dashboards/assets/images/gov_favicon.ico +0 -0
  25. {gov_uk_dashboards-15.0.0 → gov_uk_dashboards-15.0.2}/gov_uk_dashboards/assets/images/govuk-crest.svg +0 -0
  26. {gov_uk_dashboards-15.0.0 → gov_uk_dashboards-15.0.2}/gov_uk_dashboards/assets/images/hm-government-logo.png +0 -0
  27. {gov_uk_dashboards-15.0.0 → gov_uk_dashboards-15.0.2}/gov_uk_dashboards/assets/images/mhclg_coat_of_arms.png +0 -0
  28. {gov_uk_dashboards-15.0.0 → gov_uk_dashboards-15.0.2}/gov_uk_dashboards/assets/images/mhclg_white_no_background.png +0 -0
  29. {gov_uk_dashboards-15.0.0 → gov_uk_dashboards-15.0.2}/gov_uk_dashboards/assets/images/oflog/MedianAbsolute.png +0 -0
  30. {gov_uk_dashboards-15.0.0 → gov_uk_dashboards-15.0.2}/gov_uk_dashboards/assets/images/oflog/how_to_1_selecting_data.png +0 -0
  31. {gov_uk_dashboards-15.0.0 → gov_uk_dashboards-15.0.2}/gov_uk_dashboards/assets/images/oflog/how_to_2_viewing_tabs.png +0 -0
  32. {gov_uk_dashboards-15.0.0 → gov_uk_dashboards-15.0.2}/gov_uk_dashboards/assets/images/oflog/how_to_3_viewing_charts.png +0 -0
  33. {gov_uk_dashboards-15.0.0 → gov_uk_dashboards-15.0.2}/gov_uk_dashboards/assets/images/oflog/how_to_4_viewing_trends.png +0 -0
  34. {gov_uk_dashboards-15.0.0 → gov_uk_dashboards-15.0.2}/gov_uk_dashboards/assets/images/oflog/how_to_5_viewing_tables.png +0 -0
  35. {gov_uk_dashboards-15.0.0 → gov_uk_dashboards-15.0.2}/gov_uk_dashboards/assets/mobile-nav.js +0 -0
  36. {gov_uk_dashboards-15.0.0 → gov_uk_dashboards-15.0.2}/gov_uk_dashboards/assets/topojson/usa_110m.json +0 -0
  37. {gov_uk_dashboards-15.0.0 → gov_uk_dashboards-15.0.2}/gov_uk_dashboards/assets/topojson/world_110m.json +0 -0
  38. {gov_uk_dashboards-15.0.0 → gov_uk_dashboards-15.0.2}/gov_uk_dashboards/axes.py +0 -0
  39. {gov_uk_dashboards-15.0.0 → gov_uk_dashboards-15.0.2}/gov_uk_dashboards/colours.py +0 -0
  40. {gov_uk_dashboards-15.0.0 → gov_uk_dashboards-15.0.2}/gov_uk_dashboards/components/__init__.py +0 -0
  41. {gov_uk_dashboards-15.0.0 → gov_uk_dashboards-15.0.2}/gov_uk_dashboards/components/dash/__init__.py +0 -0
  42. {gov_uk_dashboards-15.0.0 → gov_uk_dashboards-15.0.2}/gov_uk_dashboards/components/dash/apply_and_reset_filters_buttons.py +0 -0
  43. {gov_uk_dashboards-15.0.0 → gov_uk_dashboards-15.0.2}/gov_uk_dashboards/components/dash/banners.py +0 -0
  44. {gov_uk_dashboards-15.0.0 → gov_uk_dashboards-15.0.2}/gov_uk_dashboards/components/dash/card.py +0 -0
  45. {gov_uk_dashboards-15.0.0 → gov_uk_dashboards-15.0.2}/gov_uk_dashboards/components/dash/card_full_width.py +0 -0
  46. {gov_uk_dashboards-15.0.0 → gov_uk_dashboards-15.0.2}/gov_uk_dashboards/components/dash/collapsible_panel.py +0 -0
  47. {gov_uk_dashboards-15.0.0 → gov_uk_dashboards-15.0.2}/gov_uk_dashboards/components/dash/comparison_la_filter_button.py +0 -0
  48. {gov_uk_dashboards-15.0.0 → gov_uk_dashboards-15.0.2}/gov_uk_dashboards/components/dash/context_banner.py +0 -0
  49. {gov_uk_dashboards-15.0.0 → gov_uk_dashboards-15.0.2}/gov_uk_dashboards/components/dash/create_download_chart_button.py +0 -0
  50. {gov_uk_dashboards-15.0.0 → gov_uk_dashboards-15.0.2}/gov_uk_dashboards/components/dash/create_download_data_button.py +0 -0
  51. {gov_uk_dashboards-15.0.0 → gov_uk_dashboards-15.0.2}/gov_uk_dashboards/components/dash/dashboard_container.py +0 -0
  52. {gov_uk_dashboards-15.0.0 → gov_uk_dashboards-15.0.2}/gov_uk_dashboards/components/dash/details.py +0 -0
  53. {gov_uk_dashboards-15.0.0 → gov_uk_dashboards-15.0.2}/gov_uk_dashboards/components/dash/download_button.py +0 -0
  54. {gov_uk_dashboards-15.0.0 → gov_uk_dashboards-15.0.2}/gov_uk_dashboards/components/dash/filter_panel.py +0 -0
  55. {gov_uk_dashboards-15.0.0 → gov_uk_dashboards-15.0.2}/gov_uk_dashboards/components/dash/footer.py +0 -0
  56. {gov_uk_dashboards-15.0.0 → gov_uk_dashboards-15.0.2}/gov_uk_dashboards/components/dash/graph.py +0 -0
  57. {gov_uk_dashboards-15.0.0 → gov_uk_dashboards-15.0.2}/gov_uk_dashboards/components/dash/header.py +0 -0
  58. {gov_uk_dashboards-15.0.0 → gov_uk_dashboards-15.0.2}/gov_uk_dashboards/components/dash/heading.py +0 -0
  59. {gov_uk_dashboards-15.0.0 → gov_uk_dashboards-15.0.2}/gov_uk_dashboards/components/dash/html_list.py +0 -0
  60. {gov_uk_dashboards-15.0.0 → gov_uk_dashboards-15.0.2}/gov_uk_dashboards/components/dash/key_value_pair.py +0 -0
  61. {gov_uk_dashboards-15.0.0 → gov_uk_dashboards-15.0.2}/gov_uk_dashboards/components/dash/main_content.py +0 -0
  62. {gov_uk_dashboards-15.0.0 → gov_uk_dashboards-15.0.2}/gov_uk_dashboards/components/dash/navbar.py +0 -0
  63. {gov_uk_dashboards-15.0.0 → gov_uk_dashboards-15.0.2}/gov_uk_dashboards/components/dash/no_data_message.py +0 -0
  64. {gov_uk_dashboards-15.0.0 → gov_uk_dashboards-15.0.2}/gov_uk_dashboards/components/dash/notification_banner.py +0 -0
  65. {gov_uk_dashboards-15.0.0 → gov_uk_dashboards-15.0.2}/gov_uk_dashboards/components/dash/paragraph.py +0 -0
  66. {gov_uk_dashboards-15.0.0 → gov_uk_dashboards-15.0.2}/gov_uk_dashboards/components/dash/phase_banner.py +0 -0
  67. {gov_uk_dashboards-15.0.0 → gov_uk_dashboards-15.0.2}/gov_uk_dashboards/components/dash/row_component.py +0 -0
  68. {gov_uk_dashboards-15.0.0 → gov_uk_dashboards-15.0.2}/gov_uk_dashboards/components/dash/side_navbar.py +0 -0
  69. {gov_uk_dashboards-15.0.0 → gov_uk_dashboards-15.0.2}/gov_uk_dashboards/components/dash/table.py +0 -0
  70. {gov_uk_dashboards-15.0.0 → gov_uk_dashboards-15.0.2}/gov_uk_dashboards/components/dash/tooltip.py +0 -0
  71. {gov_uk_dashboards-15.0.0 → gov_uk_dashboards-15.0.2}/gov_uk_dashboards/components/dash/tooltip_title.py +0 -0
  72. {gov_uk_dashboards-15.0.0 → gov_uk_dashboards-15.0.2}/gov_uk_dashboards/components/dash/visualisation_commentary.py +0 -0
  73. {gov_uk_dashboards-15.0.0 → gov_uk_dashboards-15.0.2}/gov_uk_dashboards/components/dash/visualisation_title.py +0 -0
  74. {gov_uk_dashboards-15.0.0 → gov_uk_dashboards-15.0.2}/gov_uk_dashboards/components/dash/warning_text.py +0 -0
  75. {gov_uk_dashboards-15.0.0 → gov_uk_dashboards-15.0.2}/gov_uk_dashboards/components/helpers/__init__.py +0 -0
  76. {gov_uk_dashboards-15.0.0 → gov_uk_dashboards-15.0.2}/gov_uk_dashboards/components/helpers/display_chart_or_table_with_header.py +0 -0
  77. {gov_uk_dashboards-15.0.0 → gov_uk_dashboards-15.0.2}/gov_uk_dashboards/components/helpers/generate_dash_graph_from_figure.py +0 -0
  78. {gov_uk_dashboards-15.0.0 → gov_uk_dashboards-15.0.2}/gov_uk_dashboards/components/helpers/plotting_helper_functions.py +0 -0
  79. {gov_uk_dashboards-15.0.0 → gov_uk_dashboards-15.0.2}/gov_uk_dashboards/components/helpers/update_layout_bgcolor_margin.py +0 -0
  80. {gov_uk_dashboards-15.0.0 → gov_uk_dashboards-15.0.2}/gov_uk_dashboards/components/plotly/__init__.py +0 -0
  81. {gov_uk_dashboards-15.0.0 → gov_uk_dashboards-15.0.2}/gov_uk_dashboards/components/plotly/captioned_figure.py +0 -0
  82. {gov_uk_dashboards-15.0.0 → gov_uk_dashboards-15.0.2}/gov_uk_dashboards/components/plotly/enums.py +0 -0
  83. {gov_uk_dashboards-15.0.0 → gov_uk_dashboards-15.0.2}/gov_uk_dashboards/components/plotly/stacked_barchart.py +0 -0
  84. {gov_uk_dashboards-15.0.0 → gov_uk_dashboards-15.0.2}/gov_uk_dashboards/constants.py +0 -0
  85. {gov_uk_dashboards-15.0.0 → gov_uk_dashboards-15.0.2}/gov_uk_dashboards/figures/__init__.py +0 -0
  86. {gov_uk_dashboards-15.0.0 → gov_uk_dashboards-15.0.2}/gov_uk_dashboards/figures/chart_data.py +0 -0
  87. {gov_uk_dashboards-15.0.0 → gov_uk_dashboards-15.0.2}/gov_uk_dashboards/figures/enums/__init__.py +0 -0
  88. {gov_uk_dashboards-15.0.0 → gov_uk_dashboards-15.0.2}/gov_uk_dashboards/figures/enums/dash_patterns.py +0 -0
  89. {gov_uk_dashboards-15.0.0 → gov_uk_dashboards-15.0.2}/gov_uk_dashboards/figures/line_chart.py +0 -0
  90. {gov_uk_dashboards-15.0.0 → gov_uk_dashboards-15.0.2}/gov_uk_dashboards/figures/styles/__init__.py +0 -0
  91. {gov_uk_dashboards-15.0.0 → gov_uk_dashboards-15.0.2}/gov_uk_dashboards/figures/styles/line_style.py +0 -0
  92. {gov_uk_dashboards-15.0.0 → gov_uk_dashboards-15.0.2}/gov_uk_dashboards/formatting/__init__.py +0 -0
  93. {gov_uk_dashboards-15.0.0 → gov_uk_dashboards-15.0.2}/gov_uk_dashboards/formatting/human_readable.py +0 -0
  94. {gov_uk_dashboards-15.0.0 → gov_uk_dashboards-15.0.2}/gov_uk_dashboards/formatting/round_and_add_prefix_and_suffix.py +0 -0
  95. {gov_uk_dashboards-15.0.0 → gov_uk_dashboards-15.0.2}/gov_uk_dashboards/formatting/rounding.py +0 -0
  96. {gov_uk_dashboards-15.0.0 → gov_uk_dashboards-15.0.2}/gov_uk_dashboards/lib/__init__.py +0 -0
  97. {gov_uk_dashboards-15.0.0 → gov_uk_dashboards-15.0.2}/gov_uk_dashboards/lib/dap/__init__.py +0 -0
  98. {gov_uk_dashboards-15.0.0 → gov_uk_dashboards-15.0.2}/gov_uk_dashboards/lib/dap/dap_deployment.py +0 -0
  99. {gov_uk_dashboards-15.0.0 → gov_uk_dashboards-15.0.2}/gov_uk_dashboards/lib/dap/get_dataframe_from_cds.py +0 -0
  100. {gov_uk_dashboards-15.0.0 → gov_uk_dashboards-15.0.2}/gov_uk_dashboards/lib/datetime_functions/__init__.py +0 -0
  101. {gov_uk_dashboards-15.0.0 → gov_uk_dashboards-15.0.2}/gov_uk_dashboards/lib/datetime_functions/datetime_functions.py +0 -0
  102. {gov_uk_dashboards-15.0.0 → gov_uk_dashboards-15.0.2}/gov_uk_dashboards/lib/enable_basic_auth.py +0 -0
  103. {gov_uk_dashboards-15.0.0 → gov_uk_dashboards-15.0.2}/gov_uk_dashboards/lib/http_headers.py +0 -0
  104. {gov_uk_dashboards-15.0.0 → gov_uk_dashboards-15.0.2}/gov_uk_dashboards/lib/logging.py +0 -0
  105. {gov_uk_dashboards-15.0.0 → gov_uk_dashboards-15.0.2}/gov_uk_dashboards/symbols.py +0 -0
  106. {gov_uk_dashboards-15.0.0 → gov_uk_dashboards-15.0.2}/gov_uk_dashboards/template.html +0 -0
  107. {gov_uk_dashboards-15.0.0 → gov_uk_dashboards-15.0.2}/gov_uk_dashboards/template.py +0 -0
  108. {gov_uk_dashboards-15.0.0 → gov_uk_dashboards-15.0.2}/gov_uk_dashboards.egg-info/SOURCES.txt +0 -0
  109. {gov_uk_dashboards-15.0.0 → gov_uk_dashboards-15.0.2}/gov_uk_dashboards.egg-info/dependency_links.txt +0 -0
  110. {gov_uk_dashboards-15.0.0 → gov_uk_dashboards-15.0.2}/gov_uk_dashboards.egg-info/requires.txt +0 -0
  111. {gov_uk_dashboards-15.0.0 → gov_uk_dashboards-15.0.2}/gov_uk_dashboards.egg-info/top_level.txt +0 -0
  112. {gov_uk_dashboards-15.0.0 → gov_uk_dashboards-15.0.2}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: gov_uk_dashboards
3
- Version: 15.0.0
3
+ Version: 15.0.2
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
@@ -210,12 +210,31 @@ class ChoroplethMap:
210
210
  },
211
211
  )
212
212
 
213
+ def _wrap_text(self, text, max_chars_per_line):
214
+ words = text.split()
215
+ lines = []
216
+ current_line = ""
217
+
218
+ for word in words:
219
+ if len(current_line) + len(word) + 1 > max_chars_per_line:
220
+ lines.append(current_line)
221
+ current_line = word
222
+ else:
223
+ if current_line:
224
+ current_line += " "
225
+ current_line += word
226
+
227
+ if current_line:
228
+ lines.append(current_line)
229
+
230
+ return "<br>".join(lines)
231
+
213
232
  def _get_color_bar(self):
214
233
  if self.discrete_map:
215
234
  return None
216
235
 
217
236
  return {
218
- "title": self.column_to_plot,
237
+ "title": self._wrap_text(self.legend_title_text, 10),
219
238
  "thickness": 20,
220
239
  "len": 0.8,
221
240
  "x": 0.9,
@@ -193,7 +193,6 @@ class TimeSeriesChart:
193
193
  # hoverinfo="skip",
194
194
  # )
195
195
  # )
196
-
197
196
  if self.verticle_line_x_value_and_name is not None:
198
197
 
199
198
  fig.add_vline(
@@ -203,7 +202,7 @@ class TimeSeriesChart:
203
202
  line_color="#b3b3b3",
204
203
  )
205
204
  fig.add_annotation(
206
- x=self.verticle_line_x_value_and_name,
205
+ x=self.verticle_line_x_value_and_name[0],
207
206
  yref="paper",
208
207
  y=0.9,
209
208
  text=self.verticle_line_x_value_and_name[1],
@@ -267,7 +266,6 @@ class TimeSeriesChart:
267
266
  hover_label (dict[str,str]): Properties for hoverlabel parameter.
268
267
  marker (dict[str,str]): Properties for marker parameter.
269
268
  """
270
-
271
269
  return go.Scatter(
272
270
  x=df[self.x_axis_column],
273
271
  y=df[self.y_axis_column],
@@ -316,6 +314,7 @@ class TimeSeriesChart:
316
314
  ][HOVER_TEXT_HEADERS]
317
315
  )
318
316
  # pylint: disable=duplicate-code
317
+
319
318
  return (
320
319
  f"{trace_name}<br>"
321
320
  f"{hover_text_headers[0]}"
@@ -332,7 +331,6 @@ class TimeSeriesChart:
332
331
  and trace_name
333
332
  in self.hover_data_for_traces_with_different_hover_for_last_point
334
333
  ):
335
-
336
334
  customdata = [
337
335
  (
338
336
  [df[col][i] for col in self.hover_data[trace_name][CUSTOM_DATA]]
@@ -368,16 +366,17 @@ class TimeSeriesChart:
368
366
  .dt.year()
369
367
  .alias(YEAR)
370
368
  )
371
-
369
+ date_list = df_with_year_column[self.x_axis_column].unique().to_list()
370
+ min_date_string = min(date_list)
371
+ max_date_string = max(date_list)
372
+ min_datetime = datetime.strptime(min_date_string, "%Y-%m-%d")
373
+ max_datetime = datetime.strptime(max_date_string, "%Y-%m-%d")
372
374
  year_list = df_with_year_column[YEAR].unique().to_list()
373
-
374
- tick_text = [min(year_list) - 1] + year_list + [max(year_list) + 1]
375
-
375
+ tick_text = list(range(min(year_list) - 1, max(year_list) + 2))
376
376
  tick_values = [date(year, 1, 1) for year in tick_text]
377
-
378
377
  range_x = [
379
- tick_values[0] + relativedelta(months=6),
380
- tick_values[-1] + relativedelta(months=6),
378
+ min_datetime - relativedelta(months=6),
379
+ max_datetime + relativedelta(months=6),
381
380
  ]
382
381
 
383
382
  elif self.xaxis_tick_text_format == XAxisFormat.MONTH_YEAR.value:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: gov_uk_dashboards
3
- Version: 15.0.0
3
+ Version: 15.0.2
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="15.0.0",
13
+ version="15.0.2",
14
14
  long_description=long_description,
15
15
  long_description_content_type="text/markdown",
16
16
  packages=find_packages(),