Provide a structured way to chain a function for a GT object.
This function accepts a function that receives a GT object along with optional positional and keyword arguments, returning a GT object. This allows users to easily integrate a function into the chained API offered by Great Tables.
Parameters
func:Callable[P, 'GT']
A function that receives a GT object along with optional positional and keyword arguments, returning a GT object.
*args:P.args=()
Optional positional arguments to be passed to the function.
****kwargs**:P.kwargs={}
Optional keyword arguments to be passed to the function.
Returns
:gt
A GT object.
Examples:
Let’s use the name, land_area_km2, and density_2021 columns of the towny dataset to create a table. First, we’ll demonstrate using two consecutive calls to the .tab_style() method to highlight the maximum value of the land_area_km2 column with "lightgray" and the maximum value of the density_2021 column with "lightblue".