-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
[🐛 BUG] style[column_name] does not render any color #1792
Comments
blue-cell class name is applied to every cell for the Category column The blue-cell class has to be defined though.
|
If you find the answer complete, I'll let you close this issue. |
This also doesn't work for me on 3.1.1 and 4.0.0.dev2. |
sorry then, it must only be in develop |
can you check if the blue-cell class is applied or not (ie present in the class attribute of the relevant TD) ? |
I also put the blue-cell class in my css without any result |
Did add the blue-cell class. Not rendering color on columns. Full rows are working fine. |
Then you'll have to wait for the next release or request a developper release |
What went wrong? 🤔
<|{food_df}|table|style[Category] = {lambda state, value, index, row, column_name: "blue-cell"}|> when trying cell render no highlights seen
Expected Behavior
Expected column to highlight
Steps to Reproduce Issue
food_df = pd.DataFrame({
"Meal": ["Lunch", "Dinner", "Lunch", "Lunch", "Breakfast", "Breakfast", "Lunch", "Dinner"],
"Category": ["Food", "Food", "Drink", "Food", "Food", "Drink", "Dessert", "Dessert"],
"Name": ["Burger", "Pizza", "Soda", "Salad", "Pasta", "Water", "Ice Cream", "Cake"],
"Calories": [300, 400, 150, 200, 500, 0, 400, 500],
})
def food_df_on_edit(state, var_name, payload):
index = payload["index"] # row index
col = payload["col"] # column name
value = payload["value"] # new value cast to the column type
user_value = payload["user_value"] # new value as entered by the user
def food_df_on_delete(state, var_name, payload):
index = payload["index"] # row index
def food_df_on_add(state, var_name, payload):
empty_row = pd.DataFrame([[None for _ in state.food_df.columns]], columns=state.food_df.columns)
state.food_df = pd.concat([empty_row, state.food_df], axis=0, ignore_index=True)
def table_style(state, index, row):
return "blue-cell" if row.Category == "Dessert" else ""
def highlight_column_cells(state, value, index, row, column_name):
print(f"Column: {column_name}, Value: {value}, Row: {row}")
def simple_highlight(state, value, index, row, column_name):
return "blue-cell" # Apply to all cells as a test
table_properties = {
"class_name": "rows-bordered",
"filter": True,
"on_edit": food_df_on_edit,
"on_delete": food_df_on_delete,
"on_add": food_df_on_add,
"group_by[Category]": True,
"apply[Calories]": "sum",
"style[Calories]" : highlight_column_cells
}
Solution Proposed
No response
Screenshots
Runtime Environment
No response
Browsers
No response
OS
No response
Version of Taipy
No response
Additional Context
No response
Acceptance Criteria
Code of Conduct
The text was updated successfully, but these errors were encountered: