Created
          August 25, 2020 18:54 
        
      - 
      
- 
        Save rpkyle/d9e31ce7a5c43baa766679064011f6a3 to your computer and use it in GitHub Desktop. 
    dash-cytoscape Demo for Python
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | import dash | |
| import dash_cytoscape as cyto | |
| import dash_html_components as html | |
| app = dash.Dash(__name__) | |
| app.layout = html.Div([ | |
| cyto.Cytoscape( | |
| id='cytoscape-elements-boolean', | |
| layout={'name': 'preset'}, | |
| style={'width': '100%', 'height': '400px'}, | |
| elements=[ | |
| { | |
| 'data': {'id': 'one', 'label': 'Locked'}, | |
| 'position': {'x': 75, 'y': 75}, | |
| 'locked': True | |
| }, | |
| { | |
| 'data': {'id': 'two', 'label': 'Selected'}, | |
| 'position': {'x': 75, 'y': 200}, | |
| 'selected': True | |
| }, | |
| { | |
| 'data': {'id': 'three', 'label': 'Not Selectable'}, | |
| 'position': {'x': 200, 'y': 75}, | |
| 'selectable': False | |
| }, | |
| { | |
| 'data': {'id': 'four', 'label': 'Not grabbable'}, | |
| 'position': {'x': 200, 'y': 200}, | |
| 'grabbable': False | |
| }, | |
| {'data': {'source': 'one', 'target': 'two'}}, | |
| {'data': {'source': 'two', 'target': 'three'}}, | |
| {'data': {'source': 'three', 'target': 'four'}}, | |
| {'data': {'source': 'two', 'target': 'four'}}, | |
| ] | |
| ) | |
| ]) | |
| if __name__ == '__main__': | |
| app.run_server(debug=True) | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
            
Julia version: https://gist.github.com/rpkyle/230086c112da16ea3118a7c04e69717a
R version: https://gist.github.com/rpkyle/247c631e4bf58feff5c930e380dae8d9