ai-chart-toolkit 1.0.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.

Potentially problematic release.


This version of ai-chart-toolkit might be problematic. Click here for more details.

Files changed (27) hide show
  1. ai_chart_toolkit-1.0.0/.skills/ai-chart-generator/SKILL.md +205 -0
  2. ai_chart_toolkit-1.0.0/.skills/ai-chart-generator/references/schema.json +584 -0
  3. ai_chart_toolkit-1.0.0/LICENSE +9 -0
  4. ai_chart_toolkit-1.0.0/MANIFEST.in +7 -0
  5. ai_chart_toolkit-1.0.0/PKG-INFO +131 -0
  6. ai_chart_toolkit-1.0.0/README.md +106 -0
  7. ai_chart_toolkit-1.0.0/SKILL.md +205 -0
  8. ai_chart_toolkit-1.0.0/ai_chart_toolkit/__init__.py +39 -0
  9. ai_chart_toolkit-1.0.0/ai_chart_toolkit/__main__.py +5 -0
  10. ai_chart_toolkit-1.0.0/ai_chart_toolkit/api_server.py +83 -0
  11. ai_chart_toolkit-1.0.0/ai_chart_toolkit/assets/background.png +0 -0
  12. ai_chart_toolkit-1.0.0/ai_chart_toolkit/engine.py +946 -0
  13. ai_chart_toolkit-1.0.0/ai_chart_toolkit/mcp_server.py +117 -0
  14. ai_chart_toolkit-1.0.0/ai_chart_toolkit/schemas.py +164 -0
  15. ai_chart_toolkit-1.0.0/ai_chart_toolkit/tool.py +223 -0
  16. ai_chart_toolkit-1.0.0/ai_chart_toolkit.egg-info/PKG-INFO +131 -0
  17. ai_chart_toolkit-1.0.0/ai_chart_toolkit.egg-info/SOURCES.txt +25 -0
  18. ai_chart_toolkit-1.0.0/ai_chart_toolkit.egg-info/dependency_links.txt +1 -0
  19. ai_chart_toolkit-1.0.0/ai_chart_toolkit.egg-info/entry_points.txt +4 -0
  20. ai_chart_toolkit-1.0.0/ai_chart_toolkit.egg-info/requires.txt +1 -0
  21. ai_chart_toolkit-1.0.0/ai_chart_toolkit.egg-info/top_level.txt +1 -0
  22. ai_chart_toolkit-1.0.0/examples/cloud_example.py +46 -0
  23. ai_chart_toolkit-1.0.0/examples/ollama_example.py +66 -0
  24. ai_chart_toolkit-1.0.0/pyproject.toml +54 -0
  25. ai_chart_toolkit-1.0.0/setup.cfg +4 -0
  26. ai_chart_toolkit-1.0.0/setup.py +26 -0
  27. ai_chart_toolkit-1.0.0/tests/test_all_charts.py +96 -0
