Stacked Bar

Rebuilds the horizontal stacked bar chart with stack rows and interval rect segments.

Stacked Bar
Gallery Stacked Pipeline pipeline

Data Sources

6

Fields

17

Scales

3

Layers

11

Glyphs

44

rect 18 / line 14 / text 12

value stacked by series panel020406080100120Spec / Data: 38Spec / Guide: 19Spec / Interaction: 12Scale / Data: 42Scale / Guide: 26Scale / Interaction: 15Glyph / Data: 56Glyph / Guide: 22Glyph / Interaction: 21Scene / Data: 64Scene / Guide: 18Scene / Interaction: 27DataGuideInteractionseries

Build Path

Gallery Stacked Pipeline

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

Pipeline recipe graph

9 pipelines
10 nodes
15 edges

Data Flow Diagram

0/475 nodes
0/867 edges
475 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

6 tables
1 transforms

Imported table

source_gallery_stacked
raw
6 columns
feeds pipeline_stack_rows_transform

ChartSpec

{
  "id": "gallery.stacked",
  "data": [
    {
      "id": "source_gallery_stacked",
      "rows": 12
    },
    {
      "id": "source_segments",
      "rows": 12
    },
    {
      "id": "__guide.pipeline_xgrid_guide",
      "rows": 7
    },
    {
      "id": "__guide.pipeline_xaxis_guide",
      "rows": 7
    },
    {
      "id": "__guide.pipeline_colorlegend_guide",
      "rows": 3
    },
    {
      "id": "__guide.pipeline_colorlegend_guide.title",
      "rows": 1
    }
  ],
  "transforms": [
    {
      "id": "pipeline_stack_rows_transform",
      "type": "stack",
      "input": "source_gallery_stacked",
      "output": "source_segments",
      "options": {
        "count": 1,
        "errorMethod": "standardError",
        "fit": "contain",
        "groupBy": [
          "stage"
        ],
        "includeMax": true,
        "layoutKind": "",
        "layoutMode": "proportionalAngle",
        "mode": "normal",
        "order": [],
        "seriesBy": "series",
        "value": "value"
      }
    }
  ],
  "axes": [
    {
      "id": "pipeline_xaxis_guide",
      "scale": "pipeline_end_x_x_scale",
      "orientation": "bottom"
    }
  ],
  "grids": [
    {
      "id": "pipeline_xgrid_guide",
      "scale": "pipeline_end_x_x_scale",
      "orientation": "x"
    }
  ],
  "legends": [
    {
      "id": "pipeline_colorlegend_guide",
      "scale": "pipeline_series_color_color_scale",
      "kind": "color",
      "title": "series"
    }
  ],
  "fields": [
    "__rowLabel",
    "id",
    "stage",
    "series",
    "value",
    "end",
    "start",
    "tooltip",
    "total",
    "label",
    "x",
    "y",
    "symbolX",
    "symbolY",
    "labelX",
    "labelY",
    "text"
  ],
  "scales": [
    {
      "id": "pipeline_end_x_x_scale",
      "type": "linear",
      "domain": {
        "source": "field",
        "data": "source_segments",
        "field": "end",
        "fields": [
          "start",
          "end"
        ],
        "includeZero": true,
        "order": "input",
        "reverse": false,
        "symmetric": false
      }
    },
    {
      "id": "pipeline_stage_y_y_scale",
      "type": "band",
      "domain": {
        "source": "field",
        "data": "source_segments",
        "field": "stage",
        "fields": [],
        "includeZero": false,
        "order": "input",
        "reverse": false,
        "symmetric": false
      }
    },
    {
      "id": "pipeline_series_color_color_scale",
      "type": "ordinal",
      "domain": {
        "source": "field",
        "data": "source_segments",
        "field": "series",
        "fields": [],
        "includeZero": false,
        "order": "input",
        "reverse": false,
        "symmetric": false
      }
    }
  ],
  "layers": [
    {
      "id": "pipeline_xgrid_guide",
      "mark": "line",
      "role": "guide"
    },
    {
      "id": "pipeline_xaxis_guide-tick-marks",
      "mark": "line",
      "role": "guide"
    },
    {
      "id": "pipeline_xaxis_guide-labels",
      "mark": "text",
      "role": "guide"
    },
    {
      "id": "pipeline_colorlegend_guide-swatches",
      "mark": "rect",
      "role": "guide"
    },
    {
      "id": "pipeline_colorlegend_guide-labels",
      "mark": "text",
      "role": "guide"
    },
    {
      "id": "pipeline_colorlegend_guide-title",
      "mark": "text",
      "role": "guide"
    },
    {
      "id": "create_chart_surface",
      "mark": "rect",
      "role": "context"
    },
    {
      "id": "pipeline_value_stacked_by_series_panel_layout_surface",
      "mark": "rect",
      "role": "context"
    },
    {
      "id": "pipeline_value_stacked_by_series_panel_layout_frame",
      "mark": "rect",
      "role": "guide"
    },
    {
      "id": "pipeline_value_stacked_by_series_panel_layout_label",
      "mark": "text",
      "role": "guide"
    },
    {
      "id": "pipeline_value_stacked_by_series_horizontal_segments_layer",
      "mark": "rect",
      "role": "data"
    }
  ]
}

