Suppose I have a large table
import plotly.graph_objects as go
fig = go.Figure(data=[go.Table(
header=dict(values=['A Scores', 'B Scores'],
cells=dict(values=[[i for i in range(100)], # 1st column
[i for i in range(100)]], # 2nd column
How can I make it so the table is centred around a custom row (say the 50th row here) when a button is pressed?
I think you can do this by paging a datatable https://dash.plot.ly/datatable/callbacks
Unfortunately, whilst useful, the paging functionality is not what I was looking for.
I was more looking for a a solution to keeping the entire table on display but the scroll bar initialised to a specific point.
Do you know if this functionality exists?
You could try a combination of anchor tags on each row of the table and then making the button change the URL to go to
#row-id. This doesn’t guarantee that the row will be centred though, only that it will be in view.
Thanks this seems like the right direction.
If I wanted to ask for this as a feature request (so it can easily be done from the python API) do I request the feature here or on the github page?
I’d suggest on the GitHub issue tracker https://github.com/plotly/dash/issues. My gut feeling is that this would best be part of DataTable, since it has attributes such as
derived_viewport_row_ids which could be changed to a settable attribute or a new function added.