@@ -0,0 +1,205 @@
1
+ ---
2
+ name: ai-chart-generator
3
+ description: Generate high-resolution 16:9 visual diagrams, multi-stage flowcharts, hierarchy architecture trees, donut/pie charts, concentric telemetry activity rings, and precision radial performance gauges. Use whenever an agent or user requests blueprints, architecture visuals, process pipelines, metrics dashboards, or data visualizations.
4
+ ---
5
+
6
+ # AI Chart Generator Skill
7
+
8
+ This skill allows AI models and autonomous agents (such as Antigravity, Claude Code, Codex, Cursor, and local LLMs) to generate high-resolution, presentation-ready 16:9 visual diagrams.
9
+
10
+ ## When to Use This Skill
11
+
12
+ Activate this skill when:
13
+ - The user requests a **flowchart**, **pipeline diagram**, or **workflow architecture**.
14
+ - The user requests a **system hierarchy**, **organization tree**, or **microservice dependency map**.
15
+ - The user asks for **market share**, **budget allocation**, or **proportional data** as a **pie** or **donut chart**.
16
+ - The user asks for **resource utilization**, **telemetry metrics**, or **activity rings** (CPU, RAM, disk, network).
17
+ - The user asks for a **gauge**, **dial**, **speedometer**, or **thermal monitor** with threshold zones.
18
+
19
+ ---
20
+
21
+ ## Capabilities & Chart Types
22
+
23
+ The engine exports crisp 16:9 images (1672 × 941 default) with clean blueprint grid backgrounds, modern typography, and anti-aliased geometry:
24
+
25
+ | Chart Type | Key Use Cases | Required Input Fields |
26
+ | :--- | :--- | :--- |
27
+ | `flowchart` | Sequential workflows, AI pipelines, edge IoT stages | `title`, `stages` (`header`, `blocks`) |
28
+ | `hierarchy` | Architecture trees, folder trees, org charts | `title`, `root_node` (`name`, `children`) |
29
+ | `donut` | Proportions with center KPI (e.g. `"$1.2M"`, `"94%"`) | `title`, `data` (`label`, `value`), `center_text` |
30
+ | `pie` | Solid proportional distribution slices | `title`, `data` (`label`, `value`) |
31
+ | `rings` | Concentric activity/progress rings (0–100%) | `title`, `metrics` (`label`, `pct`) |
32
+ | `gauge` | 240° dial with threshold zones and needle | `title`, `value`, `min_val`, `max_val`, `unit` |
33
+
34
+ ---
35
+
36
+ ## How Agents Should Invoke This Tool
37
+
38
+ ### Method 1: Command Line (CLI)
39
+ Any agent with terminal/bash execution capability can run:
40
+ ```bash
41
+ ai-chart '{"chart_type": "gauge", "title": "Server Temperature", "value": 54.2, "unit": "°C"}'
42
+ ```
43
+ Or with Python module syntax:
44
+ ```bash
45
+ python -m ai_chart_toolkit.tool '{"chart_type": "donut", "title": "Budget Breakdown", "center_text": "$84k", "data": [{"label": "Compute", "value": 60}, {"label": "Storage", "value": 40}]}'
46
+ ```
47
+
48
+ ### Method 2: Python Function Calls
49
+ ```python
50
+ from ai_chart_toolkit import execute_chart_tool
51
+
52
+ result = execute_chart_tool("flowchart", {
53
+ "title": "Autonomous Edge Agent",
54
+ "subtitle": "Multimodal perception and physical actuation",
55
+ "stages": [
56
+ {"header": "PERCEPTION", "blocks": [{"label": "Camera & Audio", "type": "input"}]},
57
+ {"header": "REASONING", "blocks": [{"label": "Gemma 4 Local", "type": "ai_model"}]},
58
+ {"header": "ACTUATION", "blocks": [{"label": "Relay Switch", "type": "output"}]}
59
+ ],
60
+ "output_path": "output/agent_pipeline.png"
61
+ })
62
+ print("Chart generated at:", result["absolute_path"])
63
+ ```
64
+
65
+ ### Method 3: Model Context Protocol (MCP)
66
+ Add to your agent's MCP config:
67
+ ```json
68
+ {
69
+ "mcpServers": {
70
+ "ai-chart": {
71
+ "command": "ai-chart-mcp"
72
+ }
73
+ }
74
+ }
75
+ ```
76
+
77
+ ### Method 4: Local HTTP REST API
78
+ Start the server with `ai-chart-api` (or `python -m ai_chart_toolkit.api_server`) and send POST requests:
79
+ ```bash
80
+ curl -X POST http://localhost:8000/render \
81
+ -H "Content-Type: application/json" \
82
+ -d '{"chart_type": "rings", "title": "Cluster Load", "metrics": [{"label": "CPU", "pct": 78}, {"label": "RAM", "pct": 62}]}'
83
+ ```
84
+
85
+ ---
86
+
87
+ ## Detailed Payload Specifications
88
+
89
+ ### 1. Flowchart (`chart_type: "flowchart"`)
90
+ Semantic block categories for `type`:
91
+ - `"input"` (Dark Slate) — Sensors, user voice, webhooks, requests.
92
+ - `"ai_model"` (Electric Blue) — LLMs, vision models, classifiers.
93
+ - `"tool"` (Teal) — Python scripts, APIs, Home Assistant, relays.
94
+ - `"data_store"` (Amber Gold) — SQLite, Vector DB, Redis, JSON files.
95
+ - `"output"` (Emerald Green) — Audio reply, motors, dashboard alert.
96
+
97
+ ```json
98
+ {
99
+ "chart_type": "flowchart",
100
+ "title": "Voice Assistant Architecture",
101
+ "subtitle": "Local low-latency pipeline",
102
+ "stages": [
103
+ {
104
+ "header": "WAKE & SPEECH",
105
+ "blocks": [
106
+ {"label": "Wake Word Engine", "type": "input"},
107
+ {"label": "Whisper STT", "type": "input"}
108
+ ]
109
+ },
110
+ {
111
+ "header": "CORE BRAIN",
112
+ "blocks": [
113
+ {"label": "Ollama (Llama 3.2)", "type": "ai_model"},
114
+ {"label": "Context Vector Store", "type": "data_store"}
115
+ ]
116
+ },
117
+ {
118
+ "header": "DISPATCH",
119
+ "blocks": [
120
+ {"label": "Home Assistant MCP", "type": "tool"}
121
+ ]
122
+ },
123
+ {
124
+ "header": "FEEDBACK",
125
+ "blocks": [
126
+ {"label": "Piper TTS Speaker", "type": "output"}
127
+ ]
128
+ }
129
+ ]
130
+ }
131
+ ```
132
+
133
+ ### 2. Hierarchy Tree (`chart_type: "hierarchy"`)
134
+ ```json
135
+ {
136
+ "chart_type": "hierarchy",
137
+ "title": "Enterprise Cloud Architecture",
138
+ "subtitle": "Multi-region service topography",
139
+ "root_node": {
140
+ "name": "Global Gateway",
141
+ "desc": "Cloudflare Anycast",
142
+ "children": [
143
+ {
144
+ "name": "US-East Region",
145
+ "desc": "Primary Cluster",
146
+ "children": [
147
+ {"name": "Auth API", "desc": "FastAPI Pods"},
148
+ {"name": "DB Primary", "desc": "Postgres Aurora"}
149
+ ]
150
+ },
151
+ {
152
+ "name": "EU-Central Region",
153
+ "desc": "Read Replica",
154
+ "children": [
155
+ {"name": "Cache Edge", "desc": "Redis Cluster"},
156
+ {"name": "Worker Pool", "desc": "Celery Queues"}
157
+ ]
158
+ }
159
+ ]
160
+ }
161
+ }
162
+ ```
163
+
164
+ ### 3. Donut Chart (`chart_type: "donut"`)
165
+ ```json
166
+ {
167
+ "chart_type": "donut",
168
+ "title": "Monthly Cloud Spend",
169
+ "center_text": "$18,400",
170
+ "center_sub": "Total Run Rate",
171
+ "data": [
172
+ {"label": "GPU Instances", "value": 52},
173
+ {"label": "Object Storage", "value": 24},
174
+ {"label": "Database Engine", "value": 14},
175
+ {"label": "Egress Traffic", "value": 10}
176
+ ]
177
+ }
178
+ ```
179
+
180
+ ### 4. Precision Radial Gauge (`chart_type: "gauge"`)
181
+ ```json
182
+ {
183
+ "chart_type": "gauge",
184
+ "title": "3D Printer Heatbed Temp",
185
+ "subtitle": "Watchdog thermistor telemetry",
186
+ "value": 68.4,
187
+ "min_val": 0,
188
+ "max_val": 120,
189
+ "unit": "°C Temperature",
190
+ "zones": [
191
+ [0.50, "#10B981"],
192
+ [0.75, "#F59E0B"],
193
+ [1.00, "#EF4444"]
194
+ ]
195
+ }
196
+ ```
197
+
198
+ ---
199
+
200
+ ## Best Practices for Agents
201
+
202
+ 1. **Keep Labels Concise**: Use 2 to 4 words per block label for optimal visual balance.
203
+ 2. **Include Subtitles**: Subtitles provide helpful context and are automatically spaced with clean margins.
204
+ 3. **Themes**: Default theme is clean blueprint light (`"default"`). Pass `"theme": "dark"` for deep navy presentations.
205
+ 4. **Output Paths**: If the user didn't specify an output path, omit it; the engine automatically saves to `output/<slugified_title>_<type>.png` and returns the file path.