Resolved SceneGraph

{
  "scene": "gallery.stacked.scene",
  "scales": [
    {
      "id": "pipeline_end_x_x_scale",
      "type": "linear",
      "domain": [
        0,
        120
      ],
      "range": [
        104,
        692
      ],
      "ticks": [
        0,
        20,
        40,
        60,
        80,
        100,
        120
      ]
    },
    {
      "id": "pipeline_stage_y_y_scale",
      "type": "band",
      "domain": [
        "Spec",
        "Scale",
        "Glyph",
        "Scene"
      ],
      "range": [
        280,
        42
      ],
      "bandwidth": 53.550000000000004
    },
    {
      "id": "pipeline_series_color_color_scale",
      "type": "ordinal",
      "domain": [
        "Data",
        "Guide",
        "Interaction"
      ],
      "range": [
        "var(--colors-blue-9)",
        "var(--colors-orange-9)",
        "var(--colors-green-9)",
        "var(--colors-purple-9)"
      ]
    }
  ],
  "layers": [
    {
      "id": "create_chart_surface",
      "role": "context",
      "zIndex": -10,
      "glyphs": 1
    },
    {
      "id": "pipeline_xgrid_guide",
      "role": "guide",
      "zIndex": 0,
      "glyphs": 7
    },
    {
      "id": "pipeline_value_stacked_by_series_panel_layout_surface",
      "role": "context",
      "zIndex": 0,
      "glyphs": 1
    },
    {
      "id": "pipeline_value_stacked_by_series_panel_layout_frame",
      "role": "guide",
      "zIndex": 1,
      "glyphs": 1
    },
    {
      "id": "pipeline_value_stacked_by_series_panel_layout_label",
      "role": "guide",
      "zIndex": 2,
      "glyphs": 1
    },
    {
      "id": "pipeline_xaxis_guide-tick-marks",
      "role": "guide",
      "zIndex": 5,
      "glyphs": 7
    },
    {
      "id": "pipeline_xaxis_guide-labels",
      "role": "guide",
      "zIndex": 20,
      "glyphs": 7
    },
    {
      "id": "pipeline_value_stacked_by_series_horizontal_segments_layer",
      "role": "data",
      "zIndex": 20,
      "glyphs": 12
    },
    {
      "id": "pipeline_colorlegend_guide-swatches",
      "role": "guide",
      "zIndex": 40,
      "glyphs": 3
    },
    {
      "id": "pipeline_colorlegend_guide-labels",
      "role": "guide",
      "zIndex": 41,
      "glyphs": 3
    },
    {
      "id": "pipeline_colorlegend_guide-title",
      "role": "guide",
      "zIndex": 42,
      "glyphs": 1
    }
  ]
}

Glyph Data Tree

11 layers

Full parameter lineage for the active compiler surface.

create_chart_surface

1

pipeline_xgrid_guide

7

pipeline_value_stacked_by_series_panel_layout_surface

1

pipeline_value_stacked_by_series_panel_layout_frame

1

pipeline_value_stacked_by_series_panel_layout_label

1

pipeline_xaxis_guide-tick-marks

7

pipeline_xaxis_guide-labels

7

pipeline_value_stacked_by_series_horizontal_segments_layer

12

pipeline_colorlegend_guide-swatches

3

pipeline_colorlegend_guide-labels

3

pipeline_colorlegend_guide-title

1

Glyph Inspector

none

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