carterkit 0.4.0__tar.gz → 0.5.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {carterkit-0.4.0 → carterkit-0.5.0}/PKG-INFO +1 -1
- {carterkit-0.4.0 → carterkit-0.5.0}/carterkit/buffer.py +8 -2
- {carterkit-0.4.0 → carterkit-0.5.0}/carterkit/controldocs/control-def.md +5 -3
- {carterkit-0.4.0 → carterkit-0.5.0}/carterkit/controldocs/gauge.md +10 -3
- carterkit-0.5.0/carterkit/controldocs/grid-dimensions.md +93 -0
- {carterkit-0.4.0 → carterkit-0.5.0}/carterkit/controldocs/index.md +5 -0
- {carterkit-0.4.0 → carterkit-0.5.0}/carterkit/controldocs/map.md +1 -1
- {carterkit-0.4.0 → carterkit-0.5.0}/carterkit/controldocs/privacy.md +1 -1
- {carterkit-0.4.0 → carterkit-0.5.0}/carterkit/controldocs/progress-ring.md +9 -1
- {carterkit-0.4.0 → carterkit-0.5.0}/carterkit/controldocs/terms.md +1 -1
- {carterkit-0.4.0 → carterkit-0.5.0}/carterkit/layout.py +22 -8
- {carterkit-0.4.0 → carterkit-0.5.0}/carterkit.egg-info/PKG-INFO +1 -1
- {carterkit-0.4.0 → carterkit-0.5.0}/carterkit.egg-info/SOURCES.txt +1 -0
- {carterkit-0.4.0 → carterkit-0.5.0}/pyproject.toml +1 -1
- {carterkit-0.4.0 → carterkit-0.5.0}/LICENSE +0 -0
- {carterkit-0.4.0 → carterkit-0.5.0}/README.md +0 -0
- {carterkit-0.4.0 → carterkit-0.5.0}/carterkit/__init__.py +0 -0
- {carterkit-0.4.0 → carterkit-0.5.0}/carterkit/__main__.py +0 -0
- {carterkit-0.4.0 → carterkit-0.5.0}/carterkit/bind.py +0 -0
- {carterkit-0.4.0 → carterkit-0.5.0}/carterkit/catalog.py +0 -0
- {carterkit-0.4.0 → carterkit-0.5.0}/carterkit/cli.py +0 -0
- {carterkit-0.4.0 → carterkit-0.5.0}/carterkit/client.py +0 -0
- {carterkit-0.4.0 → carterkit-0.5.0}/carterkit/codegen.py +0 -0
- {carterkit-0.4.0 → carterkit-0.5.0}/carterkit/controldocs/accordion.md +0 -0
- {carterkit-0.4.0 → carterkit-0.5.0}/carterkit/controldocs/actions.md +0 -0
- {carterkit-0.4.0 → carterkit-0.5.0}/carterkit/controldocs/animations.md +0 -0
- {carterkit-0.4.0 → carterkit-0.5.0}/carterkit/controldocs/appearance.md +0 -0
- {carterkit-0.4.0 → carterkit-0.5.0}/carterkit/controldocs/button.md +0 -0
- {carterkit-0.4.0 → carterkit-0.5.0}/carterkit/controldocs/cardList.md +0 -0
- {carterkit-0.4.0 → carterkit-0.5.0}/carterkit/controldocs/carousel.md +0 -0
- {carterkit-0.4.0 → carterkit-0.5.0}/carterkit/controldocs/chat.md +0 -0
- {carterkit-0.4.0 → carterkit-0.5.0}/carterkit/controldocs/color-picker.md +0 -0
- {carterkit-0.4.0 → carterkit-0.5.0}/carterkit/controldocs/date-picker.md +0 -0
- {carterkit-0.4.0 → carterkit-0.5.0}/carterkit/controldocs/divider.md +0 -0
- {carterkit-0.4.0 → carterkit-0.5.0}/carterkit/controldocs/flip-card.md +0 -0
- {carterkit-0.4.0 → carterkit-0.5.0}/carterkit/controldocs/graph.md +0 -0
- {carterkit-0.4.0 → carterkit-0.5.0}/carterkit/controldocs/group-def.md +0 -0
- {carterkit-0.4.0 → carterkit-0.5.0}/carterkit/controldocs/haptics.md +0 -0
- {carterkit-0.4.0 → carterkit-0.5.0}/carterkit/controldocs/image.md +0 -0
- {carterkit-0.4.0 → carterkit-0.5.0}/carterkit/controldocs/joystick.md +0 -0
- {carterkit-0.4.0 → carterkit-0.5.0}/carterkit/controldocs/label.md +0 -0
- {carterkit-0.4.0 → carterkit-0.5.0}/carterkit/controldocs/layout-config.md +0 -0
- {carterkit-0.4.0 → carterkit-0.5.0}/carterkit/controldocs/list.md +0 -0
- {carterkit-0.4.0 → carterkit-0.5.0}/carterkit/controldocs/log-console.md +0 -0
- {carterkit-0.4.0 → carterkit-0.5.0}/carterkit/controldocs/long-press.md +0 -0
- {carterkit-0.4.0 → carterkit-0.5.0}/carterkit/controldocs/picker.md +0 -0
- {carterkit-0.4.0 → carterkit-0.5.0}/carterkit/controldocs/pulse.md +0 -0
- {carterkit-0.4.0 → carterkit-0.5.0}/carterkit/controldocs/qr-code.md +0 -0
- {carterkit-0.4.0 → carterkit-0.5.0}/carterkit/controldocs/segmented.md +0 -0
- {carterkit-0.4.0 → carterkit-0.5.0}/carterkit/controldocs/slider.md +0 -0
- {carterkit-0.4.0 → carterkit-0.5.0}/carterkit/controldocs/spacer.md +0 -0
- {carterkit-0.4.0 → carterkit-0.5.0}/carterkit/controldocs/sparkline.md +0 -0
- {carterkit-0.4.0 → carterkit-0.5.0}/carterkit/controldocs/status-light.md +0 -0
- {carterkit-0.4.0 → carterkit-0.5.0}/carterkit/controldocs/stepper.md +0 -0
- {carterkit-0.4.0 → carterkit-0.5.0}/carterkit/controldocs/sync.md +0 -0
- {carterkit-0.4.0 → carterkit-0.5.0}/carterkit/controldocs/text-input.md +0 -0
- {carterkit-0.4.0 → carterkit-0.5.0}/carterkit/controldocs/theming.md +0 -0
- {carterkit-0.4.0 → carterkit-0.5.0}/carterkit/controldocs/toggle.md +0 -0
- {carterkit-0.4.0 → carterkit-0.5.0}/carterkit/controldocs/visibility.md +0 -0
- {carterkit-0.4.0 → carterkit-0.5.0}/carterkit/controldocs/web-view.md +0 -0
- {carterkit-0.4.0 → carterkit-0.5.0}/carterkit/controls.py +0 -0
- {carterkit-0.4.0 → carterkit-0.5.0}/carterkit/declare.py +0 -0
- {carterkit-0.4.0 → carterkit-0.5.0}/carterkit/dynamic.py +0 -0
- {carterkit-0.4.0 → carterkit-0.5.0}/carterkit/e2ee.py +0 -0
- {carterkit-0.4.0 → carterkit-0.5.0}/carterkit/grid.py +0 -0
- {carterkit-0.4.0 → carterkit-0.5.0}/carterkit/infer.py +0 -0
- {carterkit-0.4.0 → carterkit-0.5.0}/carterkit/py.typed +0 -0
- {carterkit-0.4.0 → carterkit-0.5.0}/carterkit/theming.py +0 -0
- {carterkit-0.4.0 → carterkit-0.5.0}/carterkit/tune.py +0 -0
- {carterkit-0.4.0 → carterkit-0.5.0}/carterkit/validate.py +0 -0
- {carterkit-0.4.0 → carterkit-0.5.0}/carterkit.egg-info/dependency_links.txt +0 -0
- {carterkit-0.4.0 → carterkit-0.5.0}/carterkit.egg-info/entry_points.txt +0 -0
- {carterkit-0.4.0 → carterkit-0.5.0}/carterkit.egg-info/requires.txt +0 -0
- {carterkit-0.4.0 → carterkit-0.5.0}/carterkit.egg-info/top_level.txt +0 -0
- {carterkit-0.4.0 → carterkit-0.5.0}/setup.cfg +0 -0
- {carterkit-0.4.0 → carterkit-0.5.0}/tests/test_bind.py +0 -0
- {carterkit-0.4.0 → carterkit-0.5.0}/tests/test_buffer.py +0 -0
- {carterkit-0.4.0 → carterkit-0.5.0}/tests/test_catalog.py +0 -0
- {carterkit-0.4.0 → carterkit-0.5.0}/tests/test_cli.py +0 -0
- {carterkit-0.4.0 → carterkit-0.5.0}/tests/test_client.py +0 -0
- {carterkit-0.4.0 → carterkit-0.5.0}/tests/test_codegen.py +0 -0
- {carterkit-0.4.0 → carterkit-0.5.0}/tests/test_controls.py +0 -0
- {carterkit-0.4.0 → carterkit-0.5.0}/tests/test_declare.py +0 -0
- {carterkit-0.4.0 → carterkit-0.5.0}/tests/test_dynamic.py +0 -0
- {carterkit-0.4.0 → carterkit-0.5.0}/tests/test_e2ee.py +0 -0
- {carterkit-0.4.0 → carterkit-0.5.0}/tests/test_grid.py +0 -0
- {carterkit-0.4.0 → carterkit-0.5.0}/tests/test_infer.py +0 -0
- {carterkit-0.4.0 → carterkit-0.5.0}/tests/test_layout.py +0 -0
- {carterkit-0.4.0 → carterkit-0.5.0}/tests/test_theming.py +0 -0
- {carterkit-0.4.0 → carterkit-0.5.0}/tests/test_tune.py +0 -0
- {carterkit-0.4.0 → carterkit-0.5.0}/tests/test_ui.py +0 -0
- {carterkit-0.4.0 → carterkit-0.5.0}/tests/test_validate.py +0 -0
- {carterkit-0.4.0 → carterkit-0.5.0}/tests/test_validate_bindings.py +0 -0
|
@@ -168,10 +168,16 @@ class LayoutBuffer:
|
|
|
168
168
|
return ch
|
|
169
169
|
|
|
170
170
|
def add_tab(self, title: str, icon: str = "square.grid.2x2",
|
|
171
|
-
columns: int = DEFAULT_COLUMNS, rows: int = DEFAULT_ROWS
|
|
171
|
+
columns: int = DEFAULT_COLUMNS, rows: int = DEFAULT_ROWS,
|
|
172
|
+
mode: str = None, row_height: int = None) -> int:
|
|
173
|
+
grid = {"columns": columns, "rows": rows}
|
|
174
|
+
if mode is not None:
|
|
175
|
+
grid["mode"] = mode
|
|
176
|
+
if row_height is not None:
|
|
177
|
+
grid["rowHeight"] = row_height
|
|
172
178
|
self.tabs.append({
|
|
173
179
|
"title": title, "icon": icon,
|
|
174
|
-
"grid":
|
|
180
|
+
"grid": grid, "children": [],
|
|
175
181
|
})
|
|
176
182
|
return len(self.tabs) - 1
|
|
177
183
|
|
|
@@ -19,8 +19,8 @@ Every control — regardless of type — shares the same base fields. A control
|
|
|
19
19
|
|
|
20
20
|
| Field | Type | Default | Description |
|
|
21
21
|
|-------|------|---------|-------------|
|
|
22
|
-
| `span` | [
|
|
23
|
-
| `controlHeight` | number | — |
|
|
22
|
+
| `span` | [rowSpan, colSpan] | `[1, 1]` | Grid cells occupied. `colSpan` sets width; in a 2-D grid `rowSpan` sets height (`rowSpan × rowHeight`). Make a control bigger by spanning more cells. See [[grid-dimensions]]. |
|
|
23
|
+
| `controlHeight` | number | — | **Override** the grid-derived height with an exact point value. Rarely needed: in a 2-D grid the cell (`rowSpan × rowHeight`) is the height, and in a `flow` grid shaped controls auto-size to their aspect. Use it to pin a height the grid wouldn't otherwise give. See [[grid-dimensions]]. |
|
|
24
24
|
| `label` | string | — | Display label for the control |
|
|
25
25
|
| `defaultValue` | bool/number/string | — | Initial value before sync |
|
|
26
26
|
| `action` | [[actions\|ActionDefinition]] | — | Command fired on interaction |
|
|
@@ -40,7 +40,8 @@ Every control — regardless of type — shares the same base fields. A control
|
|
|
40
40
|
| `tint` | string | `"#667eea"` | Hex color for accents |
|
|
41
41
|
| `style` | string | varies | Style variant (per control type) |
|
|
42
42
|
| `hideLabel` | bool | `false` | Suppress the label |
|
|
43
|
-
| `
|
|
43
|
+
| `hideValue` | bool | `false` | Hide the numeric readout (e.g. a ring/gauge's center value) so the control becomes a pure compact visual that scales to fill its cell |
|
|
44
|
+
| `hideBackground` | bool | `false` | Remove the glass card behind the control — it floats on the page and fills its cell. Pairs with `hideValue` for a minimal glyph |
|
|
44
45
|
| `formatValue` | string | — | Number formatter for displayed values (see below) |
|
|
45
46
|
|
|
46
47
|
## Value Types
|
|
@@ -90,6 +91,7 @@ The `theme` object overrides theme values for a single control. It accepts the s
|
|
|
90
91
|
Common override keys: `accentColor`, `foregroundColor`, `secondaryColor`, `surfacePrimary`, `borderColor`, `borderWidth`, `cornerRadius`, `controlPadding`, `fontFamily`, `fontDesign`, `labelFontSize`, `valueFontSize`. Toggle/slider/progress controls also accept `trackColor`, `trackActiveColor`, `thumbColor`, `knobColor`, etc. See each control's **Theme Overrides** table for its specific keys, and [[theming]] for the full system.
|
|
91
92
|
|
|
92
93
|
## Related
|
|
94
|
+
- [[grid-dimensions]] — how `position` / `span` map to size; grid modes
|
|
93
95
|
- [[group-def]] — containers for controls
|
|
94
96
|
- [[layout-config]] — the top-level structure
|
|
95
97
|
- [[theming]] — Theme system & live theme builder
|
|
@@ -43,8 +43,12 @@ fields:
|
|
|
43
43
|
description: Rotates the arc start position in degrees
|
|
44
44
|
- name: arcThickness
|
|
45
45
|
type: number
|
|
46
|
-
default:
|
|
47
|
-
description: Arc stroke width in points
|
|
46
|
+
default: auto
|
|
47
|
+
description: Arc stroke width in points. Omit to auto-scale with the gauge's size.
|
|
48
|
+
- name: hideValue
|
|
49
|
+
type: bool
|
|
50
|
+
default: false
|
|
51
|
+
description: Show just the arc — hide the center value
|
|
48
52
|
themeFields:
|
|
49
53
|
- name: cornerRadius
|
|
50
54
|
type: number
|
|
@@ -106,10 +110,13 @@ Inherits all [[shared-properties]]. Key fields:
|
|
|
106
110
|
| `step` | number | `1` | Used to determine decimal formatting of center value |
|
|
107
111
|
| `arcAngle` | number | `180` | Arc sweep in degrees (1-360) |
|
|
108
112
|
| `arcRotation` | number | `0` | Rotates the arc start position in degrees |
|
|
109
|
-
| `arcThickness` | number |
|
|
113
|
+
| `arcThickness` | number | auto | Arc stroke width in points. Omit to auto-scale with the gauge's size; set for an absolute width |
|
|
114
|
+
| `hideValue` | bool | `false` | Show just the arc — hide the center value (pairs with `hideBackground` for a compact glyph) |
|
|
110
115
|
|
|
111
116
|
> **Note:** `gaugeStyle` is a shorthand alias. `"half"` sets `arcAngle: 180` and `"full"` sets `arcAngle: 360`. When `arcAngle` is set explicitly, it takes precedence over `gaugeStyle`.
|
|
112
117
|
|
|
118
|
+
> **Sizing:** the arc, stroke, and center value all scale to the gauge's size. A `half` gauge is wide (2:1); a `full` gauge is square (1:1) — give it ~3 `rowSpan` in a 2-D grid so it reads square. See [[grid-dimensions]].
|
|
119
|
+
|
|
113
120
|
## Gauge Segments
|
|
114
121
|
|
|
115
122
|
Color zones that change based on the current value:
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: grid-dimensions
|
|
3
|
+
label: Grid Dimensions
|
|
4
|
+
icon: square.grid.3x3
|
|
5
|
+
category: models
|
|
6
|
+
fields:
|
|
7
|
+
- name: columns
|
|
8
|
+
type: number
|
|
9
|
+
description: Number of columns the grid is divided into (required)
|
|
10
|
+
- name: rows
|
|
11
|
+
type: number
|
|
12
|
+
description: Number of rows the grid is divided into (required)
|
|
13
|
+
- name: mode
|
|
14
|
+
type: string
|
|
15
|
+
description: '"grid" (2-D, default) or "flow" (legacy row-banded)'
|
|
16
|
+
- name: rowHeight
|
|
17
|
+
type: number
|
|
18
|
+
description: Points per row-unit in 2-D mode (default 56)
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
Every tab and every [[group-def|group]] lays its children out on a **grid** of
|
|
22
|
+
`columns` × `rows`. A child declares where it sits with `position: [row, col]`
|
|
23
|
+
and how many cells it covers with `span: [rowSpan, colSpan]` (see [[control-def]]).
|
|
24
|
+
|
|
25
|
+
```json
|
|
26
|
+
"grid": { "columns": 4, "rows": 6 }
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Modes
|
|
30
|
+
|
|
31
|
+
| `mode` | Layout | Best for |
|
|
32
|
+
|--------|--------|----------|
|
|
33
|
+
| `"grid"` *(default)* | **True 2-D.** Each child occupies a real `row × col` rectangle. Columns divide the width evenly; rows are a fixed `rowHeight` unit. A child can span **both** axes, so a tall control can sit **beside** two stacked shorter ones (masonry / L-shapes). | Dashboards and mixed screens — gauges, rings, inputs, maps together. |
|
|
34
|
+
| `"flow"` | **Legacy row-banded.** Children are grouped by their row index into horizontal bands; `colSpan` sets proportional width but heights are natural (or `controlHeight`). `rowSpan` is ignored. | Full-page content (a single `map` / `chat` / `cardList` filling the tab) and pure forms where natural heights read best. |
|
|
35
|
+
|
|
36
|
+
`mode` is optional — omit it for the default 2-D grid. Set `"flow"` to opt a tab
|
|
37
|
+
or group out.
|
|
38
|
+
|
|
39
|
+
```json
|
|
40
|
+
"grid": { "columns": 4, "rows": 8, "mode": "flow" }
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## How spans map to size
|
|
44
|
+
|
|
45
|
+
| | 2-D (`"grid"`) | `"flow"` |
|
|
46
|
+
|--|----------------|----------|
|
|
47
|
+
| **`colSpan`** (width) | `colSpan / columns` of the row width | `colSpan / columns` of the row width |
|
|
48
|
+
| **`rowSpan`** (height) | `rowSpan × rowHeight` points | ignored — height is natural / `controlHeight` |
|
|
49
|
+
|
|
50
|
+
So in 2-D a 1×1 cell is genuinely small, and you make a control bigger by spanning
|
|
51
|
+
more cells. Visual controls scale all of their internals (stroke, glyph, font) to
|
|
52
|
+
the cell they're given — a small ring is tight and legible, a large ring is bold.
|
|
53
|
+
|
|
54
|
+
## `rowHeight`
|
|
55
|
+
|
|
56
|
+
The height of one row-unit, in points (2-D mode only; default **56**). One unit is
|
|
57
|
+
a comfortable input row, so:
|
|
58
|
+
|
|
59
|
+
- inputs (`slider`, `toggle`, `segmentedControl`, …) sit in **1 row**,
|
|
60
|
+
- a square control (`progressRing`, full `gauge`) wants **~3 rows** to read square,
|
|
61
|
+
- tall content (`map`, `list`, `graph`, `image`) spans **as many rows as you give it**.
|
|
62
|
+
|
|
63
|
+
```json
|
|
64
|
+
"grid": { "columns": 4, "rows": 10, "rowHeight": 64 }
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## Sizing a control
|
|
68
|
+
|
|
69
|
+
You usually don't set a height at all — in 2-D the cell (`rowSpan × rowHeight`)
|
|
70
|
+
*is* the height, and in flow shaped controls auto-size to their natural aspect.
|
|
71
|
+
`controlHeight` (see [[control-def]]) is an **override** for the rare case you want
|
|
72
|
+
an exact point height regardless of the grid.
|
|
73
|
+
|
|
74
|
+
## Example — a 2-D dashboard with an L-shape
|
|
75
|
+
|
|
76
|
+
```json
|
|
77
|
+
{
|
|
78
|
+
"grid": { "columns": 4, "rows": 5 },
|
|
79
|
+
"children": [
|
|
80
|
+
{ "type": "progressRing", "id": "cpu", "position": [0, 0], "span": [3, 2], "label": "CPU" },
|
|
81
|
+
{ "type": "gauge", "id": "mem", "position": [0, 2], "span": [2, 2], "label": "Memory" },
|
|
82
|
+
{ "type": "statusLight", "id": "net", "position": [2, 2], "span": [1, 2], "label": "Uplink" }
|
|
83
|
+
]
|
|
84
|
+
}
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
The CPU ring is a tall 2×2-plus block on the left; Memory and the Uplink light
|
|
88
|
+
stack to its right — placement that the flow renderer can't express.
|
|
89
|
+
|
|
90
|
+
## Related
|
|
91
|
+
- [[control-def]] — `position`, `span`, `controlHeight`, `hideValue`, `hideBackground`
|
|
92
|
+
- [[group-def]] — a group has its own grid (and its own `mode`)
|
|
93
|
+
- [[layout-config]] — the top-level structure
|
|
@@ -125,6 +125,11 @@ A layout JSON file has this shape:
|
|
|
125
125
|
}
|
|
126
126
|
```
|
|
127
127
|
|
|
128
|
+
Each tab lays its children out on a **2-D grid** — a control's `position` and `span`
|
|
129
|
+
place it in a `row × col` rectangle, so a tall control can sit beside two stacked
|
|
130
|
+
shorter ones. Set a grid's `mode` to `"flow"` for the simpler row-banded layout
|
|
131
|
+
(full-page content, plain forms). See [[grid-dimensions]].
|
|
132
|
+
|
|
128
133
|
Tap any node in the graph to explore the full documentation for each control type, system feature, and data model.
|
|
129
134
|
|
|
130
135
|
---
|
|
@@ -71,7 +71,7 @@ Inherits all [[shared-properties]]. Key fields:
|
|
|
71
71
|
| `mapStyle` | string | `"standard"` | `"standard"`, `"satellite"`, `"hybrid"` |
|
|
72
72
|
| `mapInteractive` | bool | `true` | Allow user pan/zoom |
|
|
73
73
|
| `mapZoom` | number | `0.01` | Default coordinate span in degrees |
|
|
74
|
-
| `controlHeight` | number | `120` (min) |
|
|
74
|
+
| `controlHeight` | number | `120` (min) | In a 2-D grid, give the map more `rowSpan` for a taller map (height = `rowSpan × rowHeight`). In a `flow` grid it is ~120pt by default — set this (e.g. `300`) for a full-screen-feel map. See [[grid-dimensions]]. |
|
|
75
75
|
| `label` | string | — | Header label above the map |
|
|
76
76
|
| `tint` | string | `"#667eea"` | Center point marker color |
|
|
77
77
|
|
|
@@ -28,6 +28,10 @@ fields:
|
|
|
28
28
|
- name: icon
|
|
29
29
|
type: string
|
|
30
30
|
description: SF Symbol in center (ring only)
|
|
31
|
+
- name: hideValue
|
|
32
|
+
type: bool
|
|
33
|
+
default: false
|
|
34
|
+
description: Show just the arc — hide the center value
|
|
31
35
|
themeFields:
|
|
32
36
|
- name: cornerRadius
|
|
33
37
|
type: number
|
|
@@ -85,11 +89,15 @@ Inherits all [[shared-properties]]. Key fields:
|
|
|
85
89
|
| `tint` | string | `"#667eea"` | Fill color |
|
|
86
90
|
| `label` | string | — | Center text (ring) or header text (bar) |
|
|
87
91
|
| `icon` | string | — | SF Symbol in center (ring only) |
|
|
92
|
+
| `hideValue` | bool | `false` | Show just the arc — hide the center value (pairs with `hideBackground` for a compact glyph) |
|
|
88
93
|
|
|
89
94
|
## Styles
|
|
90
95
|
|
|
91
96
|
### `"ring"` (default)
|
|
92
|
-
Circular progress ring with percentage and optional label/icon in the center.
|
|
97
|
+
Circular progress ring with percentage and optional label/icon in the center. The
|
|
98
|
+
stroke, number, icon, and label all scale to the ring's size, so a small cell stays
|
|
99
|
+
tight and a large one reads bold. Square aspect (1:1) — give it ~3 `rowSpan` in a
|
|
100
|
+
2-D grid. Set `hideValue` (and `hideBackground`) for a bare ring glyph. See [[grid-dimensions]].
|
|
93
101
|
|
|
94
102
|
### `"bar"`
|
|
95
103
|
Linear progress bar (thin horizontal bar). Header shows label and percentage.
|
|
@@ -37,4 +37,4 @@ Your use is also governed by our **Privacy Policy** at https://carterbeaudoin.ne
|
|
|
37
37
|
|
|
38
38
|
## 6. Changes and contact
|
|
39
39
|
|
|
40
|
-
We may update these Terms; the effective date reflects the latest version. Questions: support@carterbeaudoin.
|
|
40
|
+
We may update these Terms; the effective date reflects the latest version. Questions: support@carterbeaudoin.net
|
|
@@ -164,14 +164,20 @@ class _GridScope:
|
|
|
164
164
|
|
|
165
165
|
def group(self, label=None, *, id=None, span=None, position=None, cols: int = 4,
|
|
166
166
|
rows: int = 4, dynamic=None, visible=None, pulse=None,
|
|
167
|
-
hide_background=None) -> "GroupHandle":
|
|
167
|
+
hide_background=None, mode: str = None, row_height: int = None) -> "GroupHandle":
|
|
168
168
|
"""Add a group container and return a handle you can `with`-enter to fill.
|
|
169
169
|
|
|
170
170
|
`dynamic="event"` makes the group's children runtime-injectable (replaced by a
|
|
171
|
-
broadcast with matching `msg_type` — build that payload with :class:`Fragment`).
|
|
171
|
+
broadcast with matching `msg_type` — build that payload with :class:`Fragment`).
|
|
172
|
+
`mode="flow"` opts this group out of the default 2-D grid; `row_height` sets the
|
|
173
|
+
2-D row unit in points (default 56)."""
|
|
172
174
|
gid = self._owner._unique_id(id or "group")
|
|
173
|
-
|
|
174
|
-
|
|
175
|
+
grid: dict = {"columns": cols, "rows": rows}
|
|
176
|
+
if mode is not None:
|
|
177
|
+
grid["mode"] = mode
|
|
178
|
+
if row_height is not None:
|
|
179
|
+
grid["rowHeight"] = row_height
|
|
180
|
+
g: dict = {"type": "group", "id": gid, "grid": grid, "children": []}
|
|
175
181
|
if label is not None:
|
|
176
182
|
g["label"] = label
|
|
177
183
|
if dynamic is not None:
|
|
@@ -304,19 +310,27 @@ class Layout:
|
|
|
304
310
|
return self
|
|
305
311
|
|
|
306
312
|
def tab(self, title: str, *, icon: str = "square.grid.2x2",
|
|
307
|
-
cols: int = None, rows: int = 6, columns: int = None
|
|
313
|
+
cols: int = None, rows: int = 6, columns: int = None,
|
|
314
|
+
mode: str = None, row_height: int = None) -> TabHandle:
|
|
308
315
|
"""Start a tab and make it current. First call configures the default tab;
|
|
309
316
|
later calls append. `with ui.tab(...)` scopes controls to it; the flat form
|
|
310
|
-
``ui.tab("Main"); ui.gauge(...)`` works too.""
|
|
317
|
+
``ui.tab("Main"); ui.gauge(...)`` works too. `mode="flow"` opts the tab out of
|
|
318
|
+
the default 2-D grid; `row_height` sets the 2-D row unit (points, default 56)."""
|
|
311
319
|
cols = cols if cols is not None else (columns if columns is not None else 4)
|
|
320
|
+
grid = {"columns": cols, "rows": rows}
|
|
321
|
+
if mode is not None:
|
|
322
|
+
grid["mode"] = mode
|
|
323
|
+
if row_height is not None:
|
|
324
|
+
grid["rowHeight"] = row_height
|
|
312
325
|
if not self._first_tab_used:
|
|
313
326
|
t = self._buf.tabs[0]
|
|
314
327
|
t["title"], t["icon"] = title, icon
|
|
315
|
-
t["grid"] =
|
|
328
|
+
t["grid"] = grid
|
|
316
329
|
self._tab_index = 0
|
|
317
330
|
self._first_tab_used = True
|
|
318
331
|
else:
|
|
319
|
-
self._tab_index = self._buf.add_tab(title, icon=icon, columns=cols, rows=rows
|
|
332
|
+
self._tab_index = self._buf.add_tab(title, icon=icon, columns=cols, rows=rows,
|
|
333
|
+
mode=mode, row_height=row_height)
|
|
320
334
|
self._scope = self._scope_for_tab(self._tab_index)
|
|
321
335
|
return TabHandle(self, self._scope, self._tab_index)
|
|
322
336
|
|
|
@@ -41,6 +41,7 @@ carterkit/controldocs/divider.md
|
|
|
41
41
|
carterkit/controldocs/flip-card.md
|
|
42
42
|
carterkit/controldocs/gauge.md
|
|
43
43
|
carterkit/controldocs/graph.md
|
|
44
|
+
carterkit/controldocs/grid-dimensions.md
|
|
44
45
|
carterkit/controldocs/group-def.md
|
|
45
46
|
carterkit/controldocs/haptics.md
|
|
46
47
|
carterkit/controldocs/image.md
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|