martin65536/liquid-glass-webgl/charts
Claude Code and agent skill by martin65536/liquid-glass-webgl
- community
Checking that the SKILL.md file is still in the repository.
Professional chart and diagram creation skill. Covers all types of visual data representation and structural diagrams: - **Data charts**: bar charts, line charts, pie charts, scatter plots, heatmaps, radar charts, candlestick charts, boxplots, histograms, area charts, waterfall charts, regression plots, distribution plots, and statistical visualizations. - **Structural diagrams**: flowcharts, mind maps, tree diagrams, org charts, architecture diagrams, network/relationship graphs, ER diagrams, class diagrams, Gantt charts, swimlane diagrams, and sequence diagrams. - **Dashboards**: data dashboards, KPI panels, multi-chart compositions, and interactive visualizations. - **Design quality**: professional color systems, anti-overlap rules, layout optimization, scene-based framework routing (matplotlib, seaborn, ECharts, D3.js, Mermaid, Playwright+CSS), and publication-ready output. Applies when the user wants to create, generate, draw, plot, visualize, or improve any chart, graph, diagram, or dashboard. Also applies when the user asks for something more polished, cleaner, or publication-ready. NOT for: PDF document layout (use pdf skill), slide decks (use slides skill), spreadsheets with embedded charts (use xlsx skill), AI image generation (use image_gen), posters / infographics / creative cards (use pdf skill Creative pipeline). FORBIDDEN: Using matplotlib/seaborn to draw mind maps, tree diagrams, org charts, flowcharts, or any structural diagram. These MUST use Playwright+CSS.
Install
npx vskill@latest install martin65536/liquid-glass-webgl/chartsSKILL.md
Beautiful Charts
Quick Setup
Make every chart and diagram look professionally designed, not AI-generated.
Architecture
| Module | File | When to Load | |
|---|---|---|---|
| Routing + Core Rules | This file | Always read first | |
| Framework Templates | references/ by framework | After choosing framework, read the corresponding file |
Loading order: Read this file → choose framework → read template file → start coding.
Each template file contains its own framework-specific rules (spacing, connectors, color details). This file contains only routing decisions and universal rules that apply to ALL charts.
Part 1: Routing
⚠️ Format Constraint Rule (HIGHEST PRIORITY)
When the user specifies an output format/tool, you MUST comply. Never substitute.
| User Says | You Must Do | Forbidden | |
|---|---|---|---|
| "use mermaid code" / "用Mermaid格式输出" / "转化为mermaid" / "mermaid流程" | ① Output Mermaid code block (``mermaid ... ``) ② Also provide a rendered image preview | ❌ Cannot only give image without code; ❌ Cannot screenshot raw code text as image | |
| "use markdown code" | Output markdown-formatted hierarchy | ❌ Cannot switch to HTML/CSS | |
| "via mermaid or markdown code" | Choose one of the two, output code text | ❌ Cannot switch to any non-specified format | |
| "flowchart" / "mind map" (no format specified) | Free to choose the best approach | - | |
| "use echarts/d3" | Must use the specified framework | ❌ Cannot switch |
🚫 FORBIDDEN: Mermaid Code Screenshot
NEVER take a screenshot of raw Mermaid source code and deliver it as the "diagram image". This is the worst possible outcome — the user gets neither usable code nor a visual diagram. When the user requests Mermaid format:
- MUST output the Mermaid code in a fenced code block (```
mermaid) - SHOULD also render the code into a visual diagram image (via mermaid-cli or Playwright + mermaid.js)
- If rendering fails, deliver the code block and tell the user to paste it into mermaid.live
Format Specified vs Auto-Upgrade Conflict
When the user specifies Mermaid but content triggers auto-upgrade conditions (>8 nodes, CJK-heavy, etc.):
- User choice wins — still use Mermaid, deliver code block + rendered image
- Proactively guide — after delivery, suggest the user try without specifying Mermaid for better layout quality
- Never silently switch to Playwright+CSS when user explicitly asked for Mermaid
When a specified tool hits rendering difficulties (e.g., mermaid CDN fails):
- ✅ Output raw mermaid code text, tell user to view at mermaid.live
- ❌ Secretly switch to another framework
- ❌ Screenshot the code text as an "image"
Routing Decision Tree
1. Structural Diagrams
🔴 Flowchart Default: Phased Vertical (HIGHEST PRIORITY)
When the user asks to "generate/create a XXX flowchart/流程图" without specifying format, the DEFAULT layout is Phased Vertical (Layout C in `references/playwright-css.md`).
This is because nearly all real-world processes (manufacturing, legal proceedings, project management, business operations, cooking recipes, etc.) have natural phases/stages. Layout C produces the most professional, readable result.
Flowchart routing priority:
- User specified Mermaid/markdown → follow user choice (Format Constraint Rule)
- ≤6 nodes AND no phases AND short text → Mermaid (simple flowchart)
- Everything else → Playwright + CSS, Layout C (Phased Vertical) →
references/playwright-css.md
Phase detection — treat as "has phases" when ANY is true:
- Content has numbered sections (一、二、三 or 1. 2. 3. or Phase 1/Stage 1)
- Process can be grouped by time/stage/role (e.g., "preparation → execution → review")
- Total steps ≥ 5 (almost always groupable into 2+ phases)
- Process involves multiple roles/departments
- Process has clear start/end with intermediate stages
⚠️ When in doubt, default to Layout C. A phased layout with only 1 phase still looks professional. A Grid layout with phases looks like a mess.
Other Structural Diagrams
- Simple flowchart (≤6 nodes, truly flat, no phases): Mermaid
- Complex flowchart (>6 nodes / CJK-heavy / branches / phases): Playwright + CSS Layout C →
references/playwright-css.md - Mind map / tree / org chart: Playwright + CSS →
references/mindmap-css.md - Relationship / network diagram: ECharts graph
- Center-radial analysis (SWOT / BSC / Porter's Five Forces / PEST): Playwright + CSS →
references/radial-grid.md
2. Data Charts (matplotlib / seaborn)
- Standard bar/line/scatter/heatmap/radar/pie: matplotlib
- Regression/distribution/boxplot: Seaborn
3. Interactive Charts / Dashboards
- Data dashboard / candlestick / real-time: ECharts
- Fully custom interactive: D3.js
Default Strategy
One scene, one tool — don't hesitate:
| Scene | Tool | Template | |
|---|---|---|---|
| Data chart (bar/line/scatter/pie/radar) | matplotlib | references/matplotlib.md | |
| Statistical (regression/box/dist) | Seaborn | references/seaborn.md | |
| Mind map / tree / org chart | Playwright + CSS | references/mindmap-css.md | |
| Center-radial (SWOT/BSC/PEST/Five Forces) | Playwright + CSS | references/radial-grid.md | |
| Any flowchart (default) | Playwright + CSS Layout C | `references/playwright-css.md` | |
| Simple flowchart (≤6 nodes, truly flat) | Mermaid | references/mermaid.md | |
| Relationship / force-directed | ECharts graph | references/echarts.md | |
| Data dashboard | ECharts | references/echarts.md | |
| Academic paper figures | matplotlib | references/matplotlib.md |
Mermaid Auto-Upgrade Rules
Mermaid's dagre/elk layout estimates CJK widths incorrectly. Auto-switch to Playwright+CSS when ANY condition is met:
| Trigger | Action | |
|---|---|---|
| Total nodes > 6 | → CSS flowchart (Layout C) | |
| Any node text > 12 Chinese characters | → CSS flowchart | |
| More than 3 parallel branches | → CSS flowchart | |
| Nested subgraphs > 2 levels | → CSS flowchart | |
| Connector crossings > 2 | → CSS flowchart | |
| Side annotations / dashed note boxes | → CSS flowchart | |
| Loop-back / cycle arrows | → CSS flowchart | |
| Process has identifiable phases/stages | → CSS flowchart (Layout C) |
If staying with Mermaid: padding: 32, nodeSpacing: 80, rankSpacing: 80. Node text ≤ 10 CJK chars/line, wrap with <br>, quote all text A["text"].
Large Dataset Rendering
| Data Size | Approach | |
|---|---|---|
| < 1,000 points | matplotlib / any | |
| 1,000 - 10,000 | matplotlib (no markers) or ECharts | |
| 10,000 - 100,000 | ECharts (Canvas mode) | |
| > 100,000 | ECharts (large: true) or WebGL |
Part 2: Universal Rules
These rules apply to ALL charts regardless of framework. Framework-specific rules live in each template file.
7 Core Rules
- Zero overlap. No element may cover another's text. Overlap = information loss = task failure. Post-generation: verify every element has clear separation.
- Hierarchy over uniformity. Primary nodes larger/bolder than secondary. Annotation nodes smaller/muted. Spacing between groups > within groups. If every box looks identical, the layout has failed.
- Low-saturation palette. 70% background/neutral, 20% secondary, 10% accent (one highlight only). No high-saturation large fills. Saturated colors only on borders (2px), text, and small elements.
- Insight first. Titles express conclusions, not field names. Remove non-essential elements: top/right borders, grid lines, tick marks, legend box borders. If removing it doesn't reduce understanding, it shouldn't exist.
- Label clarity over label method. The goal is zero overlap — choose the method that achieves it for each chart type. Direct labels, legends, and leader lines are all valid; what matters is that nothing overlaps.
🚫 FORBIDDEN: Any Text Overlapping Any Other Element
No label, legend, annotation, or title may overlap any other visual element. This is the single most common matplotlib defect. Both direct labels AND legends can cause overlap — neither is inherently safe.
Anti-overlap decision tree:
- Check if direct labels fit — if all labels have enough space (bar tops, line endpoints, large pie slices), label directly. No legend needed.
- If some labels would collide (small pie slices, dense scatter points, clustered bars) → use legend outside plot area instead of forcing labels into tight spaces.
- Mixed approach — label the major items directly, group small items into "其他" or use leader lines + legend for the small ones.
Pie chart specific (the worst offender):
- Slices < 5%: MUST use leader lines (
wedgeprops + textsmanual repositioning, ormatplotlib.patches.ConnectionPatch) to pull labels outside. Do NOT rely onautopctalone — it places text inside/near the slice. - Multiple small adjacent slices: use
bbox_to_anchorlegend outside, NOT direct labels labeldistance=1.25minimum to keep labels outside the pie- When >2 slices are < 5%, consider grouping all < 3% into "其他(X项)"
- Use
adjustTextlibrary to auto-resolve label collisions when available
Legend placement (when legend is needed):
- Place legend outside the plot area using
bbox_to_anchor - Suggested starting positions:
- Bar/line/scatter: right side outside (
bbox_to_anchor=(1.02, 1), loc='upper left') - Pie: right side outside (
bbox_to_anchor=(1.1, 0.5), loc='center left') - Radar: below chart (
bbox_to_anchor=(0.5, -0.15), loc='upper center') - Heatmap: no legend needed (colorbar suffices)
🔧 Mandatory: auto-adjust legend to prevent overlap. Copy this snippet after placing any legend:
- After placing legend: always call
plt.tight_layout()orfig.subplots_adjust()to ensure legend is not clipped
🚫 FORBIDDEN:
loc='best'— matplotlib's "best" frequently overlaps dataloc='upper right'/loc='lower right'on line/bar charts — high collision risk- Direct labels on pie slices < 5% without leader lines
- Any text placement without verifying zero overlap
- Font discipline. Max 2 fonts. Chinese: SimHei/PingFang SC. Always explicitly set fonts in code. Font size follows hierarchy (title 18-24px → body 13-15px → annotation 11-13px). Never go below 10px floor. When text overflows: condense text → enlarge canvas → last resort: shrink font (but never below floor).
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/charts/SKILL.md
Popularity
- Repository stars
- 70
- Repository forks
- 6
- 7-day trend score
- 21
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/martin65536/liquid-glass-webgl/charts)