Custom Plotly JSON breaking the selectedPoints for chart component

I'm trying to modify a bar chart's JSON by adding a customdata object that I can use in the hovertemplate. When I do that though, the selectedPoints seems to remove the "group" element from the chart's state.

Reverting the json edits seems to fix the selectedPoints problem, but then I can't adjust the hover text or customdata...

See screenshots below for UI with the desired selectedPoints state and JSON with the desired hover behavior but not the selectedPoints.

Hey @eman31 if you're still looking into this, our Office Hours could be a good format for exploring what's happening here with the chart component, and get ideas in a group including Retool Community Support Engineers and other experts from the community :slight_smile: