Document toolboxDocument toolbox

Affinity chord diagram

Overview

The affinity chord diagram is used to organize and display data according to affinity. This affinity is measured by relating data using a point of interconnection, meaning the degree of affinity is determined by the number of times both source and target connect to that point. The data is arranged radially in two sectors that represent the source and the target values and connected by arcs that represent their affinity and its magnitude. It is commonly used to sort parameters into groups, based on their natural relationships.

What data do I need for this widget?

The option to create this chart will be disabled unless your query contains at least three columns, one of them with numeric values. Furthermore, it is advisable to group your data and aggregate it in order to show meaningful content on the diagram.

Creating an affinity chord diagram

  1. Go to Data Search and open the required table.

  2. Perform the required operations to get the data you want to use in the chart.

  3. After getting the required query results, click the gear icon on the toolbar and select Charts → Diagrams → Affinity Chord diagram.

  4. Drag the required columns to their corresponding fields. This chart requires you to select the following fields:

    Required fieldDescriptionData type
    SourceValues whose affinity we want to measure, defined as both the origin and destination of the relationships. These values are represented on the left section of the diagram as the source and on the right as the target. If we assign a column containing users, the diagram will evaluate the affinity between the different existing users.Any type but json
    TargetSecond set of values whose affinity we want to measure.Any type but json
    ValueNumeric field defined as the interconnection point to measure the affinity between the different values. If we assign a column containing status codes, the diagram will evaluate the number of times each user presents each status to establish the affinity between users.float, integer, duration
  5. The affinity chord diagram is displayed.

Affinity vs Bipartite

Even though these two diagrams look very similar, they have a major difference. While the Bipartite establishes relations between the elements of two different columns, the Affinity establishes relations between the elements of the same column.

Working with affinity chord diagrams

Hover over a segment or arch in the diagram to display the relationship between a source and a target, as well as the value used to measure their affinity.

You can hit the following keys to perform different visualization actions:

Shortcut keysDescription

D

Shows/hides a legend displaying the number and percentage of the values in the chart.

L

Shows/hides the labels indicating the values of each diagram section.

S

Switches between viewing the data of the argument selected as the Source and the data of the argument selected as the Target.

?

Shows/hides the list of shortcut keys.

Query example

You can recreate the example shown in the picture above with the data from the following query and mapping the fields as follows:

from siem.logtrust.web.activity
  group every 5m by url, referer
  every 5m
  select count() as count
Required fieldColumn added
Sourceurl
Targetreferer
Valuecount