Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(bi): Table conditional formatting #24954

Merged
merged 8 commits into from
Sep 16, 2024
Merged

Conversation

Gilbert09
Copy link
Member

Changes

  • Adds conditional formatting to tables in BI
  • Uses Hog under the hood to evaluate a rule with input
  • This is just V0.1 - wanna add the ability to run custom Hog code in the next version, along with some extra conditional formatting options (e.g. highlight the whole row)
Screen.Recording.2024-09-12.at.18.03.27.mov

Does this work well for both Cloud and self-hosted?

Yes

How did you test this code?

See video

@Gilbert09 Gilbert09 requested a review from a team September 12, 2024 17:05
Copy link
Contributor

Size Change: +660 B (+0.06%)

Total Size: 1.1 MB

ℹ️ View Unchanged
Filename Size Change
frontend/dist/toolbar.js 1.1 MB +660 B (+0.06%)

compressed-size-action

@Gilbert09 Gilbert09 mentioned this pull request Sep 13, 2024
69 tasks
Copy link
Member

@EDsCODE EDsCODE left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

awesome

)
}

const DEFAULT_PICKER_COLORS = [
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where do these colors come from?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hand-picked by me from some online colour palettes - they're not perfect, but we don't have any good defined colours to use that look good with a dark foreground colour (e.g., the colour of the text). Will chat to Cory at some point to define these better

source: props.query.source,
})
},
style: (_, data) => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this conditional formatting only meant for tables?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, only for Table display


export const ConditionalFormattingTab = (): JSX.Element => {
const { isDarkModeOn } = useValues(themeLogic)
const { conditionalFormattingRules, conditionalFormattingRulesPanelActiveKeys } = useValues(dataVisualizationLogic)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NIT: i'm not sure what the right way to do this is but I just wonder if we should be splitting out the rules into a separate logic too so that dataVisualizationLogic doesn't continue to vacuum up responsibilities

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, it's a bit tough - Each rule has a keyed logic to handle its state, then I'd need a containing logic for managing the rules themselves. dataVisualizationLogic has been taking quite the hit recently - it's just shy of 1,000 lines now. WIll look into splitting it up soon!

@Gilbert09 Gilbert09 merged commit cced38c into master Sep 16, 2024
93 checks passed
@Gilbert09 Gilbert09 deleted the tom/conditional-formatting branch September 16, 2024 09:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants