feat: Add column_order parameter to Tabulator widget#8434
Open
SuMayaBee wants to merge 5 commits intoholoviz:mainfrom
Open
feat: Add column_order parameter to Tabulator widget#8434SuMayaBee wants to merge 5 commits intoholoviz:mainfrom
SuMayaBee wants to merge 5 commits intoholoviz:mainfrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8434 +/- ##
==========================================
- Coverage 86.12% 86.00% -0.13%
==========================================
Files 349 349
Lines 54971 55013 +42
==========================================
- Hits 47343 47313 -30
- Misses 7628 7700 +72 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Contributor
Author
|
Hi @philippjfr, I’ve added a small visual demo to verify the new pn.widgets.Tabulator(df) # default: all columns in original order
pn.widgets.Tabulator(df, column_order=["col3", "col1"]) # only col3 and col1 shown, in that order; others hidden
In the attached screenshot, both sides use the same input DataFrame:
This matches the behavior described in #8431 and Streamlit’s |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Description
Adds
column_orderparameter toTabulatorwidget to control column visibility and display order, equivalent to Streamlit'sdata_editorcolumn_orderparameter.Changes
column_orderparameter to filter and reorder displayed columns_get_columns()to implement column filtering/ordering logicExample
The table will display columns in the order:
index,col3,col1(col2 and col4 are hidden).Behavior
column_order=None(default): All columns shown in original ordercolumn_order=[...]: Only listed columns shown in specified orderFixes #8431
AI Disclosure: Claude Haiku 4.5 was used for exploring the codebase during the development of this PR.