evidence-dev / evidence

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

Add conditional formatting based on another column and red negatives #1902

Closed hughess closed 2 weeks ago

hughess commented 3 weeks ago

Description

3 improvements to DataTable:

  1. Use another column to define a color scale scaleColumn
  2. Use another column to define value formatting fmtColumn
  3. Set negative values to show as red redNegatives

Custom Column Conditional Formatting

CleanShot 2024-04-16 at 15 55 55@2x

Red Negative Values

Use redNegatives=true in the Column component to set negative values to show as red.

CleanShot 2024-04-16 at 19 30 03@2x

Checklist

changeset-bot[bot] commented 3 weeks ago

🦋 Changeset detected

Latest commit: ace13529486623e04d573c23527f44dc36dc1fdd

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 5 packages | Name | Type | | ----------------------------- | ----- | | @evidence-dev/core-components | Patch | | @evidence-dev/evidence | Patch | | my-evidence-project | Patch | | @evidence-dev/components | Patch | | evidence-test-environment | Patch |

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

netlify[bot] commented 3 weeks ago

Deploy Preview for evidence-development-workspace ready!

Name Link
Latest commit ace13529486623e04d573c23527f44dc36dc1fdd
Latest deploy log https://app.netlify.com/sites/evidence-development-workspace/deploys/662160ca73b51a0008addef2
Deploy Preview https://deploy-preview-1902--evidence-development-workspace.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

netlify[bot] commented 3 weeks ago

Deploy Preview for next-docs-evidence ready!

Name Link
Latest commit ace13529486623e04d573c23527f44dc36dc1fdd
Latest deploy log https://app.netlify.com/sites/next-docs-evidence/deploys/662160ca263c88000813cdec
Deploy Preview https://deploy-preview-1902--next-docs-evidence.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.