Customization¶
BenchBox visualization supports customization for themes, colors, and terminal display options.
Themes¶
BenchBox provides light and dark themes optimized for different contexts:
benchbox visualize results/*.json --theme light # Default, best for light terminals
benchbox visualize results/*.json --theme dark # Best for dark terminal backgrounds
Theme Differences:
Aspect |
Light Theme |
Dark Theme |
|---|---|---|
Background |
Terminal default |
Terminal default |
Text emphasis |
Dark gray tones |
Light gray tones |
Chart palette |
Same colorblind-safe colors |
Same colorblind-safe colors |
Color Palette¶
BenchBox uses a colorblind-safe categorical palette designed for data visualization:
Palette Colors:
Color |
Hex |
Usage |
|---|---|---|
Teal |
|
Primary series, best performer |
Orange |
|
Secondary series |
Purple |
|
Tertiary series |
Pink |
|
Fourth series |
Green |
|
Fifth series |
Yellow |
|
Sixth series |
Brown |
|
Seventh series |
Gray |
|
Eighth series |
Special Colors:
Purpose |
Color |
Hex |
|---|---|---|
Best performer |
Green |
|
Worst performer |
Red |
|
Improvement (%) |
Green |
|
Regression (%) |
Orange |
|
Terminal Display Options¶
Color Control¶
# Full ANSI color output (default)
benchbox visualize results/*.json
# Disable colors (for piping to files or plain terminals)
benchbox visualize results/*.json --no-color
Character Set¶
# Unicode block characters (default): ▏▎▍▌▋▊▉█
benchbox visualize results/*.json
# ASCII-only characters for basic terminals: .-=+#@
benchbox visualize results/*.json --no-unicode
Terminal Width¶
Charts automatically detect terminal width and constrain output to 40-120 characters. The chart rendering adapts:
Labels are truncated to fit available space
Bar widths scale proportionally
Legends wrap as needed
Accessibility¶
BenchBox visualizations are designed for accessibility:
Color Accessibility:
Palette passes WCAG AA contrast requirements
Colorblind-safe: distinguishable for deuteranopia, protanopia, tritanopia
--no-colorflag for screen readers and plain text processing
Screen Reader Support:
Text-based output is inherently screen reader compatible
Use
--no-colorto strip ANSI codes for cleanest plain textConsistent labeling with values, legends, and scale notes
Contrast Ratios:
Text on background: minimum 4.5:1 (WCAG AA)
Chart elements: minimum 3:1
Advanced: Python API Customization¶
For fine-grained control, use the Python API directly:
from benchbox.core.visualization.ascii.base import ASCIIChartOptions
from benchbox.core.visualization.ascii.bar_chart import ASCIIBarChart, BarData
# Custom chart options
opts = ASCIIChartOptions(
use_color=True,
use_unicode=True,
theme="dark",
width=100, # Override terminal width detection
)
# Create chart with custom settings
data = [
BarData(label="Platform A", value=100.5, is_best=True),
BarData(label="Platform B", value=150.2),
BarData(label="Platform C", value=200.1, is_worst=True),
]
chart = ASCIIBarChart(
data=data,
title="Custom Chart Title",
metric_label="Execution Time (ms)",
options=opts,
)
print(chart.render())
Using the Generic Factory¶
from benchbox.core.visualization.exporters import render_ascii_chart
# Render any chart type via the generic factory
output = render_ascii_chart(
chart_type="performance_bar",
data=data,
title="My Chart",
)
print(output)
Exporting to File¶
from benchbox.core.visualization.exporters import export_ascii
export_ascii(
ascii_content=chart.render(),
output_dir="./charts",
base_name="performance_comparison",
format="txt",
)
Configuration Summary¶
Option |
CLI Flag |
Default |
Values |
|---|---|---|---|
Theme |
|
|
|
Colors |
|
enabled |
flag to disable |
Unicode |
|
enabled |
flag to disable |
Template |
|
none |
|
Chart type |
|
|
|