Changing index (ascending/descending) does not update font colors
- Dominant language
- Jupyter Notebook
- Stars
- 2.9k
- Forks
- 383
- PR merge metrics
- No merged PRs in 30d
Description
The following code snippet results in a rather odd behavior when clicking in the top-left cell, which by default is change the index from ascending to descending or vice versa
```
def color_provider(row, column, table):
row = table.values[row]
if column < len(row) - 1:
val = row[column + 1]
if val < 8:
return Color.GREEN
if val > 42:
return Color.RED
return Color.BLACK
def table(df):
table = TableDisplay(df)
table.setStringFormatForTimes(TimeUnit.DAYS)
table.setFontColorProvider(color_provider)
return table
```
For the necessary weird indexing in `color_provider` i opened another issue (#8194)
So, when i change the index, the colored cell simply stays in the same position (when the value obviously changes) in the table, which is really odd because implementing `color_provider` leaves client code with the idea that the color depends on the cells value
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.