Fast way to visualize huge tables with Dash and Plotly, Python

Viewed 748

I am using Dash DataTable to represent Amino Acid sequences (char sequences) and visualize differences between them (Yes, I know I can use the dash_bio Alignment chart but I do not want to, it is as colourful as useless for a clear visualization of differences).

I have already done it for 23 AASequences (23 table rows) x 183 Amino Acids (chars. 183 table columns). My problem is that I will usually want to represent more than 100 rows x 100 columns, and it takes AGES for Dash to update a table of that size. Do you know any other faster way of visualizing a table (that I could integrate in my Dash app)??

  • My callback functions to update columns and data are fast. The problem is when Dash reads such data.

Code that may help to understand what I need:

#Sequence Comparison
    html.Div([
        dcc.Loading(id='file-loader', type="default", children=[html.Div([
            html.H6('Sequence Comparison within a cluster.'),

            html.Label('This is a range slider'),
            dcc.RangeSlider(
                id='column-slider',
                min=0,
                max=182,
                step= 1,
                value= [0,0], #A slider that allows a range specifications
                marks= af.getTableSliderMarks()
            ),
            dash_table.DataTable(id = 'seq_comparison_table')
        ])]),
@app.callback(
    [Output('seq_comparison_table', 'data'),
    Output('seq_comparison_table', 'style_data_conditional')],
    [Input('clustering-3D', 'clickData'), 
    Input('clustering-3D', 'figure'), 
    Input('column-slider', 'value'),
    Input('HLA-dropdown-1', 'value')])
def click_data(clickData, clust_data, slider_range, hla_type):
    
#Code to fill table_data and style_data_conditional (not so relevant)

#when table_data == dictionary of 23 rows and 183 columns(or less). Then Dash DataTable is updated after approx 15 seconds. 

#when table_data == dictionary of 100 rows and 100 columns(For example). Then Dash DataTable takes long times to update (Chrome throws a message, that I attach as a picture later in this post, before finishing the task)

    return table_data, style_data_conditional
                    
                    
@app.callback(Output('seq_comparison_table', 'columns'),[Input('column-slider','value')])
def updateComparisonTableColumns(slider_range):
    #Code to fill columns variable

    return columns

Sorry, the message is in Spanish but it is the common Chrome message when a webpage does not answer.

enter image description here

0 Answers
Related