Closed ollyhensby closed 1 year ago
Use updated VegaExpr and just set to default_renderer
if(
!isValid(cell.value),
' ',
if (
isNumber(cell.value),
format(cell.value, '.2f'),
cell.value
)
)
Instead of having to loop through the cols to see which are of type number, the VegaExpr will handle it.
Issue When setting the
global_decimal_places
the NaNs appear in that columns even if passed to thedefault_renderer
that they should be hidden.I think this is because the individual renderers defined for a column overrides the default.
Solution Similar to
global_decimal_places
in schema, we could add ahide_nans
to datagrid_traits and if they are both set to true then we set the following Vega Expression:e.g.
We set
hide_nans
in TestDataFrame. We also see thatglobal_decimal_places
is set to 2 so the above VegaExpr is constructed and set for that column.