Cytoscape.js

Cytoscape.js renders and analyses graphs in the browser. It comes from bioinformatics, where network visualisation is a standard tool, and it is general-purpose despite that origin.

What separates it from a generic drawing library is that the graph is a data structure, not a picture. It carries actual graph algorithms — shortest paths, centrality measures, connected components, filtering by topology — so a question like “which nodes are within two hops of this one” is a method call rather than something to implement against a rendering model.

That distinction decides whether it is the right tool. For drawing a fixed diagram, it is more machinery than needed. For an interface where users explore a graph, it is doing the work.

Layout is the hard part

Graph layout is the part that determines whether a visualisation communicates anything, and it is genuinely difficult. Force-directed layouts — nodes repel, edges pull — produce good results for small and medium graphs and become both slow and unreadable as size grows. Beyond a few hundred nodes the output is the well-known hairball: technically correct, informationally empty.

The answer is almost never a better layout algorithm. It is showing less graph. Filtering to a neighbourhood, aggregating clusters into single nodes, expanding on demand. Designing that interaction model is most of the work, and reaching for a different layout instead is the reflex to resist.

Hierarchical layouts are far more legible when the data actually has a hierarchy, and much worse when it does not, which is worth testing rather than assuming.

Knowledge graphs are the obvious application

The obvious application is knowledge graph exploration, where entities and typed relationships are exactly the data model. That connection makes it relevant to ORKG-style interfaces and to anything presenting citation or provenance structure.

It is worth being clear that visualising a graph and understanding it are different things. A rendered network is compelling and frequently conveys less than a well-chosen table — the visualisation is justified when topology is the question, not when it is decoration.

See also: knowledge graphs, Vue 3, and the web architecture map.