Pagination for graphs

For free plotly version: Is it possible to add pagination functionality to a graph as we did it for the AG grid?
E.g. selecting a lot of items in the state multi-dropdown creates too small bars after some selections.
So, I would like to add a kind of minimum bar size, not having thin lines as bars. As a consequence after having selected some states, horizontal pagination shall appear automatically.

In the community is one question like this for timeline diagrams, but no one has answered yet.

Perhaps it is possible via bootstrap column, but I have not found it there as well
https://dash-bootstrap-components.opensource.faculty.ai/
and
in plotly.express.bar — 5.17.0 documentation
doesn’t seem to list a parameter for bar size configuration
Using fig.update_traces(width=1) in the callback didn’t help either.

Coding is in:

hi @Ilo2023
Great question. I see how selecting many states in the dropdown can make the graph very hard to read.

One possible solution would be to have a horizontal orientation to the bar chart and increase the height attribute:

    fig = px.bar(df_country,
                 y='state',
                 x=['beef','pork','fruits fresh'],
                 orientation='h',
                 height=800,
                 labels={
                     'state': 'State',
                     'variable': 'Food Group',
                     'value': 'Counter',
                 }
                )

@adamschroeder
this can be a solution, but after selecting some states, the whole graph is not visible anymore on the screen, so you have to scroll up and down. Pagination on horizontal graph visibility would be more customer oriented. Perhaps this could be a plotly feature for the future e.g. for the enterprise version, if not available somewhere already.
Another reason to move to the enterprise version :wink:

Hello @Ilo2023,

You could always make pagination yourself through pattern-matching and creating tabs, but none of the charts would have two states displayed side-by-side.

1 Like

@jinnyzor
Thanks for your answer. I had a look to patern-matching, but I think I am ‘too new’ to plotly, because I don’t know how to reach the automatic pagination component visualisation of the horizontal diagram reaching a specific bar minimum size with this concept. But perhaps I understand the solution in the near future …