Package: jaal
Your interactive network visualizing dashboardDocumentation:Here👉 What is JaalJaal is a python based interactive network visualizing tool built using Dash and Visdcc. Along with the basic features, Jaal also provides multiple option to play with the network data such as searching graph, filtering and even coloring nodes and edges in the graph. And all of this within 2 lines of codes :)👉 RequirementsJaal requires following python packages,Dashdash_core_componentsdash_html_componentsdash_bootstrap_componentsvisdccpandas👉 InstallInstalling Jaal is super easy, just do the following,pipinstalljaalAnd you are done :)Note, it's recommended to create a virtual enivornment before installing. This can be easily done usingpython -m venv myenvand then to activate the env we need,(Windows).\\myvenv\\Scripts\\activate.bat(Linux)source myvenv/bin/activate👉 Getting startedAfter installing Jaal, we need to fetch the data and callplotfunction in Jaal. This can be shown by playing with an included Game of Thrones dataset, as follows,# importfromjaalimportJaalfromjaal.datasetsimportload_got# load the dataedge_df,node_df=load_got()# init Jaal and run serverJaal(edge_df,node_df).plot()Here first we importJaalmain class and the dataset loading functionload_got. Later we load the GoT dataset from the datasets included in the package. This gives us two files,edge_df:its a pandas dataframe with atleastfromandtocolumn, which represents the edge relationship between the entitiesnode_df:its an optional parameter, but should contains aidcolumn with unique node names.Note, edge_df is mandatory and node_df is optional. Also we can include additional columns in these files which are automatically considered as edge or node features respectively.After running the plot, the console will prompt the default localhost address (127.0.0.1:8050) where Jaal is running. Access it to see the following dashboard,👉 FeaturesAt present, the dashboard consist of following sections,Setting panel:here we can play with the graph data, it further contain following sections:Search:can be used to find a node in graphFilter:supports pandas query language and can be used to filter the graph data based on nodes or edge features.Color:can be used to color nodes or edges based on their categorical features. Note, currently only features with at max 20 cardinality are supported.Size:can be used to size nodes or edges based on their numerical features.Graph:the network graph in all its glory :)👉 Examples1. Searching2. Filtering3. Coloring4. Size👉 Extra settingsDisplay edge labelTo display labels over edges, we need to add alabelattribute (column) in theedge_df. Also, it has to be instringformat.
For example, using the GoT dataset, by adding the following line before theJaalcall, we can display the edge labels.# add edge labelsedge_df.loc[:,'label']=edge_df.loc[:,'weight'].astype(str)Display image in nodeCurrently it is possible to show image within node (with circular shape). For this, we need to putnode_image_urlcolumn in thenode_dfwith URLs for each node.Directed edgesBy default,Jaalplot undirected edges. This setting can be changed by,Jaal(edge_df,node_df).plot(directed=True)Showing TooltipBy default,nodeidis shown as tooltip. To overwrite this, include atitlecolumn with the respective data.Using vis.js settingsWe can tweak any of thevis.jsrelated network visualization settings. An example is,# init Jaal and run serverJaal(edge_df,node_df).plot(vis_opts={'height':'600px',# change height'interaction':{'hover':True},# turn on-off the hover'physics':{'stabilization':{'iterations':100}}})# define the convergence iteration of networkFor a complete list of settings, visitvis.js website.Using gunicornWe can host Jaal on production level HTTP server usinggunicornby first creating the app file (jaal_app.py),# importfromjaalimportJaalfromjaal.datasetsimportload_got# load the dataedge_df,node_df=load_got()# create the app and serverapp=Jaal(edge_df,node_df).create()server=app.serverthen from the command line, start the server by,gunicorn jaal_app:serverNote,Jaal.create()takesdirectedandvis_optsas arguments. (same asJaal.plot()except thehostandportarguments)👉 Common ProblemsPort related issueIf you are facing port related issue, please try the following way to run Jaal. It will try different ports, until an empty one is found.port=8050whileTrue:try:Jaal(edge_df,node_df).plot(port=port)except:port+=1👉 Issue trackerPlease report any bug or feature idea using Jaal issue tracker:https://github.com/imohitmayank/jaal/issues👉 CollaborationAny type of collaboration is appreciated. It could be  testing, development, documentation and other tasks that is useful to the project. Feel free to connect with me regarding this.👉 ContactYou can connect with me onLinkedInor mail me atmohitmayank1@gmail.com.👉 LicenseJaal is licensed under the terms of the MIT License (see the file
LICENSE).