Hi everyone!
I’m new to dash and cytoscope, but I’ve been playing with some code for a few days and I’m stuck now. I have a graph with define width and height (style), but I need to modify that dimensions and draw a new graph in that space, however, despite the container change the size, the graph itself doesn’t, It still have the previous dimensions so the graph is outside the container. I use a callback for this change and also place an Interval to force the refresh, and It worked, but now I’ve added another graph (inside a different container) that is also populated in the same callback, but the data for this new graph is quite large and the interval was causing kind of an infinite loop, so I removed the Interval and once again I have the same problem, the graph is outside the container after It resizes. I have the responsive flag activated but still no luck.
My last try was to create a new hide container for the the graph I was trying to resize and when I want to show this new graph, I hide the old one. However, once again my graph is not showing properly, when I unhide the container for the first time is empty. So I decide, just to test this hide/unhide feature, to add a button to hide/unhide the original graph, and I can replicate this issue.
This is how I define the graph showed below:
html.Button('Pausar para Mover/Actualizar', id='start-stop-button', style={'width': '15%','display': 'inline', }, ),
html.Div(id = "capa_P_container", style={}, children=[
cyto.Cytoscape(
id='Capa_P',
layout={'name': 'preset','fit': True, },
style={'width': '100%', 'height': '94vh'},
stylesheet=vars.my_stylesheet,
elements=vars.nodes + edges,
autoRefreshLayout = True,
responsive = True,
),
]),
Thanks in advance.