gravis
Convert from any graph formatto gravis Convert from gravisto any other format
gravis is an open-source Python library by Robert Haas for creating interactive network and graph visualizations. Released under the Apache 2.0 license and distributed on PyPI, it pairs Python's data-processing ecosystem with browser-based rendering: graphs are prepared in Python and drawn with HTML/CSS/JS using the JavaScript libraries d3.js (v7), vis.js, and 3d-force-graph.js / three.js. Each backend is exposed as a plotting function (gv.d3, gv.vis, gv.three) with a common calling convention, so the same graph can be shown as a 2D force layout, a vis-style network, or a 3D scene.
Two kinds of input are accepted. The first is gravis's own text format, the gravis JSON Graph Format (gJGF), given either as a JSON string or an equivalent Python dictionary. gJGF is a deliberate extension of the JSON Graph Format v2 (JGF 2.0): it keeps the JGF structure of a top-level "graph" (or "graphs"), a "directed" flag, a "nodes" object keyed by string IDs, and an "edges" array, then adds a "metadata" object on the graph, nodes, and edges carrying visual annotations. Node metadata can set color, opacity, size, shape (circle, rectangle, hexagon), border, label styling, an image, x/y/z coordinates, and hover/click HTML; edges take color, size, labels, and interactivity; graph-level metadata supplies defaults and background. JGF fields gravis does not render, such as edge "relation" or "hyperedges", are simply ignored.
The second input mode is direct interoperability with established graph libraries. gravis auto-translates objects from NetworkX, igraph, graph-tool, NetworKit, Pyntacle, and SNAP into gJGF, so it slots in as a visualization layer on top of an existing analysis pipeline rather than replacing it.
Output is flexible: visualizations render in a browser window, embed inline in Jupyter notebooks, export to standalone self-contained HTML, or serve as HTML text from a web app. Static JPG, PNG, and SVG images can be exported via an in-figure button or programmatically through Selenium.
Its strengths are simplicity, zero JavaScript required from the user, self-contained portable HTML output, and broad support across the main Python graph libraries. Limitations follow from its scope: gravis is a rendering and display tool, not a graph-analysis or format-conversion engine, it performs no layout algorithms of its own beyond what the JS backends provide, and it scales to moderate rather than very large graphs. The project is modestly sized and maintained rather than a large community effort.
Graph Formats(Input & Output)
Frequently Asked Questions
What graph file formats does gravis support?
See the list on this page — it shows every format gravis can read, write and display.
How do I import a graph into gravis?
Convert your file to a format gravis can read, then open it in gravis. Use GraphInOut to get a gravis-compatible file in seconds.
How do I convert a file so gravis can open it?
Use the convert links above — upload or paste your graph, pick a format gravis accepts and download the result, right in your browser.