From 9ee3d495b6d1cb69b7f1f26c5f771d49c7d88efb Mon Sep 17 00:00:00 2001 From: fujie Date: Sun, 28 Dec 2025 20:46:03 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=9B=BF=E6=8D=A2=20`compare-table`=20?= =?UTF-8?q?=E4=B8=BA=20`list-grid`=20=E5=B9=B6=E6=96=B0=E5=A2=9E=20`compar?= =?UTF-8?q?e-binary`=20=E7=A4=BA=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/actions/infographic/infographic.py | 31 +++++++++++++++++++--- plugins/actions/infographic/信息图.py | 23 ++++++++++++++-- 2 files changed, 48 insertions(+), 6 deletions(-) diff --git a/plugins/actions/infographic/infographic.py b/plugins/actions/infographic/infographic.py index 8cffffc..ebacab6 100644 --- a/plugins/actions/infographic/infographic.py +++ b/plugins/actions/infographic/infographic.py @@ -56,7 +56,7 @@ Choose the most appropriate template based on the content structure: - **Relationship**: `relation-sankey` (Sankey Diagram), `relation-circle` (Circular Relationship) #### 3. Comparison & Analysis -- **Comparison**: `compare-binary` (Binary Comparison), `compare-table` (Comparison Table) +- **Comparison**: `compare-binary` (Binary Comparison), `list-grid` (Multi-item Grid Comparison) - **Analysis**: `compare-swot` (SWOT Analysis), `quadrant-quarter` (Quadrant Chart) #### 4. Charts & Data @@ -79,7 +79,31 @@ data desc Description of B ``` -#### B. SWOT Analysis + +#### B. Binary Comparison +Use `items` for two sides and `children` for comparison points. + +```infographic +infographic compare-binary +data + title Advantages vs Disadvantages + desc Compare two aspects side by side + items + - label Advantages + children + - label Strong R&D + desc Leading technology and innovation capability + - label High customer loyalty + desc Repurchase rate over 60% + - label Disadvantages + children + - label Weak brand exposure + desc Insufficient marketing, low awareness + - label Narrow channel coverage + desc Limited online channels +``` + +#### C. SWOT Analysis Use `children` to define the 4 quadrants (Strengths, Weaknesses, Opportunities, Threats). ```infographic @@ -106,7 +130,7 @@ data - label New Competitors ``` -#### C. Quadrant Chart +#### D. Quadrant Chart Use `items` for quadrants and `illus` for icons. ```infographic @@ -499,7 +523,6 @@ SCRIPT_TEMPLATE_INFOGRAPHIC = """ // Comparison & Analysis 'compare-binary': 'compare-binary-horizontal-simple-vs', 'compare-swot': 'compare-swot', - 'compare-table': 'compare-table-simple', 'quadrant-quarter': 'quadrant-quarter-simple-card', // Charts & Data diff --git a/plugins/actions/infographic/信息图.py b/plugins/actions/infographic/信息图.py index f66b9b2..3f80aac 100644 --- a/plugins/actions/infographic/信息图.py +++ b/plugins/actions/infographic/信息图.py @@ -60,8 +60,8 @@ Infographic syntax is a Mermaid-like declarative syntax for describing infograph #### 3. Comparison & Analysis - **Binary Comparison (A vs B)** -> `compare-binary` - **SWOT Analysis** -> `compare-swot` -- **Multi-item Comparison Table** -> `compare-table` - **Quadrant Analysis (Importance vs Urgency)** -> `quadrant-quarter` +- **Multi-item Grid Comparison** -> `list-grid` (use for comparing multiple items) #### 4. Charts & Data (Metric-heavy) - **Key Metrics / Data Cards** -> `statistic-card` @@ -111,6 +111,26 @@ data - label Mar value 1800 + +#### Comparison (Binary Comparison) +infographic compare-binary +data + title Advantages vs Disadvantages + desc Compare two aspects side by side + items + - label Advantages + children + - label Strong R&D + desc Leading technology and innovation capability + - label High customer loyalty + desc Repurchase rate over 60% + - label Disadvantages + children + - label Weak brand exposure + desc Insufficient marketing, low awareness + - label Narrow channel coverage + desc Limited online channels + #### Comparison (SWOT) infographic compare-swot data @@ -514,7 +534,6 @@ SCRIPT_TEMPLATE_INFOGRAPHIC = """ // 对比与分析 'compare-binary': 'compare-binary-horizontal-simple-vs', 'compare-swot': 'compare-swot', - 'compare-table': 'compare-table-simple', // 暂无直接对应 'quadrant-quarter': 'quadrant-quarter-simple-card', // 图表与数据