Generating Cytoscape.js graphs with SWI-Prolog

Note: If you have Trust level: Basic you can edit this by clicking on the edit icon in the lower right. Capture

Note: Do not reply to this topic; questions, concerns, comments, etc. are to be handled in
Wiki Discussion: Generating Cytoscape.js graphs with SWI-Prolog

Displaying Graphs is a prosperous way to learn about Prolog relationships.

If you know GraphViz and would like to have graphs that can do even more and move nodes interactively in an Internet browser then you are in the right place.

If you know HTML, JavaScript, CSS and JSON then you will feel right at home with Cytoscape.js.

Cytoscape.js is a pure JavaScript implementation that allows you to easily display and manipulate rich, interactive graphs. Cytoscape.js is licensed with a permissive open source license (MIT) for the core Cytoscape.js library and all first-party extensions.

Cytoscape.js evolved from Cytoscape and Cytoscape Web.

Since nodes and edges are a JSON data structure (ref) in Cytoscape.js, converting Prolog facts and relationships to a JSON data structure for use with a Cytoscape.js graph is simple. For a similar example of converting facts to a data structure for use with GraphViz see: Convert facts to GraphViz dot file using DCGs

Much more still needs to be written and more is to come. :slightly_smiling_face: