📝 docs(tsl): restructure agent-facing reference

Rework TSL syntax, catalog, modules, and routing docs around deterministic agent lookup and generation.

Split large catalog pages into focused function fact pages, remove obsolete pending/verified/unavailable paths, and update consistency tests for the new structure.
This commit is contained in:
csh
2026-06-09 17:24:30 +08:00
parent 9c194170a1
commit 540b3c0a1b
192 changed files with 32929 additions and 13533 deletions
@@ -0,0 +1,100 @@
# 图形函数 - 作图函数
文档类型:函数事实页
是否可直接用于生成代码:是;本页函数条目均包含参数表
遇到不确定时:回到 [../graphics.md](../graphics.md)、[../../index.md](../../index.md)
## 作图函数
### `mergeGraph(graph1, graph2, graph3, graph4)`
用途:合并多个图形对象。
参数个数:4
返回值:处理后的图形结果
| 参数位置 | 参数名 | 必填 | 接收类型 | 说明 |
| -------- | -------- | ---- | -------- | ---------- |
| 1 | `graph1` | 是 | 图形对象 | 第一个图形 |
| 2 | `graph2` | 是 | 图形对象 | 第二个图形 |
| 3 | `graph3` | 是 | 图形对象 | 第三个图形 |
| 4 | `graph4` | 是 | 图形对象 | 第四个图形 |
### `encodeGraphGroup(graphs, options)`
用途:编码图形组合。
参数个数:2
返回值:处理后的结果值
| 参数位置 | 参数名 | 必填 | 接收类型 | 说明 |
| -------- | --------- | ---- | -------- | ------------ |
| 1 | `graphs` | 是 | 数组 | 图形对象数组 |
| 2 | `options` | 是 | 数组 | 编码选项 |
### `decodeGraphGroup(data, out_graph, out_data)`
用途:分解图形组合。
参数个数:3
返回值:处理后的结果值
| 参数位置 | 参数名 | 必填 | 接收类型 | 说明 |
| -------- | ----------- | ---- | ------------- | -------------------- |
| 1 | `data` | 是 | 图形组合/数组 | 待分解的图形组合数据 |
| 2 | `out_graph` | 是 | 变量引用 | 输出分解后的图形 |
| 3 | `out_data` | 是 | 变量引用 | 输出分解后的数据 |
### `decodeGraph(graph, out_type, out_name, out_data, out_property)`
用途:分解图形对象。
参数个数:5
返回值:处理后的结果值
| 参数位置 | 参数名 | 必填 | 接收类型 | 说明 |
| -------- | -------------- | ---- | -------- | ------------ |
| 1 | `graph` | 是 | 图形对象 | 待分解的图形 |
| 2 | `out_type` | 是 | 变量引用 | 输出图形类型 |
| 3 | `out_name` | 是 | 变量引用 | 输出图形名称 |
| 4 | `out_data` | 是 | 变量引用 | 输出图形数据 |
| 5 | `out_property` | 是 | 变量引用 | 输出图形属性 |
### `encodeGraph(graph_type, name, data, options)`
用途:编码图形对象。
参数个数:4
返回值:处理后的图形结果
| 参数位置 | 参数名 | 必填 | 接收类型 | 说明 |
| -------- | ------------ | ---- | ------------- | -------- |
| 1 | `graph_type` | 是 | 整数/图形类型 | 图形类型 |
| 2 | `name` | 是 | 字符串 | 图形名称 |
| 3 | `data` | 是 | 数组 | 图形数据 |
| 4 | `options` | 是 | 数组 | 图形选项 |
### `graphGroup(arg1, arg2, arg3, arg4)`
用途:作图函数相关函数。
参数个数:4
返回值:处理后的结果值
| 参数位置 | 参数名 | 必填 | 接收类型 | 说明 |
| -------- | ------ | ---- | -------- | -------------------- |
| 1 | `arg1` | 是 | 任意值 | 按源文档示例顺序传入 |
| 2 | `arg2` | 是 | 任意值 | 按源文档示例顺序传入 |
| 3 | `arg3` | 是 | 任意值 | 按源文档示例顺序传入 |
| 4 | `arg4` | 是 | 整数 | 按源文档示例顺序传入 |
### `getColorByIndex(index)`
用途:按颜色索引获取颜色值。
参数个数:1
返回值:整数
| 参数位置 | 参数名 | 必填 | 接收类型 | 说明 |
| -------- | ------- | ---- | -------- | -------- |
| 1 | `index` | 是 | 整数 | 颜色索引 |