Donut Chart

Rebuilds the catalogue donut chart with annular sectors, center text, direct labels, and a legend.

Donut Chart
Gallery Donut Pipeline pipeline

Data Sources

5

Fields

22

Scales

1

Layers

8

Glyphs

24

rect 7 / path 5 / text 12

Central: 18 (12.86%)West: 22 (15.71%)East: 27 (19.29%)South: 31 (22.14%)North: 42 (30%)140k140k30%30%22.14%22.14%19.29%19.29%15.71%15.71%12.86%12.86%NorthSouthEastWestCentralregion

Build Path

Gallery Donut Pipeline

This example is rebuilt from gallery data source regional-sales by recipe donutChart: raw table rows -> TabularSource -> pipeline drafts -> analyzeAuthoringDrafts() -> materialized ChartSpec -> compileChart() -> SceneGraph -> SVG. The graph below shows the authored pipeline stage.

Pipeline recipe graph

7 pipelines
8 nodes
6 edges

Data Flow Diagram

0/273 nodes
0/456 edges
273 hidden

Select a glyph to highlight its complete source path.

Scope

Roles

source
transform
field
scale
layer
param
glyph

No matching flow nodes

Adjust search, scope, or role filters.

Available Data

5 tables
1 transforms

Imported table

source_gallery_donutchart
raw
5 columns
feeds pipeline_polar_sectors_transform

ChartSpec

{
  "id": "gallery.donutChart",
  "data": [
    {
      "id": "source_gallery_donutchart",
      "rows": 5
    },
    {
      "id": "source_sectors",
      "rows": 5
    },
    {
      "id": "pipeline_value_donut_center_label_layer_literal_text",
      "rows": 1
    },
    {
      "id": "__guide.pipeline_region_legend_guide",
      "rows": 5
    },
    {
      "id": "__guide.pipeline_region_legend_guide.title",
      "rows": 1
    }
  ],
  "transforms": [
    {
      "id": "pipeline_polar_sectors_transform",
      "type": "layout",
      "input": "source_gallery_donutchart",
      "output": "source_sectors",
      "options": {
        "count": 1,
        "errorMethod": "standardError",
        "fit": "contain",
        "includeMax": true,
        "innerRadius": 70,
        "labelField": "region",
        "layout": "pipeline_value_donut_panel_layout",
        "layoutKind": "polarSectors",
        "layoutMode": "proportionalAngle",
        "mode": "normal",
        "order": [],
        "outerRadius": 138,
        "paddingInner": 1.2,
        "value": "value"
      }
    }
  ],
  "axes": [],
  "grids": [],
  "legends": [
    {
      "id": "pipeline_region_legend_guide",
      "scale": "pipeline_region_color_color_scale",
      "kind": "color",
      "title": "region"
    }
  ],
  "fields": [
    "__rowLabel",
    "id",
    "region",
    "value",
    "endAngle",
    "formatted",
    "innerRadius",
    "labelX",
    "labelY",
    "midAngle",
    "outerRadius",
    "pathD",
    "percentLabel",
    "share",
    "startAngle",
    "tooltip",
    "text",
    "label",
    "x",
    "y",
    "symbolX",
    "symbolY"
  ],
  "scales": [
    {
      "id": "pipeline_region_color_color_scale",
      "type": "ordinal",
      "domain": {
        "source": "field",
        "data": "source_sectors",
        "field": "region",
        "fields": [],
        "includeZero": false,
        "order": "input",
        "reverse": false,
        "symmetric": false
      }
    }
  ],
  "layers": [
    {
      "id": "pipeline_region_legend_guide-swatches",
      "mark": "rect",
      "role": "guide"
    },
    {
      "id": "pipeline_region_legend_guide-labels",
      "mark": "text",
      "role": "guide"
    },
    {
      "id": "pipeline_region_legend_guide-title",
      "mark": "text",
      "role": "guide"
    },
    {
      "id": "create_chart_surface",
      "mark": "rect",
      "role": "context"
    },
    {
      "id": "pipeline_value_donut_panel_layout_surface",
      "mark": "rect",
      "role": "context"
    },
    {
      "id": "pipeline_value_donut_sectors_layer",
      "mark": "path",
      "role": "data",
      "path": {
        "directD": true,
        "areaBand": false,
        "closedToY": false,
        "curve": "linear",
        "sortBy": "value"
      }
    },
    {
      "id": "pipeline_value_donut_labels_layer",
      "mark": "text",
      "role": "guide"
    },
    {
      "id": "pipeline_value_donut_center_label_layer",
      "mark": "text",
      "role": "guide"
    }
  ]
}

Resolved SceneGraph

{
  "scene": "gallery.donutChart.scene",
  "scales": [
    {
      "id": "pipeline_region_color_color_scale",
      "type": "ordinal",
      "domain": [
        "North",
        "South",
        "East",
        "West",
        "Central"
      ],
      "range": [
        "var(--colors-blue-9)",
        "var(--colors-green-9)",
        "var(--colors-orange-9)",
        "var(--colors-purple-9)"
      ]
    }
  ],
  "layers": [
    {
      "id": "create_chart_surface",
      "role": "context",
      "zIndex": -10,
      "glyphs": 1
    },
    {
      "id": "pipeline_value_donut_panel_layout_surface",
      "role": "context",
      "zIndex": 0,
      "glyphs": 1
    },
    {
      "id": "pipeline_value_donut_sectors_layer",
      "role": "data",
      "zIndex": 20,
      "glyphs": 5
    },
    {
      "id": "pipeline_value_donut_center_label_layer",
      "role": "guide",
      "zIndex": 20,
      "glyphs": 1
    },
    {
      "id": "pipeline_value_donut_labels_layer",
      "role": "guide",
      "zIndex": 25,
      "glyphs": 5
    },
    {
      "id": "pipeline_region_legend_guide-swatches",
      "role": "guide",
      "zIndex": 40,
      "glyphs": 5
    },
    {
      "id": "pipeline_region_legend_guide-labels",
      "role": "guide",
      "zIndex": 41,
      "glyphs": 5
    },
    {
      "id": "pipeline_region_legend_guide-title",
      "role": "guide",
      "zIndex": 42,
      "glyphs": 1
    }
  ]
}

Glyph Data Tree

8 layers

Full parameter lineage for the active compiler surface.

create_chart_surface

1

pipeline_value_donut_panel_layout_surface

1

pipeline_value_donut_sectors_layer

5

pipeline_value_donut_center_label_layer

1

pipeline_value_donut_labels_layer

5

pipeline_region_legend_guide-swatches

5

pipeline_region_legend_guide-labels

5

pipeline_region_legend_guide-title

1

Glyph Inspector

none

Select a glyph in the chart to inspect resolved params and lineage.