How I obtained the data

Compared to my previous experience, it was a lot simpler to obtain the messages from my chats because Telegram released the Chat Export Tool, so I used it and downloaded the data I needed in the JSON format.

One thing that I really liked about the JSON file is that it also contained the “frequent_contacts” list. I used this information to decide which chats were the most interesting to visualize (every chat has a rating given by some internal algorithms). It says that:

This rating shows which people you are likelier to message frequently. Telegram uses this data to populate the ‘People’ box at the top of the Search section. […]

This is how the file looks like for the part we are interested in.

We have a list of chats: for every chat we have the name of the contact and the related list of messages sent and received.

For every message we look for the sender (from) and the date.

When I have a collection of data (in a form that the sum of the messages I sent and received for each day is computed) I can start drawing my sketch.

Visualization part

I started by doing a consideration: how many messages do I send/receive every day to a someone? 5? 20? 50? It depends on the contact. Since I focus my attention on the “frequent contacts” I suppose I sent at least 30 messages a day to each of them.

Suppose that we want the two lines (mine and the other contact’s one) to touch each other when we send at least 60 messages (30 + 30 for example, or 20 + 40).

We have two starting heights (one for me and one for the other contact). For each of the 366 days in the year (Jan 1 represented at x = 0, Jan 2 at x = 1, and so on…), we look for the sum of the messages one sends. The sum determines the distance from the starting height (y). 🤔

So we have 366 couples (x,y) for each of us. Through the interpolation of all these points we can create the final line.

I also wanted to know if I and the other contact write to each other the same (or similar, n_mine — n_other < 5) amount of messages. So I decided to represent this information with an ellipse in the middle of the two starting heights. The size and the opacity of the ellipse are given by the number of (messages one sends)/(the number of maximum messages I think one sends) which above is told to be 30, but in the visualizations I used the value 80 🙊😁).