datapane / datapane

Build and share data reports in 100% Python

Home Page:https://datapane.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

dp.Group no longer supports rows

opened this issue · comments

System Information

  • OS: OSX 12.1
  • Python version: 3.8.5
  • Python environment: poetry
  • Using jupyter: false
  • Datapane version: 0.13.2

Bug / Issue

dp.Group no longer supports the rows attribute. While I agree with this in theory, I see no way under the 0.13.2 api to group multiple objects in a dp.Select. Previously I could:


dp.Select(blocks=[
    dp.Group(
        dp.Text('# Group a stuff here'),
        dp.Chart(charta),
        dp.Table(dfa),
        rows=3,
        label='a',
    ),
    dp.Group(
        dp.Text('# Group b stuff here'),
        dp.Chart(chartb),
        dp.Table(dfb),
        rows=3,
        label='b',
    ),
])

While I do not mind the change to groups being row centric, I now have reports that can not be built (or at least I see no solution to build an arbitrary container around elements that I can give a label for insertion into a dp.Select. In the use-case above if I were to put the three elements in the group side-by-side, my users would potentially be scrolling, or even experience data clipping.

Is there a way to make a select that has multiple entries under it that are not side-by-side in the current version?

It appears that the rows parameter is just now assumed, and columns is required when using columns:

dp.Select(blocks=[
    dp.Group(
        dp.Text('# Group a stuff here'),
        dp.Chart(charta),
        dp.Table(dfa),
        label='a',
    ),
    dp.Group(
        dp.Text('# Group b stuff here'),
        dp.Chart(chartb),
        dp.Table(dfb),
        label='b',
    ),
])

appears to be the proper way to handle this now, though at first glance this did not appear obvious to me. Perhaps a documentation change is needed?

@mands feel free to close this, my comment describes my fix. I am leaving this open in case you want to change any of the docs to highlight this change.

Thank you for raising this @gelliot-os!

I've made a change to our documentation to remove the mention of a row parameter for the Group component.

Old:

Datapane provides a Group component which takes a list of blocks and a number of columns and/or rows and lays them out in a grid

New:

Datapane provides a Group component which takes a list of blocks and a number of columns and lays them out in a grid.