Skip to content

feat: support generic CSV/JSON tabular data with auto-detection#123

Merged
fahimfaisaal merged 4 commits into
mainfrom
feat/tabular-data-support
Jun 6, 2026
Merged

feat: support generic CSV/JSON tabular data with auto-detection#123
fahimfaisaal merged 4 commits into
mainfrom
feat/tabular-data-support

Conversation

@fahimfaisaal

@fahimfaisaal fahimfaisaal commented Jun 6, 2026

Copy link
Copy Markdown
Member

Summary

Repositions vizb from a benchmark-only tool to a benchmark + tabular-data visualizer. It now charts any tabular CSV/JSON table in addition to Go/Rust/JS benchmark output.

What changed

  • Parsers — new generic CSV and JSON parsers + content-based auto-detection (pkg/parser/detect.go). Numeric columns become series; the new -g/--group flag merges non-numeric columns into the group name (parsed by -p/-r).
  • Type renameBenchmark → Dataset, BenchmarkData → DataPoint and their data-carrying helpers, to match the now-generic role. JSON wire format is unchanged (struct tags kept) — existing vizb JSON files and the UI keep working.
  • GitHub Action — new generic cmd / file / group inputs; bench-cmd / bench-file kept as deprecated aliases (used only when the new inputs are empty). Non-breaking.
  • Docs — README, docs pages, and CLI help reframed as dual benchmark/tabular framing; new Tabular Data and Auto-Detection guides.
  • Examples/CIexamples/csv/sales.csv, examples/json/sales.json, and deploy workflows for both.

Verification

  • go build ./..., go vet ./..., gofmt clean; go test -count=1 ./... green.
  • Existing vizb JSON still renders (wire format intact).
  • vizb examples/json/sales.json auto-detects the json parser and produces a chart.

Add generic CSV and JSON parsers plus content-based parser
auto-detection (pkg/parser/detect.go), so vizb charts any tabular
data, not just benchmark output. CSV/JSON parsers pick numeric
columns as series; the new -g/--group flag merges non-numeric
columns into the group name (parsed by -p/-r).

Rename the core data types to match their now-generic role:
Benchmark -> Dataset, BenchmarkData -> DataPoint, and the
data-carrying helpers (convertToDataset, prepareData,
prepareDatasetFromResults, MergeDatasets, deepCloneDataset).
JSON wire format is unchanged (struct tags kept), so existing
vizb JSON files and the UI keep working.
Add generic cmd, file, and group inputs to the composite action so it
visualizes any command output or input file, not just benchmarks.
Keep bench-cmd/bench-file as deprecated aliases (used only when the new
inputs are empty), so the change is non-breaking.
Reframe README, docs, and CLI help so vizb reads as a visualizer for
benchmark output or any tabular CSV/JSON data. Soften benchmark-only
vocabulary on shared surfaces (data/series/labels/rows) while keeping
benchmark wording where it is genuinely benchmark-specific. Add new
Tabular Data and Auto-Detection guide pages and register them in the
Starlight sidebar.
Add example sales.csv and sales.json fixtures plus CI workflows that
build and publish their visualizations.
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 87.55102% with 61 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
pkg/parser/json/json.go 80.39% 29 Missing and 11 partials ⚠️
pkg/parser/detect.go 87.77% 7 Missing and 4 partials ⚠️
pkg/parser/csv/csv.go 93.38% 6 Missing and 3 partials ⚠️
cmd/flag_validation_rules.go 75.00% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@fahimfaisaal
fahimfaisaal merged commit 85277ab into main Jun 6, 2026
1 check passed
@fahimfaisaal
fahimfaisaal deleted the feat/tabular-data-support branch June 6, 2026 13:42
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