Skip to content

Customization

BenchBox visualization supports customization for themes, colors, and terminal display options.

Themes

BenchBox provides light and dark themes optimized for different contexts:

Terminal window
benchbox visualize results/*.json --theme light
benchbox visualize results/*.json --theme dark

The light theme is the default and suits light terminals. The dark theme suits dark terminal backgrounds.

Theme Differences:

AspectLight ThemeDark Theme
BackgroundTerminal defaultTerminal default
Text emphasisDark gray tonesLight gray tones
Chart paletteSame colorblind-safe colorsSame colorblind-safe colors

Color Palette

BenchBox uses a colorblind-safe categorical palette designed for data visualization:

Palette Colors:

ColorHexUsage
Teal#1b9e77Primary series, best performer
Orange#d95f02Secondary series
Purple#7570b3Tertiary series
Pink#e7298aFourth series
Green#66a61eFifth series
Yellow#e6ab02Sixth series
Brown#a6761dSeventh series
Gray#666666Eighth series

Special Colors:

PurposeColorHex
Best performerGreen#28a745
Worst performerRed#dc3545
Improvement (%)Green#66a61e
Regression (%)Orange#d95f02

Terminal Display Options

Color Control

Terminal window
benchbox visualize results/*.json
benchbox visualize results/*.json --no-color

The first command uses full ANSI color output (the default). --no-color disables colors, which suits piping to files or plain terminals.

Character Set

Terminal window
benchbox visualize results/*.json
benchbox visualize results/*.json --no-unicode

The first command uses Unicode block characters (the default): ▏▎▍▌▋▊▉█. --no-unicode uses ASCII-only characters for basic terminals: .-=+#@.

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-color flag for screen readers and plain text processing

Screen Reader Support:

  • Text-based output is inherently screen reader compatible
  • Use --no-color to strip ANSI codes for cleanest plain text
  • Consistent 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 ChartOptions
from benchbox.core.visualization.ascii.bar_chart import BarChart, BarData
opts = ChartOptions(
use_color=True,
use_unicode=True,
theme="dark",
width=100,
)
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 = BarChart(
data=data,
title="Custom Chart Title",
metric_label="Execution Time (ms)",
options=opts,
)
print(chart.render())

width=100 overrides terminal width detection.

Using the Generic Factory

render_ascii_chart renders any chart type through the generic factory.

from benchbox.core.visualization.exporters import render_ascii_chart
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

OptionCLI FlagDefaultValues
Theme--themelightlight, dark
Colors--no-colorenabledflag to disable
Unicode--no-unicodeenabledflag to disable
Template--templatenonedefault, flagship, head_to_head, trends, cost_optimization, comparison
Chart type--chart-typeautoauto, all, performance_bar, distribution_box, query_heatmap, query_histogram, cost_scatter, time_series