tasks/workstreams/graph-library/archive/add-orientation-aware-bar-direction-and-grid-defaults.md


type: task id: GRAPH_LIBRARY-ADD_ORIENTATION_AWARE_BAR_DIRECTION_AND_GRID_DEFAULTS title: Add orientation-aware bar direction and grid defaults description: Capture follow-on work to make bar direction semantics and grid defaults follow actual bar direction. Document that Vega-Lite treats vertical bars as default and horizontal bars as rotated, which is the opposite of the desired design perspective. milestone: m1-ft-analytics-analyst-pilot owner: data-viz-designer-engineer status: not_started priority: p2


Add orientation-aware bar direction and grid defaults

Superseded (2026-03-27). This narrowly scoped follow-on was consolidated into Consolidate semantic chart defaults and rendering control-surface follow-ons so the active backlog carries one M2 umbrella task instead of many M1 leaf items. Keep the notes below as reference detail, not as a separately scheduled task.

Problem

Capture follow-on work to make bar direction semantics and grid defaults follow actual bar direction. Document that Vega-Lite treats vertical bars as default and horizontal bars as rotated, which is the opposite of the desired design perspective.

Context

During M1 structure-lab work, we wanted bar charts to keep only the dependent-axis grid lines:

Today this can be hacked at the authored-chart level with per-chart settings.x_axis and settings.y_axis overrides, but it is not expressible as a clean shared structure default because structure files only provide global Vega-Lite config defaults such as axisX.grid and axisY.grid.

Relevant files:

Note: - m1-structure-bars-lines-lab.yml and chart_structures/m1-candidate.yml were captured from the parallel codex/m1-structure-lab branch during the March 26, 2026 design session. If they have not landed on main yet, treat them as historical repro artifacts rather than required files for taking this task.

Important nuance:

Possible Solutions

Plan

Recommended implementation:

  1. Trace where bar orientation is finalized in the standard renderer.
  2. Define the intended defaults in design terms: - vertical bars: x_axis.grid = false, y_axis.grid = true - horizontal bars: x_axis.grid = true, y_axis.grid = false - vertical bars with temporal x-axis: y_axis.orient = right - vertical bars with non-temporal x-axis: y_axis.orient = left
  3. Apply those defaults after orientation swapping so they follow actual bar direction, not Vega-Lite's default assumption.
  4. Preserve authored chart overrides when users explicitly set axis-grid behavior.
  5. Add regression coverage for both bar directions.

Implementation Progress

Not started.

March 26, 2026 notes:

QA Exploration

N/A for now. This task has not been implemented yet.

Review Feedback

Not started.