A companion function Sankey Widget that produces data compatible with the widget. For more information about Sankey widgets, see Sankey Diagram Widget.

ParameterTypeRequiredDefault ValueDescription
sourcestringrequired   The field containing the source node ID.
targetstringrequired   The field containing the target node ID.
weightaggregateoptional[a] count(as=_count) A function used to calculate the weight the edges. Good candidates are functions like, for example, sum(), count() or max().

[a] Optional parameters use their default value unless explicitly set.

sankey() Syntax Examples

For a webserver log, shows which URLs match HTTP methods:

logscale
#type=accesslog
| sankey(source=method, target=url)

For a webserver log, shows referrers by URL:

logscale
#type=accesslog referrer!="-"
| sankey(source=referrer, target=url)

sankey() Examples

Click + next to an example below to get the full details.

Create Sankey Diagram Calculating Edge Thickness

Create a Sankey diagram calculating the edge thickness using the sankey() function with an aggregator