Communitygithub.com

YepAPI/skills

使用 Recharts 與 Chart.js 進行資料視覺化 — 長條圖、折線圖、面積圖、圓餅圖。

skills 是什麼?

這個技能專注於在 React 專案中使用 Recharts 與 Chart.js 進行資料視覺化。它提供清晰的準則,確保圖表易於存取、響應式且資訊明確,例如使用色彩安全色板、正確標示軸標籤、於懸停時顯示工具提示數值,以及處理載入狀態。該技能也明確指出應避免的常見錯誤,例如使用 3D 圖表、圓餅圖切片過多,或在圖表元件內直接擷取資料。它支援 React 專案,並強調透過父層元件傳遞資料,以保持元件純粹與可測試性。遵循這些規則,開發者能更有效率地建立既美觀又專業的資料圖表。

相容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/YepAPI/skills/tree/HEAD/skills/charts

在你喜歡的 AI 中提問

開啟一個已預先載入此 Agent Skill 的新對話。

說明文件

圖表與資料視覺化

規則

  • 在 React 專案中使用 Recharts — 可組合、響應式、型別完善
  • 將圖表包裹在 <ResponsiveContainer width="100%" height={300}> 中 — 絕不使用固定像素寬度
  • 使用可存取的色彩:採用色盲安全色板(不要依賴紅/綠色區別)
  • 軸標籤:務必標示兩個軸,使用可讀的數字格式(1.2K 而非 1200)
  • 工具提示:懸停時顯示確切數值 — 包含單位並使用區域感知數字格式
  • 載入狀態:資料載入時顯示骨架圖表形狀
  • 根據資料選擇圖表類型:折線圖(隨時間的趨勢)、長條圖(比較)、面積圖(數量)、圓餅圖(部分佔整體 — 最多 5 個扇形)
  • 在動態資料上使用 key prop — 確保 Recharts 在資料變更時正確重新渲染

應避免

  • 3D 圖表 — 它們會扭曲感知,一律使用平面/2D
  • 超過 5-6 個扇形的圓餅圖 — 改用水平長條圖
  • 缺少軸標籤或圖例的圖表 — 務必提供上下文
  • 在圖表元件內擷取資料 — 應在父層元件擷取,並以 props 傳遞

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

YepAPI/skills

WCAG 2.1 AA — semantic HTML, keyboard navigation, screen readers.

YepAPI/skills

Experiment setup, variant splitting, statistical significance, and feature flag integration.

YepAPI/skills

CRUD generators, data tables, user management, role-based access, and bulk operations.

YepAPI/skills

Monitor what ChatGPT and Gemini say about your brand using YepAPI.

YepAPI/skills

Queue workers with BullMQ/Inngest/Trigger.dev, job retries, dead letter queues, concurrency.

YepAPI/skills

Commander.js, interactive prompts with Clack, spinners, colors, config files, exit codes, and npm publishing.

YepAPI/skills

cmdk integration, Cmd+K trigger, fuzzy search, grouped actions, keyboard navigation, and dynamic action registration.

YepAPI/skills

Content planning with trend and sentiment data from YepAPI.

YepAPI/skills

Content calendar, keyword-driven planning, and content briefs.

YepAPI/skills

Theme switching with CSS variables, system preference detection, next-themes, and persistence.

YepAPI/skills

Threaded comments, @mentions, reactions, moderation queue, optimistic UI, and cursor pagination.

YepAPI/skills

Competitive analysis between domains using YepAPI.

YepAPI/skills

Layout grids, KPI cards, data tables with sorting/filtering, sidebar navigation, and responsive breakpoints.

YepAPI/skills

Data encryption — TLS everywhere, AES-256-GCM for PII, bcrypt passwords, encrypted backups.

YepAPI/skills

Chart patterns with Recharts/Nivo/D3, responsive containers, color scales, and accessibility.

YepAPI/skills

Drizzle schema definition, push vs migrate, type-safe queries, relations, transactions, and prepared statements.

YepAPI/skills

Upload handling, resize/compress, CDN delivery, blur placeholders, and next/image patterns.

YepAPI/skills

Local business and Google Maps research using YepAPI.

YepAPI/skills

Cursor-based pagination, IntersectionObserver, virtualized lists with @tanstack/react-virtual, and scroll position restoration.

YepAPI/skills

Chat UI components, streaming responses with AI SDK, context window management, and RAG patterns.

相關技能