gov-uk-dashboards 16.0.0__py3-none-any.whl → 16.1.0__py3-none-any.whl

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.
@@ -20,7 +20,7 @@ def get_legend_configuration(itemclick=True, itemdoubleclick=True):
20
20
  "y": -0.22,
21
21
  "yanchor": "top",
22
22
  "traceorder": "normal",
23
- "orientation": "v",
23
+ "orientation": "h",
24
24
  "font": {"size": CHART_LABEL_FONT_SIZE},
25
25
  "itemclick": "toggle" if itemclick else False,
26
26
  "itemdoubleclick": "toggle" if itemdoubleclick else False,
@@ -13,6 +13,7 @@ from gov_uk_dashboards.constants import (
13
13
  DATE_VALID,
14
14
  FINANCIAL_YEAR_ENDING,
15
15
  HOVER_TEXT_HEADERS,
16
+ LEGEND_SPACING,
16
17
  MAIN_TITLE,
17
18
  MEASURE,
18
19
  SUBTITLE,
@@ -157,7 +158,7 @@ class StackedBarChart:
157
158
  customdata=self._get_custom_data(self.line_trace_name, df),
158
159
  mode="lines",
159
160
  line={"color": colour, "width": 3},
160
- name=self.line_trace_name,
161
+ name=self.line_trace_name + LEGEND_SPACING,
161
162
  hovertemplate=self._get_hover_template(self.line_trace_name),
162
163
  legendrank=99999, # a high number to ensure it is bottom of the legend
163
164
  )
@@ -214,7 +215,7 @@ class StackedBarChart:
214
215
  return go.Bar(
215
216
  x=df[self.x_axis_column],
216
217
  y=df[self.y_axis_column],
217
- name=trace_name,
218
+ name=trace_name + LEGEND_SPACING,
218
219
  hovertemplate=[
219
220
  self._get_hover_template(trace_name) for i in range(df.shape[0])
220
221
  ],
@@ -13,6 +13,7 @@ from gov_uk_dashboards.constants import (
13
13
  CUSTOM_DATA,
14
14
  DATE_VALID,
15
15
  HOVER_TEXT_HEADERS,
16
+ LEGEND_SPACING,
16
17
  MAIN_TITLE,
17
18
  REMOVE_INITIAL_MARKER,
18
19
  SUBTITLE,
@@ -76,6 +77,7 @@ class TimeSeriesChart:
76
77
  download_data_button_id: Optional[str] = None,
77
78
  number_of_traces_colour_shift_dict: Optional[dict] = None,
78
79
  additional_line: Optional[dict] = None,
80
+ hover_distance: Optional[int] = 1,
79
81
  ):
80
82
  self.title_data = title_data
81
83
  self.y_axis_column = y_column
@@ -103,6 +105,7 @@ class TimeSeriesChart:
103
105
  self.markers = ["square", "diamond", "circle", "triangle-up"]
104
106
  self.number_of_traces_colour_shift_dict = number_of_traces_colour_shift_dict
105
107
  self.additional_line = additional_line
108
+ self.hover_distance = hover_distance
106
109
  self.colour_list = self._get_colour_list()
107
110
  self.fig = self.create_time_series_chart()
108
111
 
@@ -226,7 +229,7 @@ class TimeSeriesChart:
226
229
  AFAccessibleColours.TURQUOISE.value, alpha=0.2
227
230
  ),
228
231
  line={"color": "rgba(255,255,255,0)"},
229
- name=self.filled_traces_dict["name"],
232
+ name=self.filled_traces_dict["name"] + LEGEND_SPACING,
230
233
  hovertemplate=hover_text_full,
231
234
  hoveron="points",
232
235
  )
@@ -281,10 +284,10 @@ class TimeSeriesChart:
281
284
  xref="x domain",
282
285
  yref="y domain",
283
286
  x=1,
284
- y=-0.25,
287
+ y=-0.2,
285
288
  text=self.x_axis_title,
286
289
  showarrow=False,
287
- font={"size": CHART_LABEL_FONT_SIZE},
290
+ font={"size": 16},
288
291
  )
289
292
 
