@topmindspace/tms-skills 2.0.1 → 2.0.2
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 +139 -134
- package/bin/tms-skills.js +160 -160
- package/package.json +48 -48
- package/top-ppt-html/README.md +254 -254
- package/top-ppt-html/SKILL.md +111 -111
- package/top-ppt-html/assets/examples/2026-09-09-architecture-graphite-dark.html +3873 -3926
- package/top-ppt-html/assets/examples/2026-09-09-architecture-graphite-dark.model.json +167 -167
- package/top-ppt-html/assets/examples/2026-09-09-architecture-spectrum.html +3873 -3926
- package/top-ppt-html/assets/examples/2026-09-09-architecture-spectrum.model.json +167 -167
- package/top-ppt-html/assets/examples/2026-09-09-presentation-apple-mono.html +4272 -4325
- package/top-ppt-html/assets/examples/2026-09-09-presentation-apple-mono.model.json +320 -320
- package/top-ppt-html/assets/examples/2026-09-09-presentation-brand-red.html +4272 -4325
- package/top-ppt-html/assets/examples/2026-09-09-presentation-brand-red.model.json +320 -320
- package/top-ppt-html/assets/examples/2026-09-09-presentation-business-blue.html +4272 -4325
- package/top-ppt-html/assets/examples/2026-09-09-presentation-business-blue.model.json +320 -320
- package/top-ppt-html/assets/examples/2026-09-09-research-deep-teal.html +5474 -5527
- package/top-ppt-html/assets/examples/2026-09-09-research-deep-teal.model.json +913 -913
- package/top-ppt-html/assets/examples/2026-09-09-research-indigo-violet.html +5474 -5527
- package/top-ppt-html/assets/examples/2026-09-09-research-indigo-violet.model.json +913 -913
- package/top-ppt-html/assets/examples/2026-09-09-research-mckinsey.html +5474 -5527
- package/top-ppt-html/assets/examples/2026-09-09-research-mckinsey.model.json +913 -913
- package/top-ppt-html/assets/examples/2026-09-09-research-warm-sand.html +5474 -5527
- package/top-ppt-html/assets/examples/2026-09-09-research-warm-sand.model.json +913 -913
- package/top-ppt-html/assets/pptx-export.js +1944 -1944
- package/top-ppt-html/assets/style-gallery.html +559 -589
- package/top-ppt-html/assets/templates/architecture.html +3675 -3728
- package/top-ppt-html/assets/templates/engine.css +787 -840
- package/top-ppt-html/assets/templates/presentation.html +3685 -3738
- package/top-ppt-html/assets/templates/research.html +3964 -4017
- package/top-ppt-html/assets/templates/ui.js +520 -520
- package/top-ppt-html/assets/theme-overview-architecture.png +0 -0
- package/top-ppt-html/assets/theme-overview-presentation.png +0 -0
- package/top-ppt-html/assets/theme-overview-research.png +0 -0
- package/top-ppt-html/assets/theme-overview.png +0 -0
- package/top-ppt-html/evals/prompts.csv +15 -15
- package/top-ppt-html/evals/rubric.schema.json +25 -25
- package/top-ppt-html/evals/run_evals.py +220 -220
- package/top-ppt-html/evals/trace.example.json +16 -16
- package/top-ppt-html/package-lock.json +175 -0
- package/top-ppt-html/package.json +30 -35
- package/top-ppt-html/references/charts-basic.md +624 -624
- package/top-ppt-html/references/charts-discipline.md +108 -108
- package/top-ppt-html/references/charts-extended.md +482 -482
- package/top-ppt-html/references/charts.md +28 -28
- package/top-ppt-html/references/components-atoms.md +624 -624
- package/top-ppt-html/references/components.md +30 -30
- package/top-ppt-html/references/content-rules.md +490 -490
- package/top-ppt-html/references/design-system-engine.md +235 -235
- package/top-ppt-html/references/design-system.md +471 -478
- package/top-ppt-html/references/failure-modes.md +214 -214
- package/top-ppt-html/references/high-fidelity.md +127 -127
- package/top-ppt-html/references/icons.md +397 -397
- package/top-ppt-html/references/industry-benchmark.md +105 -105
- package/top-ppt-html/references/infographics-stats.md +308 -308
- package/top-ppt-html/references/infographics-structure.md +226 -226
- package/top-ppt-html/references/infographics.md +43 -43
- package/top-ppt-html/references/layout-grammar.md +315 -315
- package/top-ppt-html/references/layouts-architecture.md +108 -108
- package/top-ppt-html/references/layouts-combo.md +600 -600
- package/top-ppt-html/references/layouts-research.md +160 -160
- package/top-ppt-html/references/modes.md +254 -254
- package/top-ppt-html/references/outline-design.md +275 -275
- package/top-ppt-html/references/playbook.md +266 -266
- package/top-ppt-html/references/pptx-export.md +209 -209
- package/top-ppt-html/references/reform-plan.md +252 -252
- package/top-ppt-html/references/styles.md +336 -370
- package/top-ppt-html/references/tech-design.md +138 -138
- package/top-ppt-html/scripts/audit_css.py +109 -109
- package/top-ppt-html/scripts/audit_docs.py +176 -176
- package/top-ppt-html/scripts/audit_skill.py +220 -220
- package/top-ppt-html/scripts/audit_styles.py +293 -351
- package/top-ppt-html/scripts/build_examples.py +2276 -2276
- package/top-ppt-html/scripts/build_pptx.js +2380 -2380
- package/top-ppt-html/scripts/capture_theme_overview.js +78 -78
- package/top-ppt-html/scripts/checks_html.py +127 -127
- package/top-ppt-html/scripts/cross_verify.py +294 -294
- package/top-ppt-html/scripts/env_probe.py +158 -158
- package/top-ppt-html/scripts/extract_model.py +210 -210
- package/top-ppt-html/scripts/extract_snippet.py +374 -374
- package/top-ppt-html/scripts/gen_channel_a.js +214 -214
- package/top-ppt-html/scripts/layout-constants.json +3309 -3377
- package/top-ppt-html/scripts/layout_slots.json +830 -830
- package/top-ppt-html/scripts/lib_layout_regions.js +412 -412
- package/top-ppt-html/scripts/measure_height.py +178 -178
- package/top-ppt-html/scripts/model-schema.json +547 -547
- package/top-ppt-html/scripts/negative_tests.py +307 -307
- package/top-ppt-html/scripts/package_skill.py +291 -291
- package/top-ppt-html/scripts/prepare_images.py +341 -341
- package/top-ppt-html/scripts/probe_image_export.py +188 -188
- package/top-ppt-html/scripts/quality_gate.py +301 -301
- package/top-ppt-html/scripts/regression.py +307 -308
- package/top-ppt-html/scripts/render_compare.py +275 -275
- package/top-ppt-html/scripts/render_from_model.py +698 -698
- package/top-ppt-html/scripts/scaffold_report.py +1054 -1054
- package/top-ppt-html/scripts/section-file-map.json +104 -104
- package/top-ppt-html/scripts/sync_runtime.py +662 -662
- package/top-ppt-html/scripts/validate_pptx.py +1510 -1510
- package/top-ppt-html/scripts/validate_report.py +1456 -1456
|
@@ -1,108 +1,108 @@
|
|
|
1
|
-
# 图表全库 · charts-discipline.md
|
|
2
|
-
|
|
3
|
-
> 由 `charts.md` 拆出(§编号保持不变,跨文件稳定引用)。
|
|
4
|
-
> 取码:`python scripts/extract_snippet.py --file charts.md --section <编号>`
|
|
5
|
-
> 或直接 `--file charts-discipline.md --section <编号>`。整读大文件视为违规。
|
|
6
|
-
|
|
7
|
-
## 64. 图表与"大信息量"的合理性
|
|
8
|
-
|
|
9
|
-
> 数据量大不等于要一次画完。**图要能被 3 秒读懂**,超出承载就升级形态或拆页。
|
|
10
|
-
|
|
11
|
-
| 情形 | 处理 |
|
|
12
|
-
|------|------|
|
|
13
|
-
| 系列 > 5(构成类) | 合并为"其他"(用 `f-c5`/中性),或改 treemap / marimekko |
|
|
14
|
-
| 类别 > 8(排名类) | 取 Top 7 + "其余合并"行;全量放附录密表(同源同口径) |
|
|
15
|
-
| 时间点 > 8(趋势类) | 改面积/折线(点不标数值),或按季度聚合 |
|
|
16
|
-
| 二维 + 第三维 | 散点 → 气泡(半径 ∝ 第三维,面积平方映射) |
|
|
17
|
-
| 行数 > 6(bullet/dumbbell/lollipop/progress) | 拆页或改密表(research) |
|
|
18
|
-
| 极坐标维度 > 6 | 拆成两组雷达,或改热力矩阵(heatmap) |
|
|
19
|
-
| 需要"读数值" | 数值标在数据本体旁(条末/点侧/环内),不强迫查图例换算 |
|
|
20
|
-
| 需要"看结构" | 用色阶与位置,弱化数值(避免数字墙) |
|
|
21
|
-
|
|
22
|
-
**四条硬底线**(校验器会拦):
|
|
23
|
-
1. 图表显示尺寸不得低于 `charts.minSize`(环形 ≥140px、雷达/玫瑰 ≥220/180px、柱折线 viewBox 高 ≥160)。
|
|
24
|
-
2. `data-chart` 类型必须在 `layout-constants.json` `charts.types` 登记。
|
|
25
|
-
3. 图表配色走 `.f-acc/.f-s*/.f-c*` 语义类——**不写死色值**,随主题/风格自动变色。
|
|
26
|
-
4. 一屏只一个视觉重心(图大就不要同时放巨号数字)。
|
|
27
|
-
|
|
28
|
-
---
|
|
29
|
-
|
|
30
|
-
---
|
|
31
|
-
|
|
32
|
-
## 66. 图表误用反例与多样性纪律(交付前自查)
|
|
33
|
-
|
|
34
|
-
> 登记 36 种 ≠ 用对。**选型决策层(分析意图 → 图型 → 禁用条件)见 `references/playbook.md` §五**;本节是落地自查与校验器口径。
|
|
35
|
-
|
|
36
|
-
### 66-1 七种最常见的误用(出现即改判)
|
|
37
|
-
|
|
38
|
-
| 误用 | 症状 | 改成 |
|
|
39
|
-
|------|------|------|
|
|
40
|
-
| 用 `bar` 表达占比 | 柱高加起来不是 100% | `donut` / `stackline` / `waffle` / `marimekko` |
|
|
41
|
-
| 用 `donut` 表达 8 个类别 | 扇区挤成碎片 | 合并为"其他"(≤5 段)或改 `treemap` |
|
|
42
|
-
| 用 `line` 表达类别对比(无时间轴) | x 轴是分类而非时间 | `hbar` / `lollipop` / `pareto` |
|
|
43
|
-
| 用 `table` 表达趋势 | 读者要自己在数字里找方向 | `line` / `area` / `slope` |
|
|
44
|
-
| 用均值型图表达分布 | 均值掩盖离散度 | `boxplot` / `dotplot` |
|
|
45
|
-
| 同页放两张同型图 | 两个视觉重心互相打架 | 改 `split` / `halftable` 并让两图**编码不同维度** |
|
|
46
|
-
| 多系列图用单色明度阶梯 | 三条线分不清谁是谁 | `f-c1~c5` / `s-c1~c5` 编码色板(见 `design-system.md` §9b) |
|
|
47
|
-
|
|
48
|
-
### 66-2 多样性纪律(校验器硬拦 · 阈值单源 `layout-constants.json` `charts.variety`)
|
|
49
|
-
|
|
50
|
-
1. **类型数下限**:全篇不同 `data-chart` 类型数 ≥ `min(minTypes[mode], ⌈图表页数 × 0.6⌉)`(research 上限 6 / presentation 4 / architecture 3)。
|
|
51
|
-
2. **不连续同型**:相邻图表页不得使用同一 `data-chart` 类型——读者视角就是"又一张一样的图"。
|
|
52
|
-
3. **组合版式比例**(research):含 ≥2 种承载类型(图表 / 表格 / 卡片 / 指标 / 图片 / 结构图)的内容页 ≥ **30%**——单件页是例外不是默认。组合方式见 `components.md` §46c 与 `references/playbook.md` §四。
|
|
53
|
-
4. **一屏一个视觉重心**:主件明显大于从件;两个并列大件必须拆页或走 `split` 明确左右分工。
|
|
54
|
-
|
|
55
|
-
### 66-3 编码色 ≠ 状态色(别混用)
|
|
56
|
-
|
|
57
|
-
- **分类**(哪个系列 / 哪个域 / 哪个渠道)→ `f-c1~c5` / `s-c1~c5`:9 套风格各有自己的 5 色板,随主题自动切换。
|
|
58
|
-
- **状态 / 评价**(好 vs 坏、达标 vs 未达标、涨 vs 跌)→ **只用强调色明度阶梯 + 中性色**,**不得用红绿**(`heatmap` / `bullet` / `bulletchart` / `candlestick` 的既有规则不变)。
|
|
59
|
-
- 两者不可互换:用红绿表达"哪个域"会让读者误读为"好坏";用色阶表达"达标与否"会让读者分不清类别。
|
|
60
|
-
|
|
61
|
-
### 66-4 误用 → 改判对照代码(三组高频案例)
|
|
62
|
-
|
|
63
|
-
**① 占比用了 `bar`(柱高相加无意义)→ 改 `donut`**
|
|
64
|
-
|
|
65
|
-
```html
|
|
66
|
-
<!-- ✗ 误用:构成数据画成独立柱,读者无法感知"份额" -->
|
|
67
|
-
<svg class="chart" data-chart="bar" viewBox="0 0 480 190">
|
|
68
|
-
<rect x="40" y="30" width="60" height="120" class="f-c1"/> <!-- 工具 42% -->
|
|
69
|
-
<rect x="160" y="69" width="60" height="81" class="f-c2"/> <!-- 资讯 31% -->
|
|
70
|
-
<rect x="280" y="107" width="60" height="43" class="f-c3"/> <!-- 社交 27% -->
|
|
71
|
-
</svg>
|
|
72
|
-
|
|
73
|
-
<!-- ✓ 改判:donut,扇区 ≤5,数值标环心,口径写来源行(完整代码 --chart donut) -->
|
|
74
|
-
<svg class="chart" data-chart="donut" viewBox="0 0 150 150" style="width:190px;margin-inline:auto">
|
|
75
|
-
<circle cx="75" cy="75" r="54" class="f-none s-bds" stroke-width="15"/>
|
|
76
|
-
<circle data-sweep data-circ="339.3" data-p="0.42" cx="75" cy="75" r="54" class="f-none s-acc"
|
|
77
|
-
stroke-width="15" stroke-dasharray="142.5 196.8" transform="rotate(-90 75 75)"/>
|
|
78
|
-
<text x="75" y="73" text-anchor="middle" class="f-txt" font-size="24">42%</text>
|
|
79
|
-
<text x="75" y="93" text-anchor="middle" class="f-txt3" font-size="11">工具类</text>
|
|
80
|
-
</svg>
|
|
81
|
-
```
|
|
82
|
-
|
|
83
|
-
**② `donut` 硬塞 8 个类别(最小扇区 <8%)→ 合并"其他"或改 `treemap`**
|
|
84
|
-
|
|
85
|
-
```html
|
|
86
|
-
<!-- ✗ 误用:8 段扇区,4 段 <8% 挤成碎片,图例比图还大 -->
|
|
87
|
-
<!-- ✓ 改判:保留 Top 4,其余并入"其他"(f-c5/中性);叶 >16 才升级 treemap -->
|
|
88
|
-
```
|
|
89
|
-
> 执行:`data-p` 取 0.42/0.31/0.14/0.08/0.05(其他),扇区 5 段封顶;"其他"明细沉附录密表(同源同口径)。
|
|
90
|
-
|
|
91
|
-
**③ `line` 表达类别对比(x 轴不是时间)→ 改 `hbar`**
|
|
92
|
-
|
|
93
|
-
```html
|
|
94
|
-
<!-- ✗ 误用:x 轴是部门名,折线暗示了不存在的时序连续性 -->
|
|
95
|
-
<svg class="chart" data-chart="line" viewBox="0 0 480 190">
|
|
96
|
-
<polyline points="40,120 160,60 280,90 400,40" class="s-acc" fill="none"/>
|
|
97
|
-
<text x="40" y="180" class="f-txt3">研发</text> <!-- 分类被当成了时间 -->
|
|
98
|
-
</svg>
|
|
99
|
-
|
|
100
|
-
<!-- ✓ 改判:hbar——排名类比较,类别名在左、数值标条末(完整代码 --chart hbar) -->
|
|
101
|
-
<svg class="chart" data-chart="hbar" viewBox="0 0 520 210">
|
|
102
|
-
<rect x="90" y="20" width="360" height="26" class="f-acc"/> <!-- 研发 849 -->
|
|
103
|
-
<rect x="90" y="70" width="330" height="26" class="f-c2"/> <!-- 供应 834 -->
|
|
104
|
-
</svg>
|
|
105
|
-
```
|
|
106
|
-
|
|
107
|
-
---
|
|
108
|
-
|
|
1
|
+
# 图表全库 · charts-discipline.md
|
|
2
|
+
|
|
3
|
+
> 由 `charts.md` 拆出(§编号保持不变,跨文件稳定引用)。
|
|
4
|
+
> 取码:`python scripts/extract_snippet.py --file charts.md --section <编号>`
|
|
5
|
+
> 或直接 `--file charts-discipline.md --section <编号>`。整读大文件视为违规。
|
|
6
|
+
|
|
7
|
+
## 64. 图表与"大信息量"的合理性
|
|
8
|
+
|
|
9
|
+
> 数据量大不等于要一次画完。**图要能被 3 秒读懂**,超出承载就升级形态或拆页。
|
|
10
|
+
|
|
11
|
+
| 情形 | 处理 |
|
|
12
|
+
|------|------|
|
|
13
|
+
| 系列 > 5(构成类) | 合并为"其他"(用 `f-c5`/中性),或改 treemap / marimekko |
|
|
14
|
+
| 类别 > 8(排名类) | 取 Top 7 + "其余合并"行;全量放附录密表(同源同口径) |
|
|
15
|
+
| 时间点 > 8(趋势类) | 改面积/折线(点不标数值),或按季度聚合 |
|
|
16
|
+
| 二维 + 第三维 | 散点 → 气泡(半径 ∝ 第三维,面积平方映射) |
|
|
17
|
+
| 行数 > 6(bullet/dumbbell/lollipop/progress) | 拆页或改密表(research) |
|
|
18
|
+
| 极坐标维度 > 6 | 拆成两组雷达,或改热力矩阵(heatmap) |
|
|
19
|
+
| 需要"读数值" | 数值标在数据本体旁(条末/点侧/环内),不强迫查图例换算 |
|
|
20
|
+
| 需要"看结构" | 用色阶与位置,弱化数值(避免数字墙) |
|
|
21
|
+
|
|
22
|
+
**四条硬底线**(校验器会拦):
|
|
23
|
+
1. 图表显示尺寸不得低于 `charts.minSize`(环形 ≥140px、雷达/玫瑰 ≥220/180px、柱折线 viewBox 高 ≥160)。
|
|
24
|
+
2. `data-chart` 类型必须在 `layout-constants.json` `charts.types` 登记。
|
|
25
|
+
3. 图表配色走 `.f-acc/.f-s*/.f-c*` 语义类——**不写死色值**,随主题/风格自动变色。
|
|
26
|
+
4. 一屏只一个视觉重心(图大就不要同时放巨号数字)。
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
## 66. 图表误用反例与多样性纪律(交付前自查)
|
|
33
|
+
|
|
34
|
+
> 登记 36 种 ≠ 用对。**选型决策层(分析意图 → 图型 → 禁用条件)见 `references/playbook.md` §五**;本节是落地自查与校验器口径。
|
|
35
|
+
|
|
36
|
+
### 66-1 七种最常见的误用(出现即改判)
|
|
37
|
+
|
|
38
|
+
| 误用 | 症状 | 改成 |
|
|
39
|
+
|------|------|------|
|
|
40
|
+
| 用 `bar` 表达占比 | 柱高加起来不是 100% | `donut` / `stackline` / `waffle` / `marimekko` |
|
|
41
|
+
| 用 `donut` 表达 8 个类别 | 扇区挤成碎片 | 合并为"其他"(≤5 段)或改 `treemap` |
|
|
42
|
+
| 用 `line` 表达类别对比(无时间轴) | x 轴是分类而非时间 | `hbar` / `lollipop` / `pareto` |
|
|
43
|
+
| 用 `table` 表达趋势 | 读者要自己在数字里找方向 | `line` / `area` / `slope` |
|
|
44
|
+
| 用均值型图表达分布 | 均值掩盖离散度 | `boxplot` / `dotplot` |
|
|
45
|
+
| 同页放两张同型图 | 两个视觉重心互相打架 | 改 `split` / `halftable` 并让两图**编码不同维度** |
|
|
46
|
+
| 多系列图用单色明度阶梯 | 三条线分不清谁是谁 | `f-c1~c5` / `s-c1~c5` 编码色板(见 `design-system.md` §9b) |
|
|
47
|
+
|
|
48
|
+
### 66-2 多样性纪律(校验器硬拦 · 阈值单源 `layout-constants.json` `charts.variety`)
|
|
49
|
+
|
|
50
|
+
1. **类型数下限**:全篇不同 `data-chart` 类型数 ≥ `min(minTypes[mode], ⌈图表页数 × 0.6⌉)`(research 上限 6 / presentation 4 / architecture 3)。
|
|
51
|
+
2. **不连续同型**:相邻图表页不得使用同一 `data-chart` 类型——读者视角就是"又一张一样的图"。
|
|
52
|
+
3. **组合版式比例**(research):含 ≥2 种承载类型(图表 / 表格 / 卡片 / 指标 / 图片 / 结构图)的内容页 ≥ **30%**——单件页是例外不是默认。组合方式见 `components.md` §46c 与 `references/playbook.md` §四。
|
|
53
|
+
4. **一屏一个视觉重心**:主件明显大于从件;两个并列大件必须拆页或走 `split` 明确左右分工。
|
|
54
|
+
|
|
55
|
+
### 66-3 编码色 ≠ 状态色(别混用)
|
|
56
|
+
|
|
57
|
+
- **分类**(哪个系列 / 哪个域 / 哪个渠道)→ `f-c1~c5` / `s-c1~c5`:9 套风格各有自己的 5 色板,随主题自动切换。
|
|
58
|
+
- **状态 / 评价**(好 vs 坏、达标 vs 未达标、涨 vs 跌)→ **只用强调色明度阶梯 + 中性色**,**不得用红绿**(`heatmap` / `bullet` / `bulletchart` / `candlestick` 的既有规则不变)。
|
|
59
|
+
- 两者不可互换:用红绿表达"哪个域"会让读者误读为"好坏";用色阶表达"达标与否"会让读者分不清类别。
|
|
60
|
+
|
|
61
|
+
### 66-4 误用 → 改判对照代码(三组高频案例)
|
|
62
|
+
|
|
63
|
+
**① 占比用了 `bar`(柱高相加无意义)→ 改 `donut`**
|
|
64
|
+
|
|
65
|
+
```html
|
|
66
|
+
<!-- ✗ 误用:构成数据画成独立柱,读者无法感知"份额" -->
|
|
67
|
+
<svg class="chart" data-chart="bar" viewBox="0 0 480 190">
|
|
68
|
+
<rect x="40" y="30" width="60" height="120" class="f-c1"/> <!-- 工具 42% -->
|
|
69
|
+
<rect x="160" y="69" width="60" height="81" class="f-c2"/> <!-- 资讯 31% -->
|
|
70
|
+
<rect x="280" y="107" width="60" height="43" class="f-c3"/> <!-- 社交 27% -->
|
|
71
|
+
</svg>
|
|
72
|
+
|
|
73
|
+
<!-- ✓ 改判:donut,扇区 ≤5,数值标环心,口径写来源行(完整代码 --chart donut) -->
|
|
74
|
+
<svg class="chart" data-chart="donut" viewBox="0 0 150 150" style="width:190px;margin-inline:auto">
|
|
75
|
+
<circle cx="75" cy="75" r="54" class="f-none s-bds" stroke-width="15"/>
|
|
76
|
+
<circle data-sweep data-circ="339.3" data-p="0.42" cx="75" cy="75" r="54" class="f-none s-acc"
|
|
77
|
+
stroke-width="15" stroke-dasharray="142.5 196.8" transform="rotate(-90 75 75)"/>
|
|
78
|
+
<text x="75" y="73" text-anchor="middle" class="f-txt" font-size="24">42%</text>
|
|
79
|
+
<text x="75" y="93" text-anchor="middle" class="f-txt3" font-size="11">工具类</text>
|
|
80
|
+
</svg>
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
**② `donut` 硬塞 8 个类别(最小扇区 <8%)→ 合并"其他"或改 `treemap`**
|
|
84
|
+
|
|
85
|
+
```html
|
|
86
|
+
<!-- ✗ 误用:8 段扇区,4 段 <8% 挤成碎片,图例比图还大 -->
|
|
87
|
+
<!-- ✓ 改判:保留 Top 4,其余并入"其他"(f-c5/中性);叶 >16 才升级 treemap -->
|
|
88
|
+
```
|
|
89
|
+
> 执行:`data-p` 取 0.42/0.31/0.14/0.08/0.05(其他),扇区 5 段封顶;"其他"明细沉附录密表(同源同口径)。
|
|
90
|
+
|
|
91
|
+
**③ `line` 表达类别对比(x 轴不是时间)→ 改 `hbar`**
|
|
92
|
+
|
|
93
|
+
```html
|
|
94
|
+
<!-- ✗ 误用:x 轴是部门名,折线暗示了不存在的时序连续性 -->
|
|
95
|
+
<svg class="chart" data-chart="line" viewBox="0 0 480 190">
|
|
96
|
+
<polyline points="40,120 160,60 280,90 400,40" class="s-acc" fill="none"/>
|
|
97
|
+
<text x="40" y="180" class="f-txt3">研发</text> <!-- 分类被当成了时间 -->
|
|
98
|
+
</svg>
|
|
99
|
+
|
|
100
|
+
<!-- ✓ 改判:hbar——排名类比较,类别名在左、数值标条末(完整代码 --chart hbar) -->
|
|
101
|
+
<svg class="chart" data-chart="hbar" viewBox="0 0 520 210">
|
|
102
|
+
<rect x="90" y="20" width="360" height="26" class="f-acc"/> <!-- 研发 849 -->
|
|
103
|
+
<rect x="90" y="70" width="330" height="26" class="f-c2"/> <!-- 供应 834 -->
|
|
104
|
+
</svg>
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
---
|
|
108
|
+
|