Matrix_charts renders line, scatter, bar, heatmap, candlestick, and other chart types into a terminal grid. Charts are immutable specifications built from composable Mark.t values, then compiled into a Layout.t for drawing and interaction.
The typical workflow is:
Build an immutable t by layering marks (lines, bars, scatter, etc.).
Keep viewport state in a separate View.t (zoom and pan belong in your model, not the chart).
Use Layout + Hit + Overlay for hover tooltips, crosshairs, snapping, and zoom-to-cursor.
Coordinate systems
Cell coordinates (px, py) are integer terminal-cell positions. (0, 0) is the top-left corner of the grid.
Data coordinates (x, y) are floating-point values in the data domain. Convert between systems with Layout.data_of_px and Layout.px_of_data.
Some marks support sub-cell resolution (e.g. `Braille2x4 renders 2×4 dots per cell). Sub-cell rendering is purely visual; all coordinates in the API remain in cell units.
layout t ~width ~height compiles t into a Layout.t without rendering. Use this when you need layout information (coordinate mapping, hit-testing) without drawing.
draw t grid ~width ~height renders t to grid and returns the compiled layout.
Fills the chart region with the theme background, then draws gridlines, marks (in add order), axes, and title. The returned Layout.t can be used for hit-testing and overlay drawing.