Skip to content
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

Incorrect coloring of columns using Tabulator's style.background_gradient after upgrading to version 1.3.1 #5822

Closed
1 task
patwaibel opened this issue Nov 6, 2023 · 0 comments · Fixed by #5938
Labels
component: tabulator Related to the Tabulator widget type: bug Something isn't correct or isn't working
Milestone

Comments

@patwaibel
Copy link

ALL software version info

Python 3.10.13
Panel: 1.3.1
Pandas: 2.0.3
Bokeh: 3.3.0
Param: 2.0.0
MacOS 14.0

Description of expected behavior and the observed behavior

When using a Tabulator with the style.background_gradient method and the subset parameter, only the columns defined in the subset should be colored. However, currently with panel 1.3.1, all columns are being colored instead. The behavior was as expected when using panel version 1.3.0.

Complete, minimal, self-contained example code that reproduces the issue

import panel as pn
import pandas as pd
import numpy as np

df = pd.DataFrame(
    np.random.rand(20, 10) * 5.0,
    columns=list("ABCDEFGHIJ"),
)
tab = pn.widgets.Tabulator(
    df,
)
tab.style.background_gradient(
    cmap="RdYlGn_r",
    vmin=0,
    vmax=5,
    subset=df.columns.str.contains("A|C|I"),
)
pn.Row(tab).servable()

Stack traceback and/or browser JavaScript console output

Screenshots or screencasts of the bug in action

Panel 1.3.1
image

Panel 1.3.0
image

  • I may be interested in making a pull request to address this
@philippjfr philippjfr added the type: bug Something isn't correct or isn't working label Nov 6, 2023
@philippjfr philippjfr added this to the v1.3.2 milestone Nov 6, 2023
@maximlt maximlt added the component: tabulator Related to the Tabulator widget label Nov 11, 2023
@philippjfr philippjfr modified the milestones: v1.3.2, v1.4.0 Nov 22, 2023
@philippjfr philippjfr modified the milestones: v1.4.0, v1.3.3 Dec 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: tabulator Related to the Tabulator widget type: bug Something isn't correct or isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants