DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Related

  • The Network Attach Problem Nobody Warns You About
  • Part II: The Network That Doesn't Exist: Zero Trust, Service Meshes, and the Slow Death of Perimeter Security
  • Breaking the Vendor Lock in Network Automation: A Pure Python Architecture
  • An AI-Driven Architecture for Autonomous Network Operations (NetOps)

Trending

  • Securing the AI Host: Spring AI MCP Server Communication With API Keys
  • Building a Spring AI Assistant With MCP Servers: A Step-by-Step Tutorial
  • Beyond Manual Annotation: Engineering Self-Correcting Pseudo-Labeling Pipelines
  • Zero-Downtime Deployments for Java Apps on Kubernetes
  1. DZone
  2. Data Engineering
  3. IoT
  4. Network Graphs

Network Graphs

Create easily understandable social network graphs.

By 
Mustapha Mekhatria user avatar
Mustapha Mekhatria
·
Updated Jan. 03, 20 · Tutorial
Likes (6)
Comment
Save
Tweet
Share
18.2K Views

Join the DZone community and get the full member experience.

Join For Free

A network graph is a chart that displays relationships between elements (nodes) using simple links. Network graphs allows us to visualize clusters and relationships between the nodes quickly. These graphs are often used in industries such as life science, cybersecurity, intelligence, etc.

Creating a network graph is straightforward. This demo shows five nodes and the relationship between them. Node one has a relationship with nodes three, four, and two. Node five also has a relationship with nodes two and four, but it does not have a relationship with node three. 


To replicate this chart, all you have to do is to create a table of relationships following this structure ['from', 'to']. In this example the table looks like:

data: [
  ['Node 1', 'Node 2'],
  ['Node 1', 'Node 3'],
  ['Node 1', 'Node 4'],
  ['Node 4', 'Node 5'],
  ['Node 2', 'Node 5']
]


Here’s another demo with a little more complexity. The nodes represent the Indo-Europen language tree with links representing relationships between the languages.


Notice the use of colors to help the reader to see the clusters quickly. The orange color represents the Italic language, whereas the green and pink colors represent the Celtic and the Indo-Iranian languages, respectively.

To add a color to a node, use the nodes option that is basically an array to access any node using its id:

nodes: [{
      id: 'Indo-Iranian',
      color: indoIranianColor
    },
    ...


The color property has the node’s color; in this case, the variable indoIranianColor. The colors of the nodes are defined into variables for more flexibility and maintenance in the first line:

var celticColor = "#7becb2",
  italicColor = "#ecb27b",
  indoIranianColor = "#ec7bb6";


Another way to visualize the connections and the nature of the nodes is by adding the size variable to the networking graph; the node’s size helps to classify the categories of the node. The demo below illustrates South Korean domestic flight routes. The nodes represent the airports that are classified into three main categories:

  • Airports with more than 50 direct destinations.
  • Airports with more than 10 direct destinations.
  • Airports with less than 10 direct destinations.


The colors and sizes help readers quickly identify airport size relative to each other. Size can also be used as an accessibility aid, as it allows people who are color blind to get the data story, even if they can’t tell colors apart.

You can also use a monochrome chart for making the visualization more accessible. However, personally, I prefer the one with different sizes and colors, since it makes life easier for all readers.


Even though networking graphs are simple to create and pleasant charts to share, they might be very complex and hard to understand if they display a significant number of nodes. There is no exact amount of nodes to avoid, but try to use different colors, sizes, and of course, your common sense to make your chart easy to read as much as you can :)

Network

Opinions expressed by DZone contributors are their own.

Related

  • The Network Attach Problem Nobody Warns You About
  • Part II: The Network That Doesn't Exist: Zero Trust, Service Meshes, and the Slow Death of Perimeter Security
  • Breaking the Vendor Lock in Network Automation: A Pure Python Architecture
  • An AI-Driven Architecture for Autonomous Network Operations (NetOps)

Partner Resources

×

Comments

The likes didn't load as expected. Please refresh the page and try again.

  • RSS
  • X
  • Facebook

ABOUT US

  • About DZone
  • Support and feedback
  • Community research

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 215
  • Nashville, TN 37211
  • [email protected]

Let's be friends:

  • RSS
  • X
  • Facebook