.md →
Matrix API#
Bases: AnyWidget
Spreadsheet-like numeric editor with bounds, naming, and symmetry helpers.
Note
This widget has graduated to marimo core. If you are using marimo,
prefer marimo.ui.matrix.
Matrix will continue to work in plain Jupyter and other anywidget
hosts.
Examples:
Create a Matrix editor.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
matrix
|
Optional[List[List[float]]]
|
Optional 2D list of initial values. |
None
|
rows
|
int
|
Number of rows when |
3
|
cols
|
int
|
Number of columns when |
3
|
min_value
|
float
|
Lower bound for cell values. |
-100
|
max_value
|
float
|
Upper bound for cell values. |
100
|
triangular
|
bool
|
If |
False
|
row_names
|
Optional[List[str]]
|
Custom labels for rows. |
None
|
col_names
|
Optional[List[str]]
|
Custom labels for columns. |
None
|
static
|
bool
|
Disable editing when |
False
|
flexible_cols
|
bool
|
Allow column count changes interactively. |
False
|
step
|
float
|
Increment step size for cell value adjustments. |
1.0
|
digits
|
int
|
Number of decimal digits to display. |
1
|
mirror
|
bool
|
If |
False
|
**kwargs
|
Any
|
Forwarded to |
{}
|
Source code in wigglystuff/matrix.py
Synced traitlets#
| Traitlet | Type | Notes |
|---|---|---|
matrix |
list[list[float]] |
Cell values. |
rows |
int |
Row count. |
cols |
int |
Column count. |
min_value |
float |
Minimum allowed value. |
max_value |
float |
Maximum allowed value. |
mirror |
bool |
Mirror edits across the diagonal when enabled. |
step |
float |
Step size for edits. |
digits |
int |
Decimal precision for display. |
row_names |
list[str] |
Optional row labels. |
col_names |
list[str] |
Optional column labels. |
static |
bool |
Disable editing when true. |
flexible_cols |
bool |
Allow column count changes interactively. |