Plotly Cytoscape: remove edge functionality to increase callback performance

I have a performance issue with Plotly Cytoscape. I understand that nodes and edges can be bound to callbacks to provide functionality (such as changing color, displaying labels, etc.).

Lag in callback performance in the documentation’s examples are unnoticeable, but the number of nodes and edges are few. Once the number of nodes and edges increase, a compromise in callback performance is obvious. What is more obvious is the performance hit when edges are present. In my use-case, I would like to display edges but have no functionality bound to them; I simply need the edges to show the relationships between nodes. Is this possible?

Please try out the code snippet below, which was modified from the documentation to add thousands of nodes and edges. If you do not plot the edges, you will notice an increase in callback performance. I am wondering how I can keep the edges while maintaining high callback performance.

import json
import random

from dash import Dash, html, Input, Output
import dash_cytoscape as cyto

random.seed(888)
app = Dash(__name__)

# Generate a large number of random nodes and edges
NUM_NODES = 3_000
rand_nodes = [(str(random.randint(0, NUM_NODES)), random.randint(20, 50), -random.randint(50, 150)) for _ in range(NUM_NODES)]
node_ids = list(zip(*rand_nodes))[0]
edge_list = zip(node_ids, node_ids[::-1])

styles = {
    'pre': {
        'border': 'thin lightgrey solid',
        'overflowX': 'scroll'
    }
}

nodes = [
    {
        'data': {'id': short},
        'position': {'x': 20*lat, 'y': -20*long}
    }
    for short, long, lat in rand_nodes
]

edges = [
    {'data': {'source': source, 'target': target}}
    for source, target in edge_list
]


default_stylesheet = [
    {
        'selector': 'node',
        'style': {
            'background-color': '#BFD7B5',
            'label': 'data(label)'
        }
    }
]


app.layout = html.Div([
    cyto.Cytoscape(
        id='cytoscape-event-callbacks-1',
        layout={'name': 'preset'},
        ## Toggle below to display nodes or nodes + edges
        elements=edges+nodes,
        # elements=nodes,
        stylesheet=default_stylesheet,
        style={'width': '100%', 'height': '450px'}
    ),
    html.Pre(id='cytoscape-tapNodeData-json', style=styles['pre'])
])


@app.callback(Output('cytoscape-tapNodeData-json', 'children'),
              Input('cytoscape-event-callbacks-1', 'tapNodeData'))
def displayTapNodeData(data):
    return json.dumps(data, indent=2)


if __name__ == '__main__':
    app.run_server(debug=True)