ipydatagrid icon indicating copy to clipboard operation
ipydatagrid copied to clipboard

Add logic for handling row transforms when row merging is applied

Open ibdafna opened this issue 3 years ago • 4 comments

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```

ibdafna avatar Mar 23 '22 23:03 ibdafna

Will add visual regression tests shortly.

ibdafna avatar Mar 23 '22 23:03 ibdafna

@martinRenou Here is a weird case: image

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?

ibdafna avatar Mar 24 '22 01:03 ibdafna

@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!

ibdafna avatar Mar 31 '22 00:03 ibdafna

@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.

retadlock avatar Mar 31 '22 02:03 retadlock