create-visualization
npx skills add https://github.com/thepexcel/agent-skills --skill create-visualization
Agent 安装分布
Skill 文档
Visualization Skill
สรà¹à¸²à¸ diagrams à¹à¸¥à¸° animations สำหรัà¸à¸à¸à¸´à¸à¸²à¸¢ STEM concepts
Quick Decision
| Need | Tool | Script |
|---|---|---|
| Physics FBD | Matplotlib | scripts/physics_fbd.py |
| Math plots/geometry | Matplotlib | scripts/math_plots.py |
| Flowcharts | Matplotlib | scripts/flowchart.py |
| Animations (3b1b style) | Manim | scripts/manim_physics.py |
Rule: Static â Matplotlib (fast) | Motion/transform â Manim (powerful)
1. Physics: Free Body Diagrams
from scripts.physics_fbd import draw_inclined_plane_fbd, draw_two_blocks_rope
# Inclined plane with force decomposition
draw_inclined_plane_fbd(mass=4, angle=30, show_components=True)
# Two blocks connected by rope
draw_two_blocks_rope(mass_A=2, mass_B=3, F_pull=10)
Output: PNG in learning-notes/ folder
2. Math: Plots & Geometry
from scripts.math_plots import plot_function, draw_unit_circle, draw_coordinate_plane
import numpy as np
# Function plot
plot_function(lambda x: np.sin(x), x_range=(-2*np.pi, 2*np.pi), title="sin(x)")
# Unit circle with angles
draw_unit_circle(angles_deg=[0, 30, 45, 60, 90])
# Coordinate plane with vectors
draw_coordinate_plane(
vectors=[((0,0), (3,2), "a", "red"), ((0,0), (1,4), "b", "blue")]
)
3. Flowcharts
from scripts.flowchart import draw_simple_flowchart, draw_decision_flowchart
# Linear flow
draw_simple_flowchart([
("Start", "start"),
("Input x", "io"),
("Process", "process"),
("End", "end"),
])
# Decision branching
draw_decision_flowchart(
before_decision=[("Start", "start")],
decision_text="x > 0?",
yes_branch=[("Positive", "process")],
no_branch=[("Negative", "process")],
after_merge=[("End", "end")]
)
4. Animations (Manim)
For 3Blue1Brown-style animations. See references/manim-guide.md for full guide.
Available Scenes in scripts/manim_physics.py
| Scene | Description |
|---|---|
VectorAddition |
Head-to-tail vector addition |
ForcesOnBox |
FBD with motion |
NewtonThirdLaw |
Action-reaction pairs |
InclinedPlane |
Forces on incline with equations |
ProjectileMotion |
Parabolic path with velocity vectors |
CircularMotion |
Centripetal acceleration |
AtwoodIncline |
Pulley system (customizable m1, m2, θ) |
Render Command
# Preview (low quality, fast)
manim -pql scripts/manim_physics.py VectorAddition
# GIF output
manim -ql --format=gif scripts/manim_physics.py VectorAddition
Custom Animation
from manim import *
class MyScene(Scene):
def construct(self):
circle = Circle(color=BLUE)
self.play(Create(circle))
self.play(circle.animate.shift(RIGHT * 2))
5. Function Explainer Visualization
สรà¹à¸²à¸à¸ าà¸à¸à¸à¸´à¸à¸²à¸¢à¸à¸²à¸£à¸à¸³à¸à¸²à¸à¸à¸à¸ Excel/DAX/Power Query functions
Quick Start
# 1. Generate visualization
python3 tools/visualize_function.py excel left 1
# 2. Upload to server (--mkdir creates directory if needed)
python3 tools/ftp_upload.py -f media/function-viz/excel/left-1.png -r wp-content/uploads/function-viz/excel/ --mkdir
# 3. Add image_url to JSON example, then publish
python3 tools/smart_publish.py --slugs left --program excel --allow
Output: media/function-viz/{program}/{slug}-{example_number}.png
Server: https://www.thepexcel.com/wp-content/uploads/function-viz/{program}/{slug}-{example}.png
Supported Functions
| Function | Description |
|---|---|
| LEFT | à¸à¸¶à¸à¸à¸±à¸§à¸à¸±à¸à¸©à¸£à¸à¸²à¸à¸à¹à¸²à¸¢ |
| RIGHT | à¸à¸¶à¸à¸à¸±à¸§à¸à¸±à¸à¸©à¸£à¸à¸²à¸à¸à¸§à¸² |
| MID | à¸à¸¶à¸à¸à¸±à¸§à¸à¸±à¸à¸©à¸£à¸à¸²à¸à¸à¸£à¸à¸à¸¥à¸²à¸ |
| FIND | หาà¸à¸³à¹à¸«à¸à¹à¸à¸à¹à¸à¸à¸§à¸²à¸¡ |
| SUBSTITUTE | à¹à¸à¸à¸à¸µà¹à¸à¹à¸à¸à¸§à¸²à¸¡ |
Workflow
- Generate â
python3 tools/visualize_function.py {program} {slug} {example_num} - Upload â
python3 tools/ftp_upload.py -f {file} -r wp-content/uploads/function-viz/{program}/ --mkdir - Update JSON â à¹à¸à¸´à¹à¸¡
"image_url": "https://..."à¹à¸ example - Publish â
python3 tools/smart_publish.py --slugs {slug} --program {program} --allow
Custom Visualization (Nested Functions)
สำหรัภformula à¸à¸±à¸à¸à¹à¸à¸ à¹à¸à¹à¸ =LEFT(A1, FIND(" ", A1)-1) à¸à¹à¸à¸à¹à¸à¸µà¸¢à¸ script à¹à¸¢à¸:
# à¸à¸¹à¸à¸±à¸§à¸à¸¢à¹à¸²à¸à¸à¸µà¹ media/function-viz/excel/left-5-custom.py
Note: Script หลัà¸à¸£à¸à¸à¸£à¸±à¸ formula à¸à¹à¸²à¸¢à¹ à¸à¸µà¹à¸¡à¸µ string literal à¹à¸à¹à¸²à¸à¸±à¹à¸
Workflow
- Choose tool â Static (Matplotlib) vs Animation (Manim)
- Run script â
python3 scripts/physics_fbd.pyormanim -pql ... - View output â
explorer.exe output.pngor use image viewer
Tip: Use run_in_background=true for viewers to avoid blocking conversation.
Related Skills
/explain-conceptsâ Visualize concepts being taught/thepexcel-brand-guidelinesâ Brand-themed visualizations/pptxâ Embed visualizations in presentations