Developing an IDE-integrated package for force-directed graph layouts
network; graph; r; rstudio; jupyter; ide; package; tool
Network visualization is a critical step for effective communication in various fields of knowledge, especially in life sciences. Currently, a gap separates network manipulation from network visualization in programming environments. Users constantly face the inconvenience of exporting network data to be laid out in external software, like Cytoscape and Gephi. We propose easylayout, a package that smoothly bridges manipulation and visualization by taking advantage of existing literate programming tools (e.g., RStudio for RMarkdown, Jupyter Notebooks). The easylayout package receives an igraph object and serializes it into a web application integrated with the RStudio interface through a Shiny server. This web application provides an environment to lay out the network by simulating attraction and repulsion forces. There is an editing mode that allows users to move and rotate vertices. The development of easylayout aims for computational performance, so that even low-end devices are able to work with networks with thousands of vertices and tens of thousands of edges. One way this is done is by curating high-performing graph drawing algorithms like VivaGraphJS (github.com/anvaka/VivaGraphJS) and Cosmos (github.com/cosmograph-org/cosmos). Once the user finishes tinkering the layout, it is sent back to the parent environment to be visualized through popular libraries like ggplot2 and matplotlib. Although the current implementation of easylayout focuses on refining the experience in the RStudio ecosystem, the use of web technologies make it easily portable to similar environments, like Jupyter Notebooks and VSCode. We expect this tool not only to significantly reduce the time spent laying out networks, but also to allow researches to generate more compelling figures.