I have a process which checks workers in a service once a day. When it checks them, they will have one of a few states:

  • Unknown - Either brand new or the worker is offline
  • Inprogress - When checked, an operation was blocking the machine
  • Error - Something went wrong
  • Complete - everything is perfect
  • CorrectionWasRequired - everything is perfect but we had to do something to make it happen.

The data set looks like this:

machineID StatusHistoryInOrder
First Unknown,InProgress,Complete,Error,Error,CorrectionWasRequired,Complete
Second Unknown,Complete,Complete,Complete,Complete...
ProblemChild Unknown, Error, Error...
MissingMachine Unknown....

Right now, they do not have the same number of data points but I can pad them if that makes it easier (repeating the last state X times until all are equal length)

The data points are in ascending timestamp order, so each represents one day, from oldest to newest.

My goal is to visualize and understand the most common sets of statuses that my devices end up in.

My questions are :

  1. Is this the right type of visualization to use?
  2. Is this the easiest approach to analyze my status histories to find the 5 most common patterns?
  3. Tips for rendering this?

I am trying to work up a ribbon view, like so. In this mockup, I'm showing one machine only.

enter image description here


2 Answers 2

  1. I think your visualization is okay to show common paths of state change. However, it skims over some of the detail of the probability of all the devices changing states. For that reason I would suggest a Sankey diagram. Example below, instead of Severity at Weeks 0, 1, 3, etc., you would have Status at Time 0, 1, 2, etc.

Example Sankey

  1. Again, I recommend a Sankey diagram to get a picture of all devices, but your diagram does show a specific example nicely.

  2. Sankey diagrams can be built in R with the networkD3 package, how to use tutorial here. I don't know how to render your custom graphic.

  • 1
    $\begingroup$ Oh, thank you! I have never heard of a Sankey diagram and this does sound like a good fit. Thanks. $\endgroup$
    – FoxDeploy
    Commented Mar 25, 2022 at 16:55

I was able to achieve this by transforming my data using a simple script. First, I had to know that Sankey charts are made using just three columns, source, destination and weight.

So a chart to make a chart like this, showing how people move through countries for vacation:

enter image description here

I needed to convert the multiple states into just two columns. So the key was to add a number for the iteration count that mattered, like so:

enter image description here

I just did the same thing to my data. Thanks to @underminer for pointing out the type of chart to use, which lead me to my answer.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.