You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am currently using the cose layout for a project to present a large number of nodes in a small space. Depending on the user actions within the app, the style of different nodes are updated via callbacks. I would also like to use a custom function for the nodeRepulsion property of the cose layout that can be modified via a callback. This is how the Cytoscape JS cose layout works, as referenced here, and would allow me to dynamically alter the repulsion for a subset of nodes based on user input. However, Dash Cytoscape currently only allows a static numeric value to be used which is applied to all nodes.
Steps/Code to Reproduce
importdashimportdash_cytoscapeascytofromdashimporthtmldefcustom_nodeRepulsion_func(node):
# Logic for returning a numeric repulsion value for the nodereturn2048app=dash.Dash(__name__)
app.layout=html.Div([
...
cyto.Cytoscape(
id='cytoscape',
elements=[ ... ],
layout={'name': 'cose', 'nodeRepulsion': custom_nodeRepulsion_func}
)
...
])
if__name__=='__main__':
app.run_server(debug=True)
Expected Results
Ideally, the custom function would calculate the node repulsion for each node while building the cose layout. This would allow for a dynamic physics-based node layout based on the user input.
Actual Results
Dash app displays "Error loading layout".
Versions
Dash 2.15.0
Dash Cytoscape 1.0.0
The text was updated successfully, but these errors were encountered:
Description
I am currently using the
cose
layout for a project to present a large number of nodes in a small space. Depending on the user actions within the app, the style of different nodes are updated via callbacks. I would also like to use a custom function for thenodeRepulsion
property of thecose
layout that can be modified via a callback. This is how the Cytoscape JScose
layout works, as referenced here, and would allow me to dynamically alter the repulsion for a subset of nodes based on user input. However, Dash Cytoscape currently only allows a static numeric value to be used which is applied to all nodes.Steps/Code to Reproduce
Expected Results
Ideally, the custom function would calculate the node repulsion for each node while building the
cose
layout. This would allow for a dynamic physics-based node layout based on the user input.Actual Results
Dash app displays "Error loading layout".
Versions
Dash 2.15.0
Dash Cytoscape 1.0.0
The text was updated successfully, but these errors were encountered: