Press "Enter" to skip to content

Category: Visualization

Building a Rayfin App to Replay Soccer Games

Nikola Ilic builds an app:

On 29 November 2010, Barcelona beat Real Madrid 5-0 at Camp Nou. This week I “watched” that match again, event by event, on a pitch inside Microsoft Fabric: Xavi at 9′, Pedro at 17′, Villa twice after the break, and Barcelona’s xG line climbing to 2.77 while Madrid’s stayed flat at 0.13.

If you know me, you know I’m a huge football and Barça fan. So when Microsoft introduced Rayfin, the open-source SDK and CLI that deploys a full application backend straight onto Fabric, I knew what my first Fabric App would be: a live match center.

This post covers what I built, the scripts that turned the whole setup into one command, and a step-by-step guide to run the same Clásico in your own workspace.

Click through for the architecture and the process. Nikola also has the repo available if you want to re-create it yourself.

Incidentally, if you want to do something similar with American football, the NFLfastR package ties in with play by play datasets going back to 1999 and that get updated the day after each game.

Leave a Comment

Working with the Power BI Gantt Chart

Valerie Junk tries out a new built-in visual:

Almost every company runs projects or has some kind of timeline, and most of the time that planning is tracked somewhere else, for example, in an Excel file or in another tool. But at the same time, most of our data is already in Power BI. Until now you basically had two options:

  • A custom visual which might need a paid license.
  • A workaround you build yourself, like a stacked bar chart or a matrix with conditional formatting, which works, but every change means fixing your own workaround.

It looks fairly reasonable, though I do hope the Power BI team is able to relax some of those restrictions before it goes GA. Because I’m only so much of a masochist, I didn’t look up whether Power BI Report Server will include this visual. Maybe it will three years from now.

Leave a Comment

Dealing with Bias in Data Stories

Cole Nussbaumer Knaflic provides some advice:

Yesterday, a participant in one of our workshops asked a question that I’ve been thinking about ever since. She works with researchers and statisticians, and the idea of telling a story with data can make some of them uncomfortable. Doesn’t telling a story mean choosing a perspective? And doesn’t choosing a perspective introduce bias? Wouldn’t it be more objective to simply show the data and let people draw their own conclusions?

Read on for Cole’s answer. Cole differentiates between “bias” and “perspective,” though I wouldn’t even go that far. Instead, I’d simply make it clear what your biases are. At its core, a bias is a preference for or against something. We normally think of bias as a negative, but that’s not strictly true. I do think it’s important to state where your biases come in, as they can undermine a point or attempt to drive people to a specific conclusion. But bias itself can extend to “I am showing you this information because I believe it will help you in making your decision,” even if that decision isn’t one you necessarily prefer.

Comments closed

Scatter and Sampling in Power BI Core vs Deneb

Kerry Kolosko shows some comparisons:

In almost a decade of building Power BI reports, a common blind spot I still see from colleagues regards data point limits in core visuals — largely unnoticed until someone maps their data and finds entire regions are missing.

Compare the following lasagne plot created using a Power BI core visual scatterplot with one created using a Power BI custom visual (Deneb).

Click through for the difference. The more I see Deneb, the more impressed I am with it. I’ve seen people do some wild things with it while still working just fine in Power BI. There’s even compatibility with Power BI Report Server, if you can believe it.

Comments closed

Dodging in ggplot2

Zenguo Zhang teaches a lesson:

In ggplot2, when displaying grouped data along categorical axes (such as grouped bar charts, boxplots, or error bars), horizontal dodging is used to prevent elements from overlapping at each categorical position. ggplot2 provides two primary dodging position functions: position_dodge() and position_dodge2().

Click through or else Piccolo is going to yell again.

Comments closed

Visual Design and Generative AI

Cole Nussbaumer Knaflic guides the non-thinking machine:

Now that we have the story planned, it’s time to start developing the content that will support our message and narrative. When data is part of that, a good first step is choosing a visual that aids in comprehension. The right graph makes your point immediately clear. The wrong one makes your audience spend their mental energy decoding the graph instead of understanding your message.

This is where people sometimes stumble. They use the first chart that comes to mind—or simply carry forward the one they used during exploratory analysis. But a graph that works for exploring data isn’t necessarily the best for communicating it. Your audience and takeaway should drive the choice. By this point, you’ve already done that work: you know your audience, you’ve planned your story, and you’ve written takeaway titles that tell you exactly what each graph needs to show. Let those sentences guide your design.

As you’d expect, there’s some good advice on choosing specific types of visuals. But the majority of this article is around nudging the language model to spit out the correct visual for the right reasons.

Comments closed

Charting Average Full Database Backup Durations with R

Thomas Williams has a script:

DBAs spend time dealing with SQL Server performance, capacity, monitoring, troubleshooting, provisioning, etcetera; I’ve previously mentioned that R is a powerful, open-source language with a great ecosystem of libraries for analysis and visualisation, so it’s no surprise that I think mixing SQL Server and R Markdown for reporting goes together like a Vegemite and cheese sandwich…lunch perfection!

Here’s a couple of real-world examples of how I’ve used R Markdown connected to SQL Server (for a recap of how to do this from a technical perspective, see my earlier blog post “Connecting to a SQL Server database from R Markdown”):

This is a neat approach to visualizing database backup times as a process control chart.

Comments closed

Applying Color Thoughtfully

Amy Esselman provides some guidance:

One of our top tips for explanatory communications is to use color sparingly and purposefully to help your audience understand your data and message. Color should be an explicit choice, not something your software applies by default, whether that’s a graphing tool or an AI assistant generating your first draft. These tools can build a chart in seconds. They might even add highlighting on their own. But they don’t know which data matters most to your audience. That call is still yours. Used thoughtfully, color is often one of the quickest ways to improve a graph.

Color is an extremely powerful pre-attentive attribute, meaning that it’s something we intuitively see and respond to without explicit thought. That’s why choosing what to color can be so powerful. If everything has bright, distracting colors, you lose an avenue to guide the viewer’s eye. But Amy’s example is a good one to show the particular element(s) in the visual that you want people to focus on, and the viewer’s eyes will automatically go there.

Comments closed

Dual Y Axes in R with ggplot()

Andrea Onofri builds a complex chart:

I have often found myself needing to plot a single graph with two y-axes having different scales. For example, this might be useful for representing temperature and rainfall data at a given location. Unfortunately, doing this with ggplot() is not straightforward.

As Andrea mentions, there are specific circumstances in which having a dual-axis chart is reasonable, and click through to learn how. ggplot2 tends to be rather opinionated regarding visual choice and design. I happen to like those opinions and think they are generally correct, but I can also recognize that there may be exceptions to the rules. For those instances, I think “Somewhat difficult but not impossible” is a solid answer, as it keeps people from doing things inappropriately with a couple of mouse clicks, like setting up those stupid 3D bar charts in Excel. H/T R-Bloggers.

Comments closed