Hi, everyone,
I’m relatively new to the Dash world, but really excited about the possibilities.
However, I am currently facing a problem with the conditional formatting of my table in Dash and hope you can help me, as I get stuck after several days of trying.
The situation is as follows:
• I created a dashboard to match my cluster algorithm … that worked perfectly. However, I would now like to format the table with the values a little more “complex”.
• Since my data and column names change frequently, it has to be the whole variable and I cannot refer to a specific column except for a single column, which should be yours as an orientation
Within the column: Number of rows, the row with the largest value should be taken as the reference value (i.e. largest cluster)
Then all values of the remaining columns should be colored accordingly based on the mean value of this row:
(Simplified form)
Value is not the same = red
Value is the same = green
(desired shape)
The further the value is from the mean value of the “target line”, the red the field within the table should be … the closer to the mean value the greener it should be
Here is an example of how I imagine the whole thing (simple version)
(And my table is created using a callback from 2 dropdowns and a button)
I know that this is just one of the templates from the How to Guide from Plotly, but I am not able to adapt this to my liking.
I tried an if / else condition but didn’t succeed …
I have to say that I’ve only been programming for 5 months and therefore I probably don’t understand the syntax …
Summarized:
Did I need a conditional formatting, which can be found in the column:
Anzahl der Zeilen
Oriented and recognizes the largest number of them. Then, using this, everything that applies to this line turns green and everything that deviates from it turns red (optional: the further away from the mean value of the reference column, the color should change from green to red)
But I would be very happy about help from you for the solution or an approach to make my problem feasible …
Or at least the statement whether this is even possible.