Displaying a force directed graph

In this recipe, we will create a graph with some of the characters of the play Hamlet by William Shakespeare. The idea is to visualize the connections between the characters in a fun and interactive way. The type of graph that will be visualized is known as force directed graph.

Displaying a force directed graph

Getting ready

In order to visualize the connections between the characters, they need to be stored somehow. There is a sample data.json file that is a part of the code examples that you can use. Although we do encourage you to create your own sample data or at least play around with the existing one, but for the purpose of simplicity, we will ...

Get HTML5 Data and Services Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.