- 
                Notifications
    You must be signed in to change notification settings 
- Fork 748
Hover over cell #6420
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
Hover over cell #6420
Conversation
| The latest updates on your projects. Learn more about Vercel for GitHub. 
 | 
| @nojaf what is the use case? would it make sense to instead create a  something like what plotly does https://plotly.com/python/hover-text-and-formatting/#customizing-hover-text-with-a-hovertemplate | 
| Hi, I asked inside and they mentioned two direct use cases: 
 They use this in plotly a lot though usually provide hover_data=[Col1, Col2,..] and plotly does the formatting, probably calling hover_template in the background. So, this would work for us. | 
| @nojaf we can add a parameter  const variableRegex = /{{(\w+)}}/g;
const matches = [...prompt.matchAll(variableRegex)];
let result;
for (const match in matches) {
   // if match is in the row, replace it in the string
}  since we pass the full fields anyways, we likely don't need the  | 
| Hi @mscolnick, I tried something the way you described it. | 
| yea,  | 
| this replacement can happen on the frontend | 
| cell.getUserStyling?.() || {}, | ||
| pinningstyle, | ||
| ); | ||
| const hoverTemplate = table.getState().cellHoverTemplate || undefined; | 
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.
@mscolnick yeah this works.
But I wonder if we want to support showing something specific for each individual cell?
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.
that seems like a weird user experience, because how are they going to expect what is in each popover without hovering over it. it would just be a surprise. with a template, they at least can infer what fields are being shown and changing
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.
Alright, makes sense. I'll stick to the column names within a row for now.
📝 Summary
Similar to #4245, we would also like to have a function to provide a callback that can create hover text for the individual cells.
🔍 Description of Changes
This is another TanStack table plugin.
Needs some more polishing but you like to get a sense first if this would be accepted.
📋 Checklist