@ai-gui/plugin-bigscreen 0.34.0
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.
- package/CHANGELOG.md +11 -0
- package/LICENSE +21 -0
- package/README.md +96 -0
- package/dist/index.cjs +588 -0
- package/dist/index.d.cts +205 -0
- package/dist/index.d.ts +205 -0
- package/dist/index.js +574 -0
- package/dist/mount-BPBXhD2D.cjs +298 -0
- package/dist/mount-DVHPS1xP.js +297 -0
- package/dist/options-BpHnWRpI.cjs +499 -0
- package/dist/options-C087Peeh.js +415 -0
- package/package.json +76 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# @ai-gui/plugin-bigscreen
|
|
2
|
+
|
|
3
|
+
## 0.34.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 63c320f: New package: `@ai-gui/plugin-bigscreen` renders ` ```bigscreen ` blocks as animated data walls — KPIs that count up with deltas and sparklines, dial and ring gauges that sweep, rank bars that grow, ECharts charts drawn in the wall's palette, and, with the optional `echarts-gl` peer, 3D bars, scatter, surfaces and lines that turn, plus a globe with arcing routes over a texture painted in-page rather than fetched. Dark and light themes, an accent colour, and a 12-column grid the model lays out.
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- @ai-gui/core@0.34.0
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Liang Li
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
# @ai-gui/plugin-bigscreen
|
|
2
|
+
|
|
3
|
+
Animated data walls for [AIGUI](../../README.md): KPIs that count up, gauges that sweep, rank
|
|
4
|
+
bars that grow, charts that draw themselves, and 3D bars and globes that turn — on a grid the
|
|
5
|
+
model lays out.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
pnpm add @ai-gui/plugin-bigscreen echarts
|
|
11
|
+
# for the chart3d and globe panels
|
|
12
|
+
pnpm add echarts-gl
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
`echarts-gl` is an optional peer: without it the 3D and globe panels show a one-line note and the
|
|
16
|
+
rest of the wall is unaffected. It is imported lazily, once, the first time such a panel mounts.
|
|
17
|
+
|
|
18
|
+
## Usage
|
|
19
|
+
|
|
20
|
+
```tsx
|
|
21
|
+
import { bigscreen } from "@ai-gui/plugin-bigscreen"
|
|
22
|
+
import { buildSystemPrompt } from "@ai-gui/core"
|
|
23
|
+
|
|
24
|
+
<AIRenderer plugins={[bigscreen()]} />
|
|
25
|
+
|
|
26
|
+
const system = buildSystemPrompt({ registry, plugins: [bigscreen()], locale: "zh-CN" })
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
The model then emits:
|
|
30
|
+
|
|
31
|
+
````markdown
|
|
32
|
+
```bigscreen
|
|
33
|
+
{
|
|
34
|
+
"title": "华东区销售大屏",
|
|
35
|
+
"subtitle": "2026 年 8 月",
|
|
36
|
+
"panels": [
|
|
37
|
+
{ "kind": "kpi", "title": "本月营收", "value": 12843000, "prefix": "¥", "delta": 0.124, "trend": [8.1, 8.6, 9.2, 9.0, 10.4, 11.9, 12.8], "span": 3 },
|
|
38
|
+
{ "kind": "gauge", "title": "目标完成率", "value": 82, "unit": "%", "span": 3 },
|
|
39
|
+
{ "kind": "rank", "title": "门店排行", "span": 6, "unit": "万", "items": [{ "name": "上海", "value": 320 }, { "name": "杭州", "value": 245 }] },
|
|
40
|
+
{ "kind": "chart3d", "title": "品类 × 月份", "span": 6, "type": "bar3D", "xAxis": ["6月", "7月", "8月"], "yAxis": ["家电", "服饰"], "data": [[0, 0, 120], [1, 0, 150], [2, 0, 180], [0, 1, 90], [1, 1, 110], [2, 1, 140]] },
|
|
41
|
+
{ "kind": "globe", "title": "出口流向", "span": 6, "arcs": [{ "from": [121.47, 31.23], "to": [8.68, 50.11], "label": "上海→法兰克福" }, { "from": [121.47, 31.23], "to": [-74.01, 40.71], "label": "上海→纽约" }] }
|
|
42
|
+
]
|
|
43
|
+
}
|
|
44
|
+
```
|
|
45
|
+
````
|
|
46
|
+
|
|
47
|
+
## Panels
|
|
48
|
+
|
|
49
|
+
| kind | what it draws | fields |
|
|
50
|
+
| --- | --- | --- |
|
|
51
|
+
| `kpi` | one number counted up from zero, a coloured delta, a sparkline | `value`, `unit`, `prefix`, `decimals`, `delta` (a fraction), `upIsGood`, `trend`, `label` |
|
|
52
|
+
| `gauge` | a dial or a ring sweeping to the value; with `thresholds`, amber past the first and red past the second, for metrics where higher is worse | `value`, `max`, `unit`, `style` (`dial` / `ring`), `thresholds` |
|
|
53
|
+
| `rank` | horizontal bars, longest first, growing in | `items`, `unit`, `top` |
|
|
54
|
+
| `chart` | any ECharts option in the wall's palette, with entrance animation | `option` |
|
|
55
|
+
| `chart3d` | `bar3D`, `scatter3D`, `surface` or `line3D`, slowly turning | `type`, `data`, `xAxis`, `yAxis`, `rotate` |
|
|
56
|
+
| `globe` | a globe with arcing routes and sized points | `arcs`, `points`, `rotate` |
|
|
57
|
+
|
|
58
|
+
Every panel takes `title`, `span` (columns of the grid, default 4 of 12) and `height`. The screen
|
|
59
|
+
takes `title`, `subtitle`, `theme` (`dark` by default, or `light`), `accent` (hex) and `columns`.
|
|
60
|
+
|
|
61
|
+
## Why the protocol looks like this
|
|
62
|
+
|
|
63
|
+
**Presentation, not evidence.** [`@ai-gui/plugin-dashboard`](../plugin-dashboard/README.md) is the
|
|
64
|
+
block for a BI board over real queries: the host writes every number and the model may only
|
|
65
|
+
propose the layout. This block lets the model lay out numbers it was given — a summary, a demo,
|
|
66
|
+
a briefing — and its prompt spec says, in the first paragraph, never to invent one. A wall of
|
|
67
|
+
counting numbers looks like evidence, which is exactly why the rule is there.
|
|
68
|
+
|
|
69
|
+
**Nothing fetched.** ECharts' globe wants a texture and the usual one is a photograph loaded from a
|
|
70
|
+
URL. Here the texture is painted on a canvas in the page and handed over as a data URL — a deep
|
|
71
|
+
sphere with a graticule, the look a data wall's globe has anyway — so a fence can never make the
|
|
72
|
+
page load anything.
|
|
73
|
+
|
|
74
|
+
**One palette.** Charts get the wall's colours, font, transparent background and animation laid
|
|
75
|
+
under whatever the model wrote; the model's own settings win wherever they overlap. Series colours
|
|
76
|
+
start from the accent, so a screen reads as one thing.
|
|
77
|
+
|
|
78
|
+
**Unknown fields are refused.** A model that wrote `sparkline` or `refresh` wanted something on
|
|
79
|
+
the screen, and a panel quietly missing it is the wrong screen.
|
|
80
|
+
|
|
81
|
+
## Options
|
|
82
|
+
|
|
83
|
+
- `maxPanels?: number` — refuse a screen with more panels than this, default 24.
|
|
84
|
+
- `maxSourceBytes?: number` — refuse a fence larger than this before parsing it, default 64 KiB.
|
|
85
|
+
- `animate?: boolean` — `false` draws every panel at its final state: no count-ups, no sweeps, no
|
|
86
|
+
rotation. Default `true`.
|
|
87
|
+
- `theme?: "dark" | "light"` — the host's palette; a `theme` in the fence wins. Absent both, the
|
|
88
|
+
renderer's `theme` context decides, and `dark` is the fallback.
|
|
89
|
+
|
|
90
|
+
Charts are drawn on canvas (WebGL needs it, and the animations are smoother there) and follow
|
|
91
|
+
their panel on resize. Everything is disposed on unmount.
|
|
92
|
+
|
|
93
|
+
Not in this version, and the prompt spec tells the model to fall back to plain charts or prose:
|
|
94
|
+
live refresh, interactive filters, tables, choropleth maps, video.
|
|
95
|
+
|
|
96
|
+
See the [root README](../../README.md) for the full plugin list.
|