~~POC for styling cells via great_tables package. ~~ POC proven. great_tables support pushed to later release.
Using this approach as great_tables has generic styling support, whereas the styler component of pandas is only for pandas and great_tables is already integrated into polars. Hopefully for the next release, both py-shiny and great-tables will be leveraging narwhals ("Lightweight and extensible compatibility layer between Polars, pandas, cuDF, Modin, and more"). This way, both py-shiny gets styling support for any data frame package! (Related: #1439)
While the great_tables integration was a success, it brought up problems for how render.data_frame was to interact with the GT object. We will approach this subject in a 1.1 release.
For now, the styles= parameter has been added to render.DataTable and render.DataGrid. This value can either be a list of style info objects or function (given data as a param) that returns a list of style objects. This style function will be called after any cells have been updated as styling for the whole table may change due to a single cell update.
~~POC for styling cells via
great_tables
package. ~~ POC proven.great_tables
support pushed to later release.Using this approach as
great_tables
has generic styling support, whereas thestyler
component ofpandas
is only for pandas andgreat_tables
is already integrated intopolars
. Hopefully for the next release, both py-shiny and great-tables will be leveragingnarwhals
("Lightweight and extensible compatibility layer between Polars, pandas, cuDF, Modin, and more"). This way, both py-shiny gets styling support for any data frame package! (Related: #1439)Example excerpt:
Update: June 27th:
While the
great_tables
integration was a success, it brought up problems for howrender.data_frame
was to interact with theGT
object. We will approach this subject in a 1.1 release.For now, the
styles=
parameter has been added torender.DataTable
andrender.DataGrid
. This value can either be a list of style info objects or function (given data as a param) that returns a list of style objects. This style function will be called after any cells have been updated as styling for the whole table may change due to a single cell update.Ex: