Binary Packing
deckgl_marimo.pack_binary
Pack layer data into an aligned binary buffer for deck.gl.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
n
|
int
|
Number of data items (rows/features). |
required |
attributes
|
dict[str, tuple[Any, str, int]]
|
Mapping of attribute name to |
required |
start_indices
|
Any | None
|
Optional uint32 array for variable-length data (polygons, paths). |
None
|
Returns:
| Type | Description |
|---|---|
tuple[dict, bytes]
|
|
deckgl_marimo.pack_polygon_binary
Pack polygon data into a binary buffer for deck.gl.
Convenience wrapper around :func:pack_binary for polygon data.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
list[dict] | Any
|
List of dicts, or a dict with pre-built numpy arrays:: |
required |
get_polygon
|
str
|
Key in each dict for the polygon coordinates. |
'polygon'
|
get_fill_color
|
Any
|
If a string, key for per-polygon [r, g, b, a] color. |
None
|
per_polygon_colors
|
Any | None
|
Pre-resolved per-polygon RGBA colors as a (n_polygons, 4) uint8
array (e.g. from a ColorScale or callable accessor). Expanded to
per-vertex colors here. Ignored on the pre-built-arrays fast path
and when |
None
|
Returns:
| Type | Description |
|---|---|
tuple[dict, bytes]
|
|