290
293
  fig.update_layout(
@@ -292,7 +295,7 @@ class TimeSeriesChart:
292
295
  font={"size": CHART_LABEL_FONT_SIZE},
293
296
  yaxis_tickformat=",",
294
297
  hovermode="x unified" if self.x_unified_hovermode is True else "closest",
295
- hoverdistance=1, # Increase distance to simulate hover 'always on'
298
+ hoverdistance=self.hover_distance, # Increase distance to simulate hover 'always on'
296
299
  )
297
300
  return fig
298
301
 
@@ -328,7 +331,7 @@ class TimeSeriesChart:
328
331
  x=df[self.x_axis_column],
329
332
  y=df[self.y_axis_column],
330
333
  line=line_style,
331
- name=self._get_trace_name(trace_name),
334
+ name=self._get_trace_name(trace_name) + LEGEND_SPACING,
332
335
  hovertemplate=self._get_hover_template(df, trace_name),
333
336
  customdata=self._get_custom_data(df, trace_name),
334
337
  marker=marker,
@@ -16,3 +16,5 @@ YEAR = "Year"
16
16
 
17
17
  UNIT_SIZE = "Unit size"
18
18
  DEFAULT_COLOURSCALE = "tealgrn"
19
+
20
+ LEGEND_SPACING = "\u00A0" * 5
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: gov_uk_dashboards
3
- Version: 16.0.0
3
+ Version: 16.1.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
@@ -1,7 +1,7 @@
1
1
  gov_uk_dashboards/__init__.py,sha256=4y4hozrL4hzRUna8b22UQwtkZcvvCgeXsAtA6AJww8g,1299
2
2
  gov_uk_dashboards/axes.py,sha256=Oh8zyWzxwZWq8bQl-vJoXwTANZ7ACZiYPmIXlM62Fvk,712
3
3
  gov_uk_dashboards/colours.py,sha256=MezFI_3hgEuZ7f8F5TdtgaQO00B3G7ylRTCVq3SlSF4,2371
4
- gov_uk_dashboards/constants.py,sha256=o29g1rKeZ7ZZi-cKpmFtiTU6QBK6wm0PGHKVPn1rPFw,480
4
+ gov_uk_dashboards/constants.py,sha256=kGM1gSoViFfYAYvVXg52fFqXvZ1Df5wEsamZMh0_h6w,511
5
5
  gov_uk_dashboards/symbols.py,sha256=6_lq8yl1l7sGUlOY29wip_PXeUUoM53_fakKY1omVwY,424
6
6
  gov_uk_dashboards/template.html,sha256=uFAki9bEpcei5dP_NZYP8dsxpxXpNIDQPn7ezsE7VXc,498
7
7
  gov_uk_dashboards/template.py,sha256=WNVkAW3LCNoUHcxQ1kiUPkGCKIan5DgZQaAA_ZbE5WA,534
@@ -72,14 +72,14 @@ gov_uk_dashboards/components/dash/warning_text.py,sha256=31XvPUINt2QsWIaaMnqEvn2
72
72
  gov_uk_dashboards/components/helpers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
73
73
  gov_uk_dashboards/components/helpers/display_chart_or_table_with_header.py,sha256=7Z52uZGrs15Q31OJjztnF0iqA5VRUrfJB_nPy6aZMMc,3060
74
74
  gov_uk_dashboards/components/helpers/generate_dash_graph_from_figure.py,sha256=sdhC6Mjfw6kqs1MDRDoMuOt8dNS9Bl1WEoJX9S5AssA,1813
75
- gov_uk_dashboards/components/helpers/plotting_helper_functions.py,sha256=8OMplDZSc0yPI6KjcHzBsV1hA35I6b09fKCiByfAFtY,1635
75
+ gov_uk_dashboards/components/helpers/plotting_helper_functions.py,sha256=moD2tse2FqTBW2rOHOvZCL9BIlmDbyvU5233yFFu_aI,1635
76
76
  gov_uk_dashboards/components/helpers/update_layout_bgcolor_margin.py,sha256=i7Nwp0CxFpkyQeR8KfOBVMBkzctG7hMpWI2OzgxB2jY,740
77
77
  gov_uk_dashboards/components/plotly/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
78
78
  gov_uk_dashboards/components/plotly/captioned_figure.py,sha256=T0sbtGTiJ79FXxVdPb__hqISuyTc3Dl11cKhgcuW-5U,2804
79
79
  gov_uk_dashboards/components/plotly/choropleth_map.py,sha256=U9RmS3MZGloQAt9HoSYh3Xad205DDfZOjz91ZD_ydbI,9849
80
80
  gov_uk_dashboards/components/plotly/enums.py,sha256=ebHiFQljA7O4HJxKoslqlNXcAjUZi1askpTSwxKEcYQ,850
81
- gov_uk_dashboards/components/plotly/stacked_barchart.py,sha256=y2XOf96tMfy5ythPb5RzqW5qGc2sKU3W508UbWO2iC0,12175
82
- gov_uk_dashboards/components/plotly/time_series_chart.py,sha256=Hqs4LW99ymUIVQvkQZtYRAiPZpEBa84Z9Jjpz_p12VU,21900
81
+ gov_uk_dashboards/components/plotly/stacked_barchart.py,sha256=_81WlxelE5Gxozj80uYRIkQJLyv2i6xZr2T0g3db4ks,12229
82
+ gov_uk_dashboards/components/plotly/time_series_chart.py,sha256=flZT0PfEaFftk6icS6GJ_iN8i3JR5mr9VbvDFfe2MBg,22040
83
83
  gov_uk_dashboards/figures/__init__.py,sha256=_snQeNlM81nNKERl4gg9ScH2HYbtwaBjl8yQonccx34,712
84
84
  gov_uk_dashboards/figures/chart_data.py,sha256=fEsNkQFzXKIQ0h7aLBWq3J1qAxHbxvJeKU23JrVodVc,757
85
85
  gov_uk_dashboards/figures/line_chart.py,sha256=rEB51_z9cPl7BcT94iA6ZsZXzecnVCnGpQWW_9SNGUY,2813
@@ -100,8 +100,8 @@ gov_uk_dashboards/lib/dap/dap_deployment.py,sha256=ZXixeOAtRNjMsPdGKLwwLNamlo0mi
100
100
  gov_uk_dashboards/lib/dap/get_dataframe_from_cds.py,sha256=OiusRCgYnkBjK_GZgYLGzNrxOGizYt8CgThiWRCVKK0,3921
101
101
  gov_uk_dashboards/lib/datetime_functions/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
102
102
  gov_uk_dashboards/lib/datetime_functions/datetime_functions.py,sha256=BQgr8I_vFNYwLi-fE4YC6jZ5PpbPea2rnD_2a_lw0YE,12209
103
- gov_uk_dashboards-16.0.0.dist-info/licenses/LICENSE,sha256=GDiD7Y2Gx7JucPV1JfVySJeah-qiSyBPdpJ6RHCEHTc,1126
104
- gov_uk_dashboards-16.0.0.dist-info/METADATA,sha256=0ftn3jstpqyF2k913ym1UarZusc0cteZjJgOcVgW3YE,5917
105
- gov_uk_dashboards-16.0.0.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
106
- gov_uk_dashboards-16.0.0.dist-info/top_level.txt,sha256=gPaN1P3-H3Rgi2me6tt-fX_cxo19CZfA4PjlZPjGRpo,18
107
- gov_uk_dashboards-16.0.0.dist-info/RECORD,,
103
+ gov_uk_dashboards-16.1.0.dist-info/licenses/LICENSE,sha256=GDiD7Y2Gx7JucPV1JfVySJeah-qiSyBPdpJ6RHCEHTc,1126
104
+ gov_uk_dashboards-16.1.0.dist-info/METADATA,sha256=-9RYFzZ15FbJuBYvP_VQNbeCeJxvvxlq8DGYjllddt8,5917
105
+ gov_uk_dashboards-16.1.0.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
106
+ gov_uk_dashboards-16.1.0.dist-info/top_level.txt,sha256=gPaN1P3-H3Rgi2me6tt-fX_cxo19CZfA4PjlZPjGRpo,18
107
+ gov_uk_dashboards-16.1.0.dist-info/RECORD,,