Charts API¶
dapple.charts provides character-dimension wrappers around vizlib's chart primitives. Specify width and height in terminal characters instead of pixels.
Functions¶
from dapple.charts import sparkline, line_plot, bar_chart, histogram, heatmap
from dapple import braille
sparkline¶
line_plot¶
bar_chart¶
histogram¶
import numpy as np
chart = histogram(np.random.randn(1000), width=60, height=20, bins=30)
chart.out(braille)
heatmap¶
import numpy as np
data = np.random.rand(10, 10)
chart = heatmap(data, width=40, height=20)
chart.out(braille)
All functions default to terminal width when width is omitted. Charts are sized for braille rendering (2x4 cell dimensions) but work with any renderer.