Visualize aggregations

In the previous lesson, you learned how to visualize data in an Aura database.

In this lesson, you will learn how to:

  • Connect to your Aura instance using the integrated Explore tool.

  • Compare different ways to visualize aggregated metrics.

  • Visualize your aggregated data without using our GenAI tools.

  • Write Cypher queries to explore your data.

Quick introduction

The Explore tool is a powerful interface for visualizing and exploring your graph data. It allows you to interact with your data in a more intuitive way, without needing to write Cypher queries. You can search for nodes and relationships, visualize them, and even edit the graph directly, IF you have write access to the db.

Connecting

From the Aura console, either go to Instances and select the instance you want to connect to and use the Connect dropdown and select Explore, or directly to Explore and use the Connect button from there.

exploretool_connect

Before you do either, check that the data from the Import lesson has been loaded.

exploretool_start

Explore

Once connected, you can start exploring your data without writing any Cypher. The UI consists of a searchbar, a scene where the results are visualized, and a legend panel. To get started:

  • <click> in the searchbar

  • <select> Person

  • <select> Person name:value

  • <select> Person name(equals):value

  • <type> Tom Hanks

  • <select> ACTED_IN

  • <select> Movie

exploretool_query

Use the Run button or press Ctrl+Enter to execute the search.

exploretool_result

You may have to zoom in a bit before the details are shown.

Notice that your styling choices are kept between runs and can even be shared with other users, using the Perspectives feature.

exploretool_styling

Visualizing the data

There are multiple visualization types available in Aura Dashboards, each suited for different data representation needs.

From the card editor, select the dropdown menu under Visualization type to choose the most appropriate visualization for your data:

Change card type dialog

In Aura, the Dashboard tool supports only the following visualization types:

  • Graph - Ideal for showing relationships between nodes.

  • Table - Best for detailed data representation.

  • Line Chart - Useful for showing trends over time.

  • Bar Chart - Suitable for comparing quantities across categories.

  • Pie Chart - Great for displaying proportions of a whole.

  • Single Value - Perfect for highlighting a key metric.

  • Text - Useful for adding descriptive information or context.

Graph card

The Graph visualization type is ideal for displaying relationships between nodes in your graph database. It provides an interactive way to explore how different entities are connected.

You can either use the AI assistant to generate a graph card based on a natural language prompt, or write a Cypher query to fetch specific nodes and relationships.

For example, you can create a graph card to visualize the relationships between actors and movies: image::images/ai-generated-graph.png[Graph card example,width=600,align=center]

Table card

The Table visualization type is best for detailed data representation. It allows you to display data in a structured format, making it easy to read and analyze.

You can create a table card to show a list of movies along with their genres and release years:

Execute the following Cypher query in the card editor to get the results:

cypher
MATCH (u:User)-[r:RATED]->(m:Movie)
RETURN m.title AS movie, u.name AS user, r.rating AS rating
ORDER BY r.rating DESC
LIMIT 10
Table card example

Line chart card

The Line Chart visualization type is useful for showing trends over time. It allows you to visualize data points connected by lines, making it easy to identify patterns and fluctuations.

You can create a line chart card to visualize the average ratings of movies over time:

Execute the following Cypher query in the card editor to get the results:

cypher
MATCH (m:Movie)
WITH m, toInteger(m.year / 10) * 10 AS decade
RETURN decade, count(m) AS movieCount
ORDER BY decade

After running this query, select Line Chart from the visualization type dropdown to display the results. You should obtain something similar to this:

Line Chart card example

Bar Chart card

The Bar Chart visualization type is suitable for comparing quantities across categories. It provides a clear visual representation of data, making it easy to identify trends and patterns.

You can create a bar chart card to visualize the ratings distribution per location:

Execute the following Cypher query in the card editor to get the results:

cypher
MATCH (p:Person)-[:DIRECTED]->(m:Movie)
RETURN p.bornIn AS country, count(m) AS movieCount
ORDER BY movieCount DESC
Bar Chart card example

Challenge: Create a bar chart card to visualize the number of movies directed by each person.

Pie Chart card

The Pie Chart visualization type is great for displaying proportions of a whole. It allows you to visualize how different categories contribute to the total.

You can create a pie chart card to visualize the distribution of directors average movie ratings:

Ask the GenAI assistant to create a pie chart card using the following prompt: "Create a pie chart showing directors with the highest average movie ratings." or run the following Cypher query in the card editor to get the results:

cypher
/* Which directors have the highest average movie ratings? */

MATCH (d:Director)-[r:DIRECTED]->(m:Movie)<-[r2:RATED]-(u:User)
WITH d, avg(r2.rating) AS averageRating
ORDER BY averageRating DESC
RETURN d.name AS directorName, averageRating
LIMIT 10

You should obtain something similar to this:

Pie Chart card example

Single Value card

The Single Value visualization type is perfect for highlighting a key metric. It allows you to display a single data point prominently, making it easy to focus on important information.

You can create a single value card to show the total number of movies in the database:

Execute the following Cypher query in the card editor to get the results:

cypher
MATCH (n)
RETURN COUNT(n) as Total

You should obtain something similar to this:

Single Value card example

If you have obtained a different value, don’t worry! The data in your Aura instance may vary based on other activities you have performed.

Text card

This visualization type is useful for adding descriptive information or context to your dashboard. It allows you to include text elements that can provide explanations, titles, or any other relevant information, written in markdown format.

This is a practical way to add context to your dashboard and help stakeholders understand the data being presented, as well as generating a local overview of all dashboards in one place by inserting the images of each dashboard.

