Skip to content

feat(select): solo --select axis mode, multi-stat, and mixed#173

Merged
fahimfaisaal merged 32 commits into
mainfrom
feat/select-axis-mode
Jun 29, 2026
Merged

feat(select): solo --select axis mode, multi-stat, and mixed#173
fahimfaisaal merged 32 commits into
mainfrom
feat/select-axis-mode

Conversation

@fahimfaisaal

Copy link
Copy Markdown
Member

Summary

Adds repeatable solo --select axis mode for CSV/JSON: value axes, mixed axes, and multi-stat views in one dataset. Also enables bar/line (2D and 3D) rendering for mixed-axis data.

Highlights

  • Solo value axes: --select x,y[,z] without grouping
  • Solo mixed axes: categorical x + numeric y[,z] (bar/line/scatter)
  • Multi-stat mode: repeatable --select dim,metric flags merge into one dataset; chart tabs split by stat.type
  • Naming:
    • {} on dimension column → axes[].label
    • trailing (Title) → chart-tab / stat type name
    • default stat name: metric by dim (e.g. latency by region)
  • Data shape: when all flags share the same dimension column, stats for each row are merged into one DataPoint per xAxis

Example

vizb bar examples/csv/sales.csv \
  --select "region{Region},tax (Tax by Region)" \
  --select "region{Region},amount (Amount by Region)" \
  -o dual.json

Produces one point per row with multiple stats:

{
  "xAxis": "West",
  "stats": [
    { "type": "Tax by Region", "value": 1926.35 },
    { "type": "Amount by Region", "value": 17226.69 }
  ]
}

Test plan

  • go test ./...
  • ui vitest (399 tests)
  • pre-commit hooks (format, go-test, ui-gen-check)

Phase A of solo --select axis mode:
- Add KindStringArray; make --select repeatable via flagbag
- Add SelectViews config field and ParseSelectViewFlag (2-3 cols, x/y/z)
- Route grouped --select to cfg.Select (merge occurrences); solo to SelectViews
- Gate auto-group/auto-detect when HasSelect is set
- Add flagbag, select_view_spec, and NoExplicitGrouping tests
Port ResolveAxesTypes, IsMixedMode, MixedAxes and CSV/JSON mixed-mode
parsers from feat/mixed-axis-scatter. When IsSelectAxisMode, use
SelectViews[0] for axis placement; wire assembleDataset to emit mixed or
value axes and auto-enable 3D for numeric xyz.

Fix IsExplicitGrouping so empty GroupPattern does not block select axis mode.
Parse each solo --select view from a single csv/json read, assemble one
Dataset per view with auto-names and per-view 3D auto-enable, and embed
an array in HTML/JSON output when multiple views are present.
Wire __mixed_mode__ through the worker/pipeline for category X + value
Y/Z scatter datasets. Add buildMixedModeChart, 2D/3D scatter option
builders, settings field filtering, and regenerated embedded UI bundle.
Add design spec superseding mixed-axis --axes approach. Update bar, line,
and scatter chart docs with three-role --select structure. Extend grouping
guide with solo select axis mode and decision table. Add mode matrix to
root command reference. Include region-metrics.csv example for mixed scatter.
- Enable bar/line (2D and 3D) for solo mixed-axis --select views
- Add trailing (Title) syntax for multi-stat chart-tab names; keep {} for axis labels
- Default multi-stat stat names to metric by dim instead of dim & metric
- Merge stats per row when repeatable --select shares the same dimension column
- Propagate dimension {label} to axes[].label in multi-stat datasets
- Document updated --select semantics in root, grouping, and scatter guides
@codecov-commenter

codecov-commenter commented Jun 28, 2026

Copy link
Copy Markdown

…stats

Collapse duplicate tabular rows in Go via CollapseDataPointsByKey and set
preserveRows only for ungrouped csv/json so grouped bar charts keep one
series per x category. UI transform expands collapsed stats[] for overlay
scatter and wires stats panel columns through chartSeriesLabels.
Parallel act matrix jobs with --bind shared one data-input.txt and
corrupted curl JSON before --json-path could parse it.
… value boundary

DispatchSelectMode propagates AxisType to the parser's local cfg copy,
but ParseFunc passes Config by value so the mutation doesn't reach
prepareData/assembleDataset. DatasetAxesForSelectView now falls back to
inferring mixed-ness from DataPoint XAxis values when AxisType is empty,
restoring the pre-refactor behavior. Added end-to-end integration test
(ParseCSV → assembleDataset) as regression guard.
Drop accidentally committed .superpowers and docs/superpowers files
and extend .gitignore so they stay untracked.
@codecov-commenter

codecov-commenter commented Jun 29, 2026

Copy link
Copy Markdown

The existing superpowers pattern already ignores that folder anywhere
in the tree; only .superpowers needs an explicit rule.
@fahimfaisaal
fahimfaisaal marked this pull request as ready for review June 29, 2026 15:27
@fahimfaisaal fahimfaisaal changed the title feat(select): solo --select axis mode, multi-stat, and mixed bar/line feat(select): solo --select axis mode, multi-stat, and mixed Jun 29, 2026
Add targeted unit tests for axes inference fallback, tabular parsers,
select-view flag edge cases, and CLI pipeline/flagbag branches that
Codecov flagged as uncovered on PR #173.
Add follow-up tests for pipeline buildDataset branches, flagbag reset/seed,
tabular edge cases, and csv/json kindFn error paths to push patch coverage
above the Codecov threshold.
Cover repeatable --select ParseConfig branches, grouped duplicate detection,
symbol fatal validation, and group slice soft-rule handling.
@fahimfaisaal
fahimfaisaal merged commit cf15fc5 into main Jun 29, 2026
13 checks passed
@fahimfaisaal
fahimfaisaal deleted the feat/select-axis-mode branch June 29, 2026 15:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants