Raxol.UI.Charts.ViewBridge (Raxol v2.6.0)

View Source

Converts chart cell tuples to View DSL elements for use in TEA view/1.

Groups consecutive same-color cells on the same row into text runs, then wraps them as Raxol.View.Components elements.

Summary

Functions

Converts a list of cell tuples to a View DSL box element.

Convenience wrapper: calls a chart function with args, then converts the resulting cells to a View DSL element.

Types

cell()

Functions

cells_to_view(cells, opts \\ [])

@spec cells_to_view(
  [cell()],
  keyword()
) :: map()

Converts a list of cell tuples to a View DSL box element.

Groups cells by row and color into text components, wrapped in a box.

chart_box(chart_fn, chart_args, box_opts \\ [])

@spec chart_box(function(), [term()], keyword()) :: map()

Convenience wrapper: calls a chart function with args, then converts the resulting cells to a View DSL element.

Example

ViewBridge.chart_box(&LineChart.render/3, [{0, 0, 40, 10}, series, []], style: %{})