The force directed graph is a visualization in which the nodes of a graph are positioned in two or three dimensions by assigning the forces among the set of edges and set of nodes based on their relative positions. There are various types of algorithms available to implement force directed graphs.
As per Wiki, force directed graph has the following advantages due to which it is widely used for visualization of various types of datasets:
Now, since we are acquainted with the force directed graph, let's see an example of the force directed graph. Then, later on, we can implement it on the Splunk dashboard.
The dataset is the same one that we used in the case of the Sankey diagram, which has information about user navigation from one page of the e-commerce portal to the other, along with the count of occurrence.
The subset of the dataset in a tabular format looks like the following screenshot:
The preceding tabular output when mapped to the force directed graph will look like the following diagram:
The preceding force directed graph helps a user derive the following inferences:
Now, let's have a look at how we can implement the force directed graph on the Splunk dashboard.
The following are the steps to be taken in the Splunk dashboard to create a force directed visualization similar to the previous example:
forcedirected.js
) from the forcedirected
directory of the app's static
folder. The JS file needs to be copied to respective apps directly, similar to what we have already done in previous D3 visualizations.autodiscover.js
as follows:<dashboard script="autodiscover.js">
As in all the D3 extension supported visualizations, the search query and the relative path need to be modified as per the requirement to get the correct visualization on the Splunk dashboard. The previous code snippet results in the force directed graph visualization, which is explained in the preceding Example subsection.
18.188.175.182