-
Notifications
You must be signed in to change notification settings - Fork 2.2k
PoC: Add grid.rowStyle and col.cellStyle options #3775
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
Conversation
Thank you for the PR. You mentioned
For this to work we need to make a few changes
wdyt? |
@amanmahajan7 yep that sounds great, go for it :) |
Do you want to make these changes in your PR? |
if you prefer, sure. i don't need the credit, so if you feel like there would be less review burden / faster, feel free to close this and do the PR on your end. |
This reverts commit 9af6ac0.
@amanmahajan7 i pushed the suggested approach, but not seeing anything render. what am i missing? |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3775 +/- ##
=======================================
Coverage 98.78% 98.79%
=======================================
Files 46 46
Lines 3467 3475 +8
Branches 762 762
=======================================
+ Hits 3425 3433 +8
Misses 42 42
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the PR
@amanmahajan7 thank you! one comment about the demo, though... i think the scenario shown in the demo and my simple examples are probably better done with className, since the amount of possible states is limited/known. the d3-gradient/color-by-value better illustrates a real situation when className wont work well. anyways, looking forward to next beta. also excited to finally see a columnResizeEnd equivalent, instead of having to hack that in as a userland custom hook with click/mouseup handlers. |
I think the demo illustrate the idea but feel free to update the example |
hey @nstepien @amanmahajan7
i wanted to open this up to see how y'all feel about allowing users to style rows and cells without generating classNames.
our use case is being able to style a row or cell using something like d3 color scheme gradients, based on cell value. there can be potentially 256 different colors per column, and generating a class for each color on demand is not great. additionally we may want to style both text and background, leading to a possible combinatorial explosion of classes.
i know we can always throw an additional div into
renderCell
andrenderRow
to do this, but that leads to extra DOM and worse performance. we can use renderers, but this increases complexity a lot in user code that seems silly just to be able to add colors and change little else.would you be open to adding arbitrary style callbacks like this?
thanks for considering!