From 00f0e445a797f55485c0c80f1eb6c0b8a7e4b0a2 Mon Sep 17 00:00:00 2001 From: Kate Riley Date: Thu, 19 Dec 2024 15:35:57 +0000 Subject: [PATCH 1/5] wip --- gov_uk_dashboards/components/plotly/table.py | 37 ++++++++++++++------ setup.py | 2 +- 2 files changed, 27 insertions(+), 12 deletions(-) diff --git a/gov_uk_dashboards/components/plotly/table.py b/gov_uk_dashboards/components/plotly/table.py index 78b16c1..1db8211 100644 --- a/gov_uk_dashboards/components/plotly/table.py +++ b/gov_uk_dashboards/components/plotly/table.py @@ -259,11 +259,9 @@ def table_from_polars_dataframe( className="govuk-table__body", ) ) - - return row_component( - card( - row_component( - card( + + # commented below out as prevents sticky header, although now not optimised for mobile devices + return card( [ html.Table( table_contents, @@ -275,9 +273,26 @@ def table_from_polars_dataframe( paragraph(table_footer) if table_footer else None, ], amend_style={"padding": "0px"}, - ), - horizontal_scroll=True, - ) - ), - horizontal_scroll=True, - ) + ) + + # return row_component( + # card( + # row_component( + # card( + # [ + # html.Table( + # table_contents, + # className="govuk-table table-header-cell-top-padding", + # id=table_id, + # role="table", + # **table_properties, + # ), + # paragraph(table_footer) if table_footer else None, + # ], + # amend_style={"padding": "0px"}, + # ), + # horizontal_scroll=True, + # ) + # ), + # horizontal_scroll=True, + # ) diff --git a/setup.py b/setup.py index f3215b1..bdb6f77 100644 --- a/setup.py +++ b/setup.py @@ -10,7 +10,7 @@ author="Department for Levelling Up, Housing and Communities", description="Provides access to functionality common to creating a data dashboard.", name="gov_uk_dashboards", - version="12.3.4", + version="13.0.", long_description=long_description, long_description_content_type="text/markdown", packages=find_packages(), From 66c57a38619bf5ecbaca198a5e6e8b80fdd91e4b Mon Sep 17 00:00:00 2001 From: Kate Riley Date: Thu, 19 Dec 2024 15:37:01 +0000 Subject: [PATCH 2/5] update pkg version --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index bdb6f77..26a6689 100644 --- a/setup.py +++ b/setup.py @@ -10,7 +10,7 @@ author="Department for Levelling Up, Housing and Communities", description="Provides access to functionality common to creating a data dashboard.", name="gov_uk_dashboards", - version="13.0.", + version="13.0.0", long_description=long_description, long_description_content_type="text/markdown", packages=find_packages(), From 363788c22530c5fccefe851fd8b80812f25b1dab Mon Sep 17 00:00:00 2001 From: Kate Riley Date: Thu, 19 Dec 2024 15:45:23 +0000 Subject: [PATCH 3/5] formatter & linter --- gov_uk_dashboards/components/plotly/table.py | 26 ++++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/gov_uk_dashboards/components/plotly/table.py b/gov_uk_dashboards/components/plotly/table.py index 1db8211..7086c78 100644 --- a/gov_uk_dashboards/components/plotly/table.py +++ b/gov_uk_dashboards/components/plotly/table.py @@ -259,21 +259,21 @@ def table_from_polars_dataframe( className="govuk-table__body", ) ) - + # commented below out as prevents sticky header, although now not optimised for mobile devices return card( - [ - html.Table( - table_contents, - className="govuk-table table-header-cell-top-padding", - id=table_id, - role="table", - **table_properties, - ), - paragraph(table_footer) if table_footer else None, - ], - amend_style={"padding": "0px"}, - ) + [ + html.Table( + table_contents, + className="govuk-table table-header-cell-top-padding", + id=table_id, + role="table", + **table_properties, + ), + paragraph(table_footer) if table_footer else None, + ], + amend_style={"padding": "0px"}, + ) # return row_component( # card( From 02322eab5917d1965ff0ac7def7029566974bc8d Mon Sep 17 00:00:00 2001 From: Kate Riley Date: Thu, 19 Dec 2024 15:59:01 +0000 Subject: [PATCH 4/5] comment out unused import --- gov_uk_dashboards/components/plotly/table.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gov_uk_dashboards/components/plotly/table.py b/gov_uk_dashboards/components/plotly/table.py index 7086c78..4fffd0f 100644 --- a/gov_uk_dashboards/components/plotly/table.py +++ b/gov_uk_dashboards/components/plotly/table.py @@ -4,7 +4,7 @@ from dash import html, dcc from gov_uk_dashboards.components.plotly.card import card from gov_uk_dashboards.components.plotly.paragraph import paragraph -from gov_uk_dashboards.components.plotly.row_component import row_component +# from gov_uk_dashboards.components.plotly.row_component import row_component def table_from_dataframe( From 95cd53cd5bfc98c8a997836fcf0985f57bf104d4 Mon Sep 17 00:00:00 2001 From: Kate Riley Date: Thu, 19 Dec 2024 16:04:29 +0000 Subject: [PATCH 5/5] run formatter --- gov_uk_dashboards/components/plotly/table.py | 1 + 1 file changed, 1 insertion(+) diff --git a/gov_uk_dashboards/components/plotly/table.py b/gov_uk_dashboards/components/plotly/table.py index 4fffd0f..b47a3d1 100644 --- a/gov_uk_dashboards/components/plotly/table.py +++ b/gov_uk_dashboards/components/plotly/table.py @@ -4,6 +4,7 @@ from dash import html, dcc from gov_uk_dashboards.components.plotly.card import card from gov_uk_dashboards.components.plotly.paragraph import paragraph + # from gov_uk_dashboards.components.plotly.row_component import row_component