tasks/workstreams/graph-library/archive/add-advanced-typography-controls-for-vega-generated-chart-text.md


type: task id: GRAPH_LIBRARY-ADD_ADVANCED_TYPOGRAPHY_CONTROLS_FOR_VEGA_GENERATED_CHART_TEXT title: Add advanced typography controls for Vega-generated chart text description: Document and later implement a DFT control surface for advanced text styling on Vega-generated chart text, especially numeric OpenType features like tabular-nums lining-nums for axis labels, titles, and legends. milestone: m1-ft-analytics-analyst-pilot owner: data-viz-designer-engineer status: not_started priority: p2


Add advanced typography controls for Vega-generated chart text

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

Document and later implement a DFT control surface for advanced text styling on Vega-generated chart text, especially numeric OpenType features like tabular-nums lining-nums for axis labels, titles, and legends.

Context

This came up during M1 chart-structure critique while inspecting the rendered SVG for standard Vega-Lite charts in the structure lab.

Important observations:

Example observed SVG text nodes:

What DFT already does successfully on DFT-owned text:

So the precedent already exists:

Design direction already established in chart notes:

Constraint:

Possible Solutions

  1. Recommended: Add a DFT typography control surface for generated chart text roles, then map it into Vega/Vega output. Example target roles: - axis labels - axis titles - chart titles - legend labels - legend titles Example control concepts: - numeric_figures: tabular-lining - or raw style tokens like font_variant_numeric: "tabular-nums lining-nums" This keeps the solution systematic and reusable.

  2. Add a narrow numeric-axis-only feature first. For example, only wire tabular/lining figures for quantitative axis labels. This is probably the fastest way to prove the path, but it risks becoming too special-case unless followed by a broader typography model.

  3. Use raw post-processing on the generated SVG output. This may work tactically if Vega/Vega-Lite config surfaces do not expose the needed style properties cleanly, but it is more fragile and less elegant than first-class mapping.

  4. Keep advanced figure controls only on DFT-owned text and leave Vega-generated text alone. This preserves simplicity, but it leaves a visible inconsistency across analytical surfaces and misses a high-value typography improvement.

Plan

  1. Confirm which advanced text properties can be expressed natively through Vega or Vega-Lite config versus which require DFT-side supplementation.
  2. Define the DFT control surface for advanced typography on chart text roles.
  3. Start with the highest-value surface: quantitative axis labels.
  4. Decide the precedence model across: - theme defaults - structure defaults - chart-level overrides - final Vega-generated text nodes
  5. Expand the same system to chart titles, axis titles, and legend text if the initial path is robust.
  6. Update docs/catalog guidance so the typography contract is explicit instead of implicit.

Implementation Progress

QA Exploration

<!-- For UI/browser tasks: use Playwright MCP to explore the running app. Record bugs found, fixes applied, and suggestions for future work. Skip for non-UI tasks (mark N/A). -->

Notes:

Review Feedback

<!-- Reviewer comments, what was changed in response, and sign-off. -->