For example, you can create a text card to describe the purpose of your favourite movie, in this example, The Matrix:

Copy and paste the following markdown text into the card editor:

markdown
# The Matrix (1999)

## Overview
A computer hacker learns from mysterious rebels about the true nature of his reality and his role in the war against its controllers.

## Details

**Director:** The Wachowskis
**Released:** March 31, 1999
**Runtime:** 136 minutes
**Rating:** R

### Genre
- Science Fiction
- Action
- Cyberpunk

### Cast
- **Keanu Reeves** as Neo
- **Laurence Fishburne** as Morpheus
- **Carrie-Anne Moss** as Trinity
- **Hugo Weaving** as Agent Smith

## Box Office & Reception

**Budget:** $63 million
**Box Office:** $467.2 million worldwide
**IMDb Rating:** 8.7/10
**Rotten Tomatoes:** 88% (Critics), 85% (Audience)

## Awards
- 🏆 4 Academy Awards (Visual Effects, Sound, Film Editing, Sound Effects Editing)
- 🏆 2 BAFTA Awards

## Key Relationships in Graph
```
(The Matrix)-[:DIRECTED_BY]->(The Wachowskis)
(Keanu Reeves)-[:ACTED_IN {role: "Neo"}]->(The Matrix)
(The Matrix)-[:GENRE]->(Science Fiction)
```

## Tagline
*"Free your mind."*

---

**Last Updated:** 2025-11-11
**Data Source:** Neo4j Movies Database

In the card editor, the markdown text will be rendered as follows:

text card example part 1

In the screenshot above, you can see the first part of the rendered markdown text. Scrolling down will reveal the rest of the content, and you can also use the menu on the bottom left to edit, insert, or view the raw markdown text.

On the dashboard page, the text card will appear as a brief overview of the movie:

text card example part 2

Challenge: Use your creativity to add more text cards to your dashboard, providing context and insights about the data being visualized.

Visualising aggregated data

You have now seen multiple ways to visualize aggregated data using different card types in Aura Dashboards.

When working with aggregated data, it’s important to choose the right visualization type that effectively communicates the insights you want to convey. Consider the following factors when selecting a card type:

  1. Data Granularity: Understand the level of detail in your data. Some visualizations work better with high-level aggregates, while others are more suited for detailed breakdowns.

  2. Audience: Consider who will be viewing the dashboard. Tailor your visualizations to the needs and preferences of your audience.

  3. Context: Provide context for your visualizations. Use text cards to explain the significance of the data and highlight key insights.

  4. Interactivity: Leverage interactive features, such as filters and drill-downs, to allow users to explore the data further.

Hands on challenge: Create a new dashboard for the marketing team to visualize the following aggregated metrics:

  • Total number of movies per genre.

  • Average movie ratings per decade.

  • Top 5 directors with the highest average movie ratings.

Use the appropriate card types to represent each metric effectively, and add text cards to provide context and explanations for the visualizations.

Share your dashboard with your peers and discuss the choices you made for each visualization, or post it on our community forum for feedback Neo4j Community.

If you are new to data aggregation, these metrics will help you get started.

Run the following Cypher queries to get the aggregated data for each metric, in a separate card each time. Feel free to choose the visualization type that best represents the data.

  • Count metrics: Total number of nodes or relationships that meet specific criteria.

cypher
MATCH (m:Movie)
RETURN count(m) AS total_movies
  • Average metrics: The average value of a specific property across a set of nodes or relationships.

cypher
MATCH (m:Movie)-[:IN_GENRE]->(g:Genre)
RETURN g.name AS genre,
    avg(toFloat(m.rating)) AS average_rating,
    count(m) AS total_movies
ORDER BY average_rating DESC
  • Distribution metrics: The spread of values for a specific property across nodes or relationships.

cypher
MATCH (m:Movie)
WHERE m.rating IS NOT NULL
RETURN m.rating AS rating,
    count(*) AS count
ORDER BY rating DESC

Reusing queries

You can reuse the Cypher queries provided in this lesson to create multiple cards with different visualization types. For example, you can create both a bar chart and a pie chart using the same query to visualize the distribution of movie ratings. Also, feel free to modify the queries to explore different aspects of your data., and Cypher functions like count(), avg(), and sum() can be very useful for aggregating data.

  1. The model has to be understood. You can explore the data knowing what the database holds and how it is organized.

  2. Security does apply. If the user’s role does not allow editing the database this step will not work. The user will be informed about that.

  3. Defining these queries (also known as search phrases) does require knowledge of Cypher syntax. As the Perspectives can be shared, not everybody needs to have that knowledge.

Check your understanding

Purpose of visualizing the aggregated data

What is the purpose of visualizing aggregated data using the integrated Cypher editor tool in Neo4j Aura Dashboards?

  • ❏ To create detailed individual records for each data point.

  • ✓ To gain insights from summarized data metrics.

  • ❏ To export raw data for external analysis.

  • ❏ To generate random data visualizations.

Hint

Think about why aggregated data is useful for analysis and decision-making.

Solution

Visualizing aggregated data helps to identify trends, patterns, and insights that may not be apparent from raw data alone. It allows users to make informed decisions based on summarized information, facilitating better understanding and communication of key metrics.

Summary

In this lesson, you learned how to explore and visualize your aggregated data using the integrated Explore and Dashboards tools.

In the next lesson, you will learn how to share and publish your dashboards to stakeholders for collaboration and decision-making.

Chatbot

How can I help you today?