Token导航 LogoToken导航TokenDH.com
前端设计需要联网github未标认证来源可访问clear审计通过

layerchartlayerchart 前端

Agent Skill

用于辅助前端页面、组件、样式和交互逻辑的开发与维护。它适合让 Agent 生成或审查 React、Next.js、Vue、Tailwind、CSS 等相关代码,整理组件结构,或定位布局和性能问题。使用时需要结合项目现有设计系统、路由和构建方式,避免只生成孤立片段;涉及页面改动时,应配合本地预览和构建检查确认视觉效果。

总安装

380

周安装

16

GitHub Stars

4

下载量

133
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:layerchart(layerchart 前端)
来源仓库:https://github.com/linehaul-ai/linehaulai-claude-marketplace
仓库路径:skills/layerchart
安装命令:
npx skills add https://github.com/linehaul-ai/linehaulai-claude-marketplace --skill layerchart
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/linehaul-ai/linehaulai-claude-marketplace --skill layerchart

简介

layerchart 用于辅助前端页面、组件、样式和交互逻辑的开发与维护。

  • 适合生成或审查 React、Next.js、Vue 等相关代码,整理组件结构或定位布局问题。
  • 使用时需结合项目现有设计系统、路由和构建方式,避免生成孤立片段。
  • 涉及页面改动时,应配合本地预览和构建检查确认视觉效果。
  • 安装前建议确认权限范围和维护状态,注意可能触发文件读写操作。

SKILL.md

LayerChart Skill

LayerChart is a comprehensive Svelte visualization framework built on Layer Cake, providing composable components for creating responsive, interactive charts across multiple visualization types.

Core Architecture

LayerChart operates on a component-based, data-driven philosophy. The library provides three primary categories of components:

Data-Driven Components render visual marks directly from data (Area, Bars, Spline, Pie, Sunburst, Treemap, Sankey, etc.). These components automatically handle scale transformations through LayerCake's context.

Motion-Enabled SVG Primitives (Rect, Circle, Arc, Group, Line, Path) provide low-level drawing utilities with built-in Svelte transition support for animated data updates.

Utility Components handle legends, tooltips, pan/zoom interactions, annotations, and layout operations (hierarchy, geo projections).

Visualization Types

  • Cartesian: Bar, Area, Stack, Scatter, Histogram, ClevelandDotPlot, BarStack, BarGroup
  • Radial: Pie, Arc, Sunburst, Threshold
  • Hierarchical: Pack, Tree, Treemap, Partition
  • Graph: Sankey, Link, Graph utilities
  • Geographic: Choropleth, Spike Map, Bubble Map, GeoTile, GeoPath, StateMap, AnimatedGlobe, Globe projections (Mercator, Azimuthal, Equal Earth, etc.)

Key Patterns

Data Preparation

Use LayerChart's data transformation utilities before passing to visualizations:

  • stack() - converts wide-format data into stacked series with baseline/top values
  • bin() - groups data into histogram bins with x0/x1 bounds
  • groupLonger() - pivots wide-format to long-format (one row per value)
  • flatten() - flattens nested arrays one level, with optional accessor
  • calcExtents() - calculates min/max across multiple fields, skipping nulls

Component Composition

All LayerChart visualizations sit within a LayerCake wrapper that establishes scales and context. Child components access scales via Svelte's context API.

<LayerCake x="date" y="value" data={data} padding={{...}}>
  <Svg>
    <Area />
    <Line />
    <AxisX />
  </Svg>
  <Canvas>
    <Points />  <!-- High-performance canvas rendering -->
  </Canvas>
  <Html>
    <Tooltip />
  </Html>
</LayerCake>

Interaction Patterns

  • Tooltips: Position over data with snap-to-data options
  • Pan/Zoom: Built-in context utilities for interactive navigation
  • Highlighting: Hover states trigger visual emphasis (opacity, stroke changes)
  • Selection: Use reactive variables and event handlers for interactive filtering

Responsive Design

LayerChart automatically handles responsive layouts via padding configuration and container dimensions. Components reactively update when data or scales change.

Common Implementation Tasks

Bar Charts: Use Bars component with x as categorical field. Stack with BarStack or group with BarGroup for multi-series.

Time Series: Configure xScale={scaleTime()} with temporal data. Use AxisX with tickFormat for readable date labels.

Geographic Visualizations: Select appropriate projection (Mercator for web maps, Azimuthal for polar), use GeoPath for boundaries, Choropleth for value mapping.

High-Volume Data: Render marks via Canvas instead of SVG for 5000+ points. Layer SVG axes/legends with Canvas for hybrid rendering.

Stacked/Grouped Series: Use stack() utility to transform data, then render via AreaStack/BarStack components.

Performance Considerations

  • Canvas rendering for 5000+ points (~60fps on modern hardware)
  • SVG for interactive elements and animations (<500 points recommended)
  • Hybrid approach: Canvas for marks + SVG for axes/legends
  • Scale calculations are reactive—only update scales when data/domain changes
  • Memoize expensive data transforms outside component lifecycle

Styling and Customization

All primitive components support standard SVG/Canvas attributes (stroke, fill, opacity, strokeWidth). Use Svelte's reactive statements for conditional styling based on interaction state or data values.

Gradient fills, patterns, and clipping available via ClipPath, RectClipPath, CircleClipPath components with SVG <defs>.

Integration Notes

  • Works seamlessly with D3 scales (linear, time, ordinal, log, threshold)
  • Supports multiple render contexts in same chart (SVG + Canvas + HTML)
  • Fully accessible with ARIA attributes on SVG elements
  • SSR-compatible for server-side rendering in SvelteKit
  • Zero external dependencies beyond Svelte and d3-array utilities

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Claude Code

29.04%
按下载量换算39

Gemini CLI

21.22%
按下载量换算28

Antigravity

17.96%
按下载量换算24

windsurf

11.86%
按下载量换算16

Codex

7.13%
按下载量换算9

OpenCode

3.16%
按下载量换算4

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。

来源信息

继续浏览同类 Skills