evidence-dev / evidence

Business intelligence as code: build fast, interactive data visualizations in pure SQL and markdown
https://evidence.dev
MIT License
3.44k stars 167 forks source link

Apply colorscale to subtotals and totalRow in DataTable #1963

Open mjbloch opened 2 weeks ago

mjbloch commented 2 weeks ago

Feature Description

Would like column contentType=colorscale to apply to subtotals and totalRow rows in Data Tables - ideally this could be a configuration setting in the DataTable to apply or not. contentType=delta already applies to subtotals and totals this, but contentType=colorscale does not.

Goal of Feature

More consistent formatting across the entire data table. Would also make "rolled-up" data tables easier to analyze with conditional formatting when collapsed.

Current Solution / Workarounds

N/A

Alternatives

Could use contentType=delta as an alternative.

hughess commented 1 week ago

@mjbloch the reason we left the formatting out for those rows was so it doesn’t skew the scale range - I was imagining the total rows would all show in dark colours and the individual rows all in light.

We could add it as an optional prop though as you suggested - just wanted to confirm it would give you what you’re looking for

mjbloch commented 1 week ago

@hughess - makes total sense. The example I was working with was all +/- around zero so I didn't even consider the potential color scale skew from the total rows. A prop to toggle on or off would definitely be ideal. Thanks!