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

  • Securing CI/CD Pipelines Against Supply Chain Attacks: Why Artifacts and Dependencies Matter More Than Ever
  • Clean Code: Package Architecture, Dependency Flow, and Scalability, Part 4
  • C/C++ Is Where Vulnerability Programs Go to Guess
  • Tracking Dependencies Beyond the Build Stage

Trending

  • You Learned AI. So Why Are You Still Not Getting Hired?
  • Stop Using the ATM-Didn’t-Kill-Jobs Story to Reassure Developers About AI
  • Context-Aware Authorization for AI Agents
  • How Rule Engines Transform Business Agility and Code Simplicity
  1. DZone
  2. Software Design and Architecture
  3. Security
  4. The Dependency Wheel

The Dependency Wheel

A dependency wheel is an attractive and useful chart type, commonly used to visualize relations or dependencies between nodes (or elements) in the chart

By 
Mustapha Mekhatria user avatar
Mustapha Mekhatria
·
Jun. 13, 19 · Tutorial
Likes (2)
Comment
Save
Tweet
Share
11.5K Views

Join the DZone community and get the full member experience.

Join For Free

A dependency wheel is an attractive and useful chart type, commonly used to visualize relations or dependencies between nodes (or elements) in the chart. Its nodes are laid out along the outer edges of the circle with connections are drawn between them inside the circle. In addition to visualizing connections, the magnitude of each connection is also easily shown.

The demo below displays the 2016 BRICS export in a million USD. BRICS is made up of Brazil, Russia, India, China, and South Africa. The connections, in this case, illustrates trade between BRICS countries. They are “encoded” by using connector width to illustrate trade volume and color to illustrate country or origin, slightly desaturated for better visibility.

We can see that the Sino-Russian import-export volumes are close to balanced, whereas India has a negative trade balance with China, i.e. India imports more than it exports from China. It is also clear that China has the highest volume of exports between the BRICS countries.

To set up the relationship between the elements, all you have to do is to use this format: ['from', 'to', 'weight'], where from and to represents the countries, and the weight the number of the import. Example, China imported 32,229 million USD from Russia in 2016, this sentence becomes in code: ['China', 'Russia', 32229]. And the entire imports within the BRICS is:

      ['Brazil', 'Russia', 2524],
      ['Brazil', 'India', 4115],
      ['Brazil', 'China', 45738],
      ['Brazil', 'South Africa', 1401],

      ['Russia', 'Brazil', 2021],
      ['Russia', 'India', 5564],
      ['Russia', 'China', 32229],
      ['Russia', 'South Africa', 196],

      ['India', 'Brazil', 2484],
      ['India', 'Russia', 2398],
      ['India', 'China', 11757],
      ['India', 'South Africa', 3554],

      ['China', 'Brazil', 23364],
      ['China', 'India', 61311],
      ['China', 'South Africa', 12848],      
      ['China', 'Russia', 38105],

      ['South Africa', 'Russia', 255],
      ['South Africa', 'Brazil', 336],
      ['South Africa', 'India', 5814],
      ['South Africa', 'China', 22491],

Once that part is done, all you have to do is to write the dependecywheel as the chart type type: 'dependencywheel', and your code is ready to run.

Remark

To make the chart more compelling, I changed the default colors. To do that, I just added the following lines at the top of the JS code:

Highcharts.setOptions({
  colors: ['#058DC7', '#8dc705', '#c73f05', '#ffc080', '#24CBE5']
}); 

Accessibility

When you deal with a dependency wheel, colors are your main allies for making the chart attractive and easy to read. However, as an estimated 10% of the population is color-blind, it may be worth experimenting with a pattern fill or a monochrome fill in order to not exclude anybody.

Below are demos using the pattern fill and the monochrome fill.

This demo could be confusing to read for people without color blindness, as he or she is not used to processing patterns, especially in a condensed way, as shown in this demo below.

In this case, monochrome fill may be more appropriate since it is easy to read for all users.

There is more to accessibility than taking color-blindness into account. Our charts can also be processed by screen readers (such as NVDA, Jaws, Voiceover), making it possible to navigate between nodes in a chart and having their labels and values read aloud by the screen reader software. To make this possible, all we have to do is add a reference to the Highcharts accessibility module and leaving the rest of the code as-is:<script src="https://code.highcharts.com/modules/accessibility.js"></script>

The dependency wheel is a compelling chart that is not only attractive and multi-dimensional but also easy to read. Feel free to use it in your project whenever the relationship between the nodes needs to be displayed.

Dependency Chart

Published at DZone with permission of Mustapha Mekhatria. See the original article here.

Opinions expressed by DZone contributors are their own.

Related

  • Securing CI/CD Pipelines Against Supply Chain Attacks: Why Artifacts and Dependencies Matter More Than Ever
  • Clean Code: Package Architecture, Dependency Flow, and Scalability, Part 4
  • C/C++ Is Where Vulnerability Programs Go to Guess
  • Tracking Dependencies Beyond the Build Stage

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