Data Visualization
Turn the user's tabular data into interactive HTML charts they can open in a browser.
End-user analysis and reporting skill — not LibrAgent internal analytics.
Not This Skill
| Skill | Use for |
|---|---|
| to-md | Extract text from PDF/XLSX without charting |
| docx / pptx | Author formatted documents |
| deep-research | Narrative research reports |
| workspace-indexer | Batch markdown index for a repo |
Path conventions
Replace <skill-base-dir> with this skill's absolute Base Directory.
Prerequisites
CSV and JSON work with the Python standard library.
For Excel (.xlsx):
pip install pandas openpyxl
Charts use Chart.js loaded from CDN in generated HTML (network needed when opening the file in a browser).
Workflow
1. Locate data
Use a workspace path the user provides or attachments they uploaded.
Supported inputs: .csv, .json (array of objects), .xlsx / .xls (with pandas).
2. Inspect columns
python "<skill-base-dir>/scripts/visualize.py" --action inspect --input path/to/data.csv
Review numeric_columns vs categorical_columns before charting.
3. Choose rendering mode
| Mode | When | Command |
|---|---|---|
auto_chart |
User did not specify chart type | --action auto_chart --input ... --output report.html |
chart |
Explicit axes and type | --action chart --chart-type line --x month --y revenue --input ... |
dashboard |
Multiple metrics | --action dashboard --input ... --spec dashboard.json --output dashboard.html |
Chart types: bar, line, pie, scatter.
Examples: request-patterns.md. Dashboard spec: dashboard-spec.md.
4. Present results
Tell the user:
- output HTML absolute path
- chart type and columns used
- how to open (browser, or
browserbuiltinnavigateToUrlwithfile://when allowed)
Format tips: output-format.md.
Guidelines
- Inspect first on unknown files — avoid wrong axis guesses
- auto_chart is a default, not magic — override with explicit
chartwhen the user names columns - Keep data local — do not upload user data to external chart services
- Large files — sample or aggregate in workspace before charting (>10k rows)
- Locale — titles/labels may match user language; column names stay as in the file
Script actions
| Action | Purpose |
|---|---|
inspect |
Schema summary |
auto_chart |
Infer bar/line/pie/scatter |
chart |
Explicit chart |
dashboard |
Multi-chart HTML |
References
- request-patterns.md
- dashboard-spec.md
- output-format.md
- error-handling.md