Package: dash-cytoscape
Dash CytoscapeA Dash component library for creating interactive and customizable networks in Python, wrapped aroundCytoscape.js.🌟Medium Article📣Community Announcement💻Github Repository📚User Guide🗺Component Reference📺Webinar RecordingGetting Started in PythonPrerequisitesMake sure that dash and its dependent libraries are correctly installed:pip install dashIf you want to install the latest versions, check out theDash docs on installation.UsageInstall the library usingpip:pip install dash-cytoscapeIf you wish to use the CyLeaflet mapping extension, you must install the optionalleafletdependencies:pip install dash-cytoscape[leaflet]Create the following example inside anapp.pyfile:importdashimportdash_cytoscapeascytofromdashimporthtmlapp=dash.Dash(__name__)app.layout=html.Div([cyto.Cytoscape(id='cytoscape',elements=[{'data':{'id':'one','label':'Node 1'},'position':{'x':50,'y':50}},{'data':{'id':'two','label':'Node 2'},'position':{'x':200,'y':200}},{'data':{'source':'one','target':'two','label':'Node 1 to 2'}}],layout={'name':'preset'})])if__name__=='__main__':app.run_server(debug=True)External layoutsYou can also add external layouts. Use thecyto.load_extra_layouts()function to get started:importdashimportdash_cytoscapeascytofromdashimporthtmlcyto.load_extra_layouts()app=dash.Dash(__name__)app.layout=html.Div([cyto.Cytoscape(...)])Callingcyto.load_extra_layouts()also enables generating SVG images.Getting Started in RPrerequisitesinstall.packages(c("devtools","dash"))UsageInstall the library using devtools:devtools::install_github("plotly/dash-cytoscape")Create the following example inside anapp.Rfile:library(dash)library(dashHtmlComponents)library(dashCytoscape)app<-Dash$new()app$layout(htmlDiv(list(cytoCytoscape(id='cytoscape-two-nodes',layout=list('name'='preset'),style=list('width'='100%','height'='400px'),elements=list(list('data'=list('id'='one','label'='Node 1'),'position'=list('x'=75,'y'=75)),list('data'=list('id'='two','label'='Node 2'),'position'=list('x'=200,'y'=200)),list('data'=list('source'='one','target'='two')))))))app$run_server()DocumentationTheDash Cytoscape User Guidecontains everything you need to know about the library. It contains useful examples, functioning code, and is fully interactive. You can also use thecomponent referencefor a complete and concise specification of the API.To learn more about the core Dash components and how to use callbacks, view theDash documentation.For supplementary information about the underlying Javascript API, view theCytoscape.js documentation.ContributingMake sure that you have read and understood ourcode of conduct, then head over toCONTRIBUTINGto get started.TestingInstructions on how to runtestsare given inCONTRIBUTING.md.LicenseDash, Cytoscape.js and Dash Cytoscape are licensed under MIT. Please viewLICENSEfor more details.Contact and SupportSeehttps://plotly.com/dash/supportfor ways to get in touch.AcknowledgmentsHuge thanks to the Cytoscape Consortium and the Cytoscape.js team for their contribution in making such a complete API for creating interactive networks. This library would not have been possible without their massive work!The Pull Request and Issue Templates were inspired from thescikit-learn project.GalleryDynamically expand elementsCode|DemoInteractively update stylesheetCode|DemoAutomatically generate interactive phylogeny treesCode|DemoCreate your own stylesheetCode|DemoUse event callbacksCode|DemoUse external layoutsCodeUse export graph as imageCodeMake graph responsiveCodeFor an extended gallery, visit thedemos' readme.