# Sankey Diagram

Arguably an even more complex chart type is [the Sankey diagram](https://en.wikipedia.org/wiki/Sankey_diagram), named after an Irish rail engineer plotting flows in a steam engine (though preceded by [the much more famous Minard map](https://bigthink.com/strange-maps/229-vital-statistics-of-a-deadly-campaign-the-minard-map/), which demonstrated the horrifying casualties suffered by Napoleon's army as it marched to and from Moscow). \
\
This one is a bit of a brain teaser, and the Spindl version is a pretty basic rendering of the full power of a Sankey, but it can be helpful to visualize certain flows.&#x20;

Here's a Sankey showing the Page View entry points for a dex, filtered to traffic from Twitter (pretty high wallet connect rate!):

<figure><img src="/files/p4zVnZpI2x1ho8enuAAT" alt=""><figcaption></figcaption></figure>

If you want to see what swaps get traded before users drop off, here's one view:<br>

<figure><img src="/files/XugfaiRp3WPdbpzAyqVK" alt=""><figcaption></figcaption></figure>

The configuration pane can be a bit confusing, and the output almost random-seeming (a lot of it depends on layout parameters, like depth of journey, that we don't expose yet).

Some definitions:

* Event - The primary event to plot and focus on, though if users hit other events, those will appear too. If you filter, the entire chart will only be limited to events of that filtered type.
* Direction - 'Entering event' means that generally you're looking at a plot of many origin points going to one final endpoint. 'Leaving event' means you're looking at the focus event as the source of the flow, and seeing where users go after that. If you reverse it in your head a lot, join the club; so do we.&#x20;
* Expanded Events - Here you can force events to expand into different sources (or sinks) based on whatever filter dimension you choose (e.g. session channel, AKA, where they came from).&#x20;

It's hard to get a hang of it at first; play around the params until it sort of makes sense.&#x20;


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.spindl.xyz/spindl/features/web3-native-analytics/sankey-diagram.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
