Skip to contents

A table composed of cells arranged in rows and columns. Each cell contains a Text submobject. The table supports highlighting individual cells, rows, or columns with color, and individual cell animation.

Super classes

manimR::MObject -> manimR::VMobject -> Table

Public fields

data

Matrix or data.frame of table contents

col_names

Column header names

row_names

Row header names

n_rows

Number of data rows

n_cols

Number of columns

cell_width

Width of each cell in scene units

cell_height

Height of each cell

font_size

Font size for cell text

header_font_size

Font size for headers

line_color

Color of grid lines

header_color

Header text color

cell_entries

Matrix-like list of Text mobjects (row x col)

h_lines

VGroup of horizontal lines

v_lines

VGroup of vertical lines

header_entries

List of header Text mobjects

Methods

Inherited methods


Method new()

Create a Table

Usage

Table$new(
  data,
  col_names = NULL,
  row_names = NULL,
  cell_width = 1.5,
  cell_height = 0.6,
  font_size = 24,
  header_font_size = 28,
  line_color = WHITE,
  header_color = YELLOW,
  color = WHITE,
  include_outer_lines = TRUE,
  ...
)

Arguments

data

Matrix, data.frame, or list of row vectors

col_names

Character vector of column names (NULL = auto)

row_names

Character vector of row names (NULL = none)

cell_width

Cell width

cell_height

Cell height

font_size

Font size for cells

header_font_size

Font size for headers

line_color

Grid line color

header_color

Header text color

color

Default text color

include_outer_lines

Include border lines

...

Additional args


Method get_cell()

Get a cell entry (Text mobject) at row, col (1-indexed)

Usage

Table$get_cell(row, col)

Arguments

row

Row index

col

Column index


Method get_row()

Get an entire row of cell entries as a VGroup

Usage

Table$get_row(row)

Arguments

row

Row index (1-indexed)


Method get_column()

Get an entire column of cell entries as a VGroup

Usage

Table$get_column(col)

Arguments

col

Column index (1-indexed)


Method highlight_cell()

Highlight a specific cell

Usage

Table$highlight_cell(row, col, color = YELLOW)

Arguments

row

Row index

col

Column index

color

Highlight color


Method highlight_row()

Highlight an entire row

Usage

Table$highlight_row(row, color = YELLOW)

Arguments

row

Row index

color

Highlight color


Method highlight_column()

Highlight an entire column

Usage

Table$highlight_column(col, color = YELLOW)

Arguments

col

Column index

color

Highlight color


Method add_horizontal_line()

Add a horizontal line after a specific row

Usage

Table$add_horizontal_line(row, color = NULL, stroke_width = 2)

Arguments

row

Row index (line appears below this row)

color

Line color

stroke_width

Line width


Method clone()

The objects of this class are cloneable with this method.

Usage

Table$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.