panel icon indicating copy to clipboard operation
panel copied to clipboard

Tabulator documentation: ambiguity in description of specifying column

Open Coderambling opened this issue 6 months ago • 2 comments

In the issue below,

https://github.com/holoviz/panel/issues/7932, describes a possible documentation issue regarding index , @etihwo describe a possible ambiguity in the documentation of Tabulator.

Should the sentence in the doc:

"Column can be specified by name or index."

be replaced by:

"Column can be specified by the name or index of the dataframe.".?

Should a remark be added regarding the level of the dataframe as mentioned below?

I think there is a mistake in your code and an ambiquity in the documentation. In the documentation, it is indicated "Column can be specified by name or index.". However, the "index" is not the index of the column (0, 1, ...) but the name of index of the dataframe such "index" or the name of the level in case of multindex dataframe. If you use the following code, I think you will get the expected result.

styled_fz = pn.widgets.Tabulator(style_df, frozen_columns=["A"])

https://github.com/holoviz/panel/issues/7932#issuecomment-2905196572

https://panel.holoviz.org/reference/widgets/Tabulator.html

Coderambling avatar Jun 01 '25 18:06 Coderambling

I think the confusion come from the fact that index is considered as columns by Tabulator while for a dataframe a column and the index are 2 differents things. I do not know which proposition is the best but as mentionned above, I think it is a good idea to have the dataframe mentioned in the doc. A proposion might be :

frozen_columns (list or dict): Defines the frozen columns:

  • list List of columns to freeze, preventing them from scrolling out of frame. Column can be specified by column name or index name of the Dataframe.
  • dict Dict of columns to freeze and the position in table ('left' or 'right') to freeze them in. Column name or index name of the Dataframe can be used as keys. If value does not match left or right then the default behaviour is to not be frozen at all.

etihwo avatar Jun 01 '25 19:06 etihwo

Thanks @etihwo will look at it in detail later!

Coderambling avatar Jun 01 '25 19:06 Coderambling