Add logic for handling row transforms when row merging is applied
Signed-off-by: Itay Dafna [email protected]
This PR disables any visual nested hierarchies on the row level when any transforms such as filter or sort are applied. It also fixes a bug (thanks @martinRenou for catching this!) where hierarchy validation for row-based groups was not applied correctly.
Code below used for testing:
import pandas as pd
import ipydatagrid as ipdg
df = pd.DataFrame([
['A', 'aaa', 3],
['A', 'bbb', 2],
['B', 'aaa', 0],
['B', 'aaa', 1],
['B', 'aaa', 4],
], columns=['col1', 'col2', 'col3']).set_index(['col1', 'col2'])
g = ipdg.DataGrid(df, layout={"height":"140px"})
g```
Will add visual regression tests shortly.
@martinRenou Here is a weird case:

Do we want to support something like that? We do not allow this on for columns. I would think that there should always be a line that divides the lower level (group 'bbb') based on the parent groups (the line between 'A' and 'B'). What do you think?
@retadlock would appreciate any feedback on hierarchy verification logic. Going through the data path in your head can be a bit of a mind bend so do let me know if you need any clarifications. Thanks!
@retadlock would appreciate any feedback on hierarchy verification logic. Going through the data path in your head can be a bit of a mind bend so do let me know if you need any clarifications. Thanks!
Yup, bent my mind. :) I believe I see what you're doing and don't see a better way off the top of my (bent) mind, but let's go over this together tomorrow.