Matrix API#
Bases: AnyWidget
Spreadsheet-like numeric editor with bounds, naming, and symmetry helpers.
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
|
Increment step size for cell value adjustments (via |
required | |
digits
|
Number of decimal digits to display (via |
required | |
mirror
|
If |
required | |
**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. |