taipy icon indicating copy to clipboard operation
taipy copied to clipboard

Editing Categorical cells in a table

Open vhfgosselin opened this issue 3 years ago • 5 comments

Being able to edit categorical cells by providing a list of values Pandas dataframe is one of the most common Python tabular object that gets displayed using Taipy GUI Table. Pandas allows typing certain columns as "categorical".

  • When editing a given cell in such a column, it would be nice to providea list of the possible categories (of that column).

  • In addition, Pandas provides two types of categorical columns: ordered and unordered. Therefore, when specified as ordered, Taipy GUI should provide the list of possible categories ordered.

  • Finally, it would be fantastic when editing such a cell to allow the end-user to start entering value and provide auto-completion amongst the list of categorical values. This is useful when the number of categorical values is long.

Description of the ideal solution Leave it to your creativity!

Caveats

Other options

Acceptance Criteria

  • [ ] Ensure new code is unit tested, and check code coverage is at least 90%
  • [ ] Propagate any change on the demos and run all of them to ensure there is no breaking change
  • [ ] Ensure any change is well documented

vhfgosselin avatar Feb 25 '23 10:02 vhfgosselin

@vhfgosselin Do you have an example of the creation of a dataframe with categorical column ?

FredLL-Avaiga avatar Mar 01 '23 14:03 FredLL-Avaiga

@FredLL-Avaiga I was not able to retrieve a dataset from past experience. I let @vhfgosselin provide it.

jrobinAV avatar Mar 06 '23 08:03 jrobinAV

Would you happen to have any updates on this issue?

bobbyshermi avatar May 25 '23 10:05 bobbyshermi

Here is the comment just added to Avaiga/taipy-gui#750, which duplicates this issue:

The R&D team is currently looking at providing that feature.

The whole point of having Taipy GUI take care of that requirement is to keep compatibility with data structures that do not provide such a feature, such as the Pandas DataFrames. We plan to provide a new property to the table control where you would be able to indicate the possible values for a given column. That would look like enum[<column_name>]=<list_of_valid_values>. Then users would not be able to edit a cell and provide a value that is not listed in the given set.

However, we are still struggling to find an elegant manner to allow for exceptions: you would provide a list of valid values just like described above, but the table should be able to let any value be set anyways. That feature seems mandatory and we are not quite ready yet to provide it.

FabienLelaquais avatar May 26 '23 06:05 FabienLelaquais

@vhfgosselin Do you have an example of the creation of a dataframe with categorical column ?

https://pandas.pydata.org/docs/user_guide/categorical.html has a few.

FabienLelaquais avatar May 26 '23 07:05 FabienLelaquais

I am moving the priority higher. It seems it is quite a common use case

FlorianJacta avatar Jan 24 '24 08:01 FlorianJacta