Sankey

Use a Sankey chart to show weighted flow between two categorical stages.

Every preview on this page is generated from the YAML shown below it using a fixed documentation dataset.

Basic flow

Map two dimensions to source and target nodes and one measure to link width, revealing how orders flow from status to delivery speed.

Key fields
visuals:
  status_delivery_flow:
    title: Status to delivery speed
    description: Shows flow from order status to delivery-speed bucket.
    type: sankey
    query:
      dimensions:
        status: orders.status
        delivery_bucket: orders.delivery_bucket
      measures:
        order_count: null
      sort:
        - field: value
          direction: desc
      limit: 40

Alternate flow

Replace the source and target dimensions to inspect category-to-status flow without changing the weighted graph contract.

Key fields
visuals:
  category_status_flow:
    title: Category to status flow
    type: sankey
    query:
      dimensions:
        category: orders.category
        status: orders.status
      measures:
        order_count: null
      sort:
        - field: value
          direction: desc
      limit: 60

Spacious nodes

Increase presentation.node_gap when labels or links feel crowded, and tune curveness to keep parallel flows visually distinct.

Key fields
visuals:
  category_status_flow_spacious:
    title: Spacious category to status flow
    type: sankey
    presentation:
      node_gap: 18
      curveness: 0.32
    query:
      dimensions:
        category: orders.category
        status: orders.status
      measures:
        order_count: null
      sort:
        - field: value
          direction: desc
      limit: 60

API reference

Kind: chart. Renderer: echarts. Supported result shapes: graph.

FieldTypeDefaultAllowed valuesDescription
query.dimensionsfield mappingGroups query results and supplies category, hierarchy, matrix, graph, or geographic labels.
query.limitintegerno limitpositive integerCaps the number of rows returned to the renderer.
query.measuresmeasure mappingSelects the governed semantic measures consumed by the visual shape.
query.sortsort listOrders query results by a returned field or measure alias.
presentation.curvenessnumber0.50–1Controls the curvature of graph or Sankey links.
presentation.node_gapnumber80 or greaterSets the vertical gap between Sankey nodes.

Accessibility. Use meaningful node labels and keep the hierarchy or flow small enough to follow without relying on color alone.