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
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.
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.
This came up during M1 chart-structure critique while inspecting the rendered SVG for standard Vega-Lite charts in the structure lab.
Important observations:
<text> nodes.Example observed SVG text nodes:
<text text-anchor="start" ... font-family="'Source Serif 4', Georgia, 'Times New Roman', serif" ...>Vertical Bar - 24 Marks</text><text> nodes inside g.mark-text.role-axis-labelWhat DFT already does successfully on DFT-owned text:
font-variant-numeric: tabular-nums lining-numsdataface/core/render/faces.py:349font-variant-numeric: tabular-nums lining-numsdataface/core/render/chart/table.py:591font-variant-numeric: tabular-nums lining-numsdataface/core/render/templates/scripts/chart_interactivity.js:134So the precedent already exists:
Design direction already established in chart notes:
docs/docs/guides/chart-design-notes.md:222Constraint:
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.
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.
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.
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.
font-variant-numeric: tabular-nums lining-nums successfully on DFT-owned text like timestamps, tables, sparks, and tooltips.<!-- 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:
<!-- Reviewer comments, what was changed in response, and sign-off. -->