Editing Categorical cells in a table
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 Do you have an example of the creation of a dataframe with categorical column ?
@FredLL-Avaiga I was not able to retrieve a dataset from past experience. I let @vhfgosselin provide it.
Would you happen to have any updates on this issue?
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.
@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.
I am moving the priority higher. It seems it is quite a common use case