Problem / use case
With group + --col-axis (-A), numeric columns expand onto an axis and each expanded stat gets an empty type (so they stay one chart instead of one chart per column).
The UI then falls back:
chart title = stats[].type || dataset.name (-n) || ""
So by default the page/dataset name and the chart title (series name, save-as-image label, card title) are the same string — usually -n / "Comparisons".
Today the only way to change the chart title is to change -n, which also changes the dataset header / dataset identity.
Concrete workflow
# Want: page name "Q1 release", chart title "Framework throughput"
# Today: -n sets both; no way to split them
vizb bar examples/csv/concurrency.csv -g load -p y -A x \
-n 'Q1 release' \
-o out.html
Relevant code:
shared/expand.go — clears Stat.Type on expand; documents UI name fallback
ui/src/composables/useChartPipeline.ts — chartTitle(type) => type || datasetName || ''
cmd/cli/dataflags.go — -n is dataset name only; no chart-title flag
- Precedent: multi-stat
--select … (Title) already sets stat.type via TypeLabel
Proposed solution
Add a --title flag that overrides the chart title only when group + --col-axis produces exactly one chart. Independent of -n.
Flag contract
--title string
Override the chart title when group + --col-axis produces exactly one chart.
Independent of -n (dataset name).
Ignored with a warning otherwise (including multi-stat; use --select … (Title) there).
No shorthand (-T is already time-unit).
Desired usage
vizb bar data.csv -g load -p y --col-axis x \
-n 'Q1 release' \
--title 'Framework throughput' \
-o out.html
How it should work
- Add
title to DataFlags (no shorthand).
- Plumb into the pipeline (
RunMeta / local arg preferred; parsers do not need it).
- After
ExpandStatsOntoAxis succeeds in applyColAxis, if --title is non-empty, set every expanded stat’s Type to that string.
- All points share one type → still one signature / one chart.
- UI already shows
type as title → no Dataset schema or UI change required.
- If
--title is omitted → keep empty type → fall back to -n (current behavior).
- If
--title is set but col-axis did not apply → warn once and ignore.
Single-chart gate
| Situation |
Chart count |
--title |
Group + --col-axis succeeds |
1 |
Applied → stat.type = title |
Multi-column group without -A |
N (one per column) |
Ignored + warning |
Multi-stat repeatable --select |
N |
Ignored + warning (use (Title) per flag) |
Solo value/mixed --select |
1 |
Ignored for v1 (title already from axis labels / "x vs y") |
| Col-axis skipped |
unchanged |
Ignored + warning |
Implementation notes
Files (expected):
cmd/cli/dataflags.go — flag definition
cmd/cli/flagbag.go — Meta() / plumbing
cmd/cli/pipeline.go — applyColAxis apply + warn paths
cmd/cli/pipeline_test.go — suite tests
examples/csv/README.md — concurrency section
- Optional: CHANGELOG, comparisons skill example
Do not:
- Add a
Dataset.chartTitle schema field (reuse stat.type)
- Remove or repurpose
--select {label} (axis/column labels) or (Title) (multi-stat tab names)
- Apply
--title to multi-chart datasets
- Use
-d description as chart title
Acceptance criteria
Test paths
- Happy: group +
-A + --title → one chart, name and title differ
- Default: group +
-A, no title → empty type
- Multi-chart reject:
--title without -A on multi-column data → warn
- Multi-stat:
--title ignored; (Title) still works
- Col-axis skip + title → warn
- Existing col-axis fatals unchanged
Alternatives considered
-
Only use -n — works for a “nice” chart title but forces page header == chart title. Rejected.
-
New Dataset.chartTitle field + UI fallback (title || type || name) — cleaner long-term if we need display title independent of stat.type everywhere; more cost (Go struct, migrate, TS types, merge policy). Overkill for this gap; skip until needed.
-
Remove --select title-ish syntax and fold into global --title — investigated and rejected:
col{label} is axis/column labels (group-pattern, value-mode "x vs y", dataset auto-names) — not the same as chart title.
- Trailing
(Title) is per multi-stat tab name; multi-chart needs per-view names, which a single global --title cannot replace.
- Keep both; add
--title only for the col-axis single-chart hole.
-
Use -d description — wrong UI slot (subtitle under header, not series/chart title). Rejected.
-
Broader --title for any single chart (including solo value mode) — out of scope for v1; value-mode already titles from axis labels.
Problem / use case
With group +
--col-axis(-A), numeric columns expand onto an axis and each expanded stat gets an emptytype(so they stay one chart instead of one chart per column).The UI then falls back:
So by default the page/dataset name and the chart title (series name, save-as-image label, card title) are the same string — usually
-n/"Comparisons".Today the only way to change the chart title is to change
-n, which also changes the dataset header / dataset identity.Concrete workflow
Relevant code:
shared/expand.go— clearsStat.Typeon expand; documents UI name fallbackui/src/composables/useChartPipeline.ts—chartTitle(type) => type || datasetName || ''cmd/cli/dataflags.go—-nis dataset name only; no chart-title flag--select … (Title)already setsstat.typeviaTypeLabelProposed solution
Add a
--titleflag that overrides the chart title only when group +--col-axisproduces exactly one chart. Independent of-n.Flag contract
No shorthand (
-Tis already time-unit).Desired usage
How it should work
titletoDataFlags(no shorthand).RunMeta/ local arg preferred; parsers do not need it).ExpandStatsOntoAxissucceeds inapplyColAxis, if--titleis non-empty, set every expanded stat’sTypeto that string.typeas title → no Dataset schema or UI change required.--titleis omitted → keep empty type → fall back to-n(current behavior).--titleis set but col-axis did not apply → warn once and ignore.Single-chart gate
--title--col-axissucceedsstat.type = title-A--select(Title)per flag)--select"x vs y")Implementation notes
Files (expected):
cmd/cli/dataflags.go— flag definitioncmd/cli/flagbag.go—Meta()/ plumbingcmd/cli/pipeline.go—applyColAxisapply + warn pathscmd/cli/pipeline_test.go— suite testsexamples/csv/README.md— concurrency sectionDo not:
Dataset.chartTitleschema field (reusestat.type)--select{label}(axis/column labels) or(Title)(multi-stat tab names)--titleto multi-chart datasets-ddescription as chart titleAcceptance criteria
--title+ successful group +--col-axis→ one chart,stats[].type == title,dataset.name == -n--col-axiswithout--title→ empty type, UI falls back to-n(unchanged)--titlewithout col-axis / multi-column multi-chart → warning, types unchanged--titleignored;--select … (Title)still works--title→ warningzwithoutx+y) unchangedstats[].typeequals title when appliedTest paths
-A+--title→ one chart, name and title differ-A, no title → empty type--titlewithout-Aon multi-column data → warn--titleignored;(Title)still worksAlternatives considered
Only use
-n— works for a “nice” chart title but forces page header == chart title. Rejected.New
Dataset.chartTitlefield + UI fallback (title || type || name) — cleaner long-term if we need display title independent ofstat.typeeverywhere; more cost (Go struct, migrate, TS types, merge policy). Overkill for this gap; skip until needed.Remove
--selecttitle-ish syntax and fold into global--title— investigated and rejected:col{label}is axis/column labels (group-pattern, value-mode"x vs y", dataset auto-names) — not the same as chart title.(Title)is per multi-stat tab name; multi-chart needs per-view names, which a single global--titlecannot replace.--titleonly for the col-axis single-chart hole.Use
-ddescription — wrong UI slot (subtitle under header, not series/chart title). Rejected.Broader
--titlefor any single chart (including solo value mode) — out of scope for v1; value-mode already titles from axis labels.