columns
columns
#
Chart columns: one value per point, named, and shipped to the page by kind.
- Name.
named_columnsturns arrays of records into named columns, one per field the record type marks with acg.Quantity, labelled from it ("Temperature (°C)"). - Encode.
encodeships a column by the kind of its values: numbers as numbers, instants as epoch milliseconds; anything unrecorded isNone.
Kind = Literal['number', 'instant']
#
How a column's values read: plain numbers, or instants in time.
Source = cg.Array | Mapping[str, cg.Array]
#
An array of records, or columns already named.
Encoded
dataclass
#
encode(column)
#
column shipped by kind: an instants column when every recorded value is a time.
Source code in capturegraph-ui/capturegraph_ui/charts/columns.py
named_columns(*sources)
#
Every source's columns by label, and the fixed span of each that declares one.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
*sources
|
Source
|
Arrays of records — each field marked with a |
()
|
Returns:
| Type | Description |
|---|---|
tuple[dict[str, Array], dict[str, tuple[float, float]]]
|
The columns in source order, and the spans their quantities fix. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If two columns share a label. |