Closed huong-li-nguyen closed 4 months ago
Hello @huong-li-nguyen,
What do you mean by the celltStyle
? Are you thinking of something similar to conditional formatting?
As these are coming from Python, you can setup something that would pull it out and explain how it is working.
For example, with what you have, you would do something like this:
rowData = []
for s in CELL_STYLE['styleConditions']:
rowData.append({"condition": s['condition'], "cell_style": s["style"]})
columnDefs = [{"field": "condition", "cellStyle": {"function": "params.data.cell_style"}, {"field": "cell_style", "hide": True}]
dag.AgGrid(rowData=rowData, columnDefs=columnDefs)
Hi @huong-li-nguyen
Are you looking for a legend like this? https://dash.plotly.com/dash-ag-grid/styling-cells#cell-shading-examples
It's unlikely that this would be built in to dash-ag-grid, but this would be a great topic for the forum. Would you like to close this and continue the discussion over there?
Hey @BSd3v and @AnnMarieW ,
thanks for your quick response! 🚀
I find both very helpful. Indeed, I was looking for a legend in the style of @AnnMarieW's example but find you way of pulling the information very useful @BSd3v!
I'll continue the discussion on the Plotly forums 👍
Hey guys,
First of all, amazing work on the
dash-ag-grid
! 🥳 I almost use it in every demo I have.I was wondering if there is an easy / recommended way of adding legends to the
dash-ag-grid
that correspond to thecellStyle
?For example, in this app, I would love it if there was a legend below the table explaining the color coding in the cells of the
dash-ag-grid
.Will this be enabled natively at some point? If not, is there a recommended way of doing so?
Best, Li