BioJS DAGViewer: A reusable JavaScript component for displaying directed graphs

Alexis Kalderimis, Radek Štěpán, Julie Sullivan, Rachel Lyne, Michael Lyne, Gos MicklemF1000Research 2014

Abstract

The BioJS DAGViewer is a reusable JavaScript component designed to render complex Directed Acyclic Graphs (DAGs)—such as biological ontologies and phylogenetic trees—directly within the web browser. By transitioning layout calculations from the server to the client using modern web standards like SVG and D3.js, it provides a highly interactive, searchable, and scalable visualization tool for bioinformatics.

Resources: GitHub Repository | BioJS Registry | DOI

Introduction

BioJS Logo BioJS DAGViewer: A reusable JavaScript component for displaying directed graphs, page 1

BioJS Logo

In the field of bioinformatics, data is frequently structured as graphs, including protein-protein interaction networks and hierarchical ontologies like the Gene Ontology (GO). Traditionally, visualizing these structures required server-side tools such as GraphViz to generate static image files (e.g., PNG or JPEG). This approach presents two significant challenges: a lack of interactivity—where static images cannot be easily searched or zoomed without quality loss—and high resource intensity, as maintaining servers for dynamic image generation creates substantial overhead. The BioJS DAGViewer addresses these issues by providing a client-side component that manages both graph layout mathematics and rendering within the user's browser.

Technical Implementation

Developed as a modular component within the BioJS ecosystem, the DAGViewer utilizes a specialized technology stack to optimize performance and usability:

  • Sugiyama Layout Engine: Unlike force-directed layouts that cluster nodes, the Sugiyama method organizes nodes into hierarchical ranks based on their distance from a root, which is critical for representing directionality in trees and ontologies.
  • dagre-d3 & D3.js: These libraries perform the computational heavy lifting for node positioning and data binding to the Document Object Model (DOM).
  • Scalable Vector Graphics (SVG): Rendering in SVG ensures that graphs remain sharp at any zoom level and allows individual elements to be styled or attached to event listeners.
  • Adapter Pattern: The component is data-agnostic, allowing developers to use custom adapter functions to map diverse JSON structures to the viewer without modifying core logic.

Applications and Insights

The utility of the DAGViewer has been demonstrated through several biological datasets, including Gene Ontology (GO) annotations for the Drosophila melanogaster gene cdc2 and phylogenetic family trees.

A key insight of this work is that modern JavaScript engines are now sufficiently performant to calculate layouts for graphs of moderate size (200–500 nodes) in real-time. This eliminates the need for server-side pre-processing. Furthermore, the tool treats interactivity as a filtering mechanism; users can search for specific terms to instantly isolate reachable sub-graphs, transforming unreadable "hairball" networks into digestible information.

Results and Performance

The DAGViewer comfortably handles 200 to 500 nodes in standard browsers, meeting the needs of most researchers visualizing sub-networks. Its integration into the BioJS registry makes it easily "pluggable" into other web-based platforms, such as InterMine. The separation of data definition from display allows for programmatic manipulation, enabling scripts to highlight nodes based on specific attributes post-rendering.

Conclusion and Future Directions

Open Peer Review Status BioJS DAGViewer: A reusable JavaScript component for displaying directed graphs, page 1

Open Peer Review Status

While the DAGViewer represents a significant step forward for browser-based bioinformatics visualization, peer reviews have identified areas for future development. Current limitations include the lack of manual node manipulation (dragging nodes to adjust layouts) and the absence of a built-in "Export to PNG/PDF" feature for publication-quality outputs. Future iterations aim to improve documentation with live demos and provide more explicit definitions of graph theory terminology to enhance accessibility for a broader audience.

Summary updated

BibTeX
@inproceedings{kalderimis2014biojs,
  author = {Alexis Kalderimis and Radek Štěpán and Julie Sullivan and Rachel Lyne and Michael Lyne and Gos Micklem},
  title = {{BioJS DAGViewer: A reusable JavaScript component for displaying directed graphs}},
  booktitle = {F1000Research},
  year = {2014},
  doi = {10.12688/f1000research.3-51.v1},
}
Figure