Pie Chart

Proportional category shares derive sector paths, labels, and a color legend from raw rows.

Pie Chart

Data Sources

4

Fields

20

Scales

1

Layers

5

Glyphs

21

path 5 / text 11 / rect 5

Search: 34 (34%)Direct: 26 (26%)Social: 18 (18%)Email: 14 (14%)Referral: 8 (8%)34%26%18%14%8%SearchDirectSocialEmailReferralChannel

Data Flow Diagram

0/204 nodes
0/341 edges
204 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

4 tables
1 transforms

Channel share

channel-share
raw
4 columns
feeds pie-sector-layout

ChartSpec

{
  "id": "catalogue.pie-chart",
  "data": [
    {
      "id": "channel-share",
      "rows": 5
    },
    {
      "id": "sectors",
      "rows": 5
    },
    {
      "id": "__guide.channel-legend",
      "rows": 5
    },
    {
      "id": "__guide.channel-legend.title",
      "rows": 1
    }
  ],
  "transforms": [
    {
      "id": "pie-sector-layout",
      "type": "layout",
      "input": "channel-share",
      "output": "sectors",
      "options": {
        "labelField": "channel",
        "layout": "plot",
        "layoutKind": "polarSectors",
        "outerRadius": 138,
        "paddingInner": 1.2,
        "value": "value"
      }
    }
  ],
  "legends": [
    {
      "id": "channel-legend",
      "scale": "color",
      "kind": "color",
      "title": "Channel"
    }
  ],
  "fields": [
    "channel",
    "value",
    "share",
    "pathD",
    "labelX",
    "labelY",
    "percentLabel",
    "tooltip",
    "startAngle",
    "endAngle",
    "midAngle",
    "innerRadius",
    "outerRadius",
    "formatted",
    "label",
    "x",
    "y",
    "symbolX",
    "symbolY",
    "text"
  ],
  "scales": [
    {
      "id": "color",
      "type": "ordinal",
      "domain": {
        "source": "field",
        "data": "sectors",
        "field": "channel"
      }
    }
  ],
  "layers": [
    {
      "id": "channel-legend-swatches",
      "mark": "rect",
      "role": "guide"
    },
    {
      "id": "channel-legend-labels",
      "mark": "text",
      "role": "guide"
    },
    {
      "id": "channel-legend-title",
      "mark": "text",
      "role": "guide"
    },
    {
      "id": "pie-sectors",
      "mark": "path",
      "role": "data",
      "path": {
        "directD": true,
        "areaBand": false,
        "closedToY": false,
        "curve": "linear",
        "groupBy": [
          "id"
        ]
      }
    },
    {
      "id": "sector-labels",
      "mark": "text",
      "role": "guide"
    }
  ]
}

Resolved SceneGraph

{
  "scene": "catalogue.pie-chart.scene",
  "scales": [
    {
      "id": "color",
      "type": "ordinal",
      "domain": [
        "Search",
        "Direct",
        "Social",
        "Email",
        "Referral"
      ],
      "range": [
        "var(--colors-blue-9)",
        "var(--colors-green-9)",
        "var(--colors-amber-9)",
        "var(--colors-purple-9)",
        "var(--colors-red-9)"
      ]
    }
  ],
  "layers": [
    {
      "id": "pie-sectors",
      "role": "data",
      "zIndex": 10,
      "glyphs": 5
    },
    {
      "id": "sector-labels",
      "role": "guide",
      "zIndex": 20,
      "glyphs": 5
    },
    {
      "id": "channel-legend-swatches",
      "role": "guide",
      "zIndex": 30,
      "glyphs": 5
    },
    {
      "id": "channel-legend-labels",
      "role": "guide",
      "zIndex": 31,
      "glyphs": 5
    },
    {
      "id": "channel-legend-title",
      "role": "guide",
      "zIndex": 32,
      "glyphs": 1
    }
  ]
}

Glyph Data Tree

5 layers

Full parameter lineage for the active compiler surface.

pie-sectors

5

sector-labels

5

channel-legend-swatches

5

channel-legend-labels

5

channel-legend-title

1

Glyph Inspector

none

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