Skip to content

Filtering is broken when exporting notebook as HTML #563

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

Open
krobb-idnow opened this issue Jan 14, 2025 · 1 comment
Open

Filtering is broken when exporting notebook as HTML #563

krobb-idnow opened this issue Jan 14, 2025 · 1 comment

Comments

@krobb-idnow
Copy link

As far as I can tell, as of version 1.4.0, filtering is broken when exporting a notebook as HTML.

Minimal notebook example:

from ipydatagrid import DataGrid

df = pd.DataFrame(
    {
        "Some Value": ["one", "one", "one", "two", "two", "two"],
        "Another Value": [10, 20, 30, 10, 20, 30],
        "A Third Value": ["a", "b", "c", "d", "e", "f"],
    }
)
grid = DataGrid(df, base_row_size=30, base_column_size=300)
grid

When running this in jupyter lab, filtering on columns works fine, but when exporting as HTML and trying to filter in the HTML file, values shown in a given filter dialog correspond to a different column:

Screenshot from 2025-01-14 16-24-53

I did some digging and found that the HTML file pulls sources from unpkg.com. If I fix the ipydatagrid version in the HTML file (the part where the state is saved) to a version lower than 1.4.0, filtering works fine.

@ollyhensby
Copy link
Contributor

The filtering appears to be broken in JupyterLab also in the latest release (v1.4.0).

Here you see I am searching for apple, but the list below is not filtering based on it:

Image

Example code:

import pandas as pd
from ipydatagrid import DataGrid

df = pd.DataFrame({
    "Fruit": ["apple", "banana", "orange"]
})
DataGrid(df)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants