mcpField
S
svelte-layerchart

svelte-layerchart

github.com/spences10Development94103 installsUpdated 2w ago
Repository

About svelte-layerchart

Svelte LayerChart is a charting library for Svelte developers, documented through usage patterns for chart snippets and tooltips. Its references cover common chart types as well as graph interactions such as zoom and pan.

Key features

  1. 01Svelte charting library
  2. 02Snippet-based tooltip and chart context
  3. 03Band and bisect-x tooltip modes
  4. 04Quadtree modes for area and scatter plots
  5. 05References for area, bar, pie, and calendar charts
  6. 06ForceGraph zoom and pan patterns

Use cases

  1. 01Building bar charts with band tooltips
  2. 02Showing values on time-series charts
  3. 03Creating scatter plot tooltips
  4. 04Adding zoom and pan to graph views

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/spences10/svelte-skills-kit --skill svelte-layerchart

After installing, type/svelte-layerchartin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

references/
full-patterns.md
graph-patterns.md
tooltip-modes.md

Details

From the project README

Svelte LayerChart

Docs: layerchart.com

Install

npm i layerchart d3-scale

Quick Start

<Chart {data} x="date" y="value" tooltip={{ mode: 'bisect-x' }}>
	<Svg><Area class="fill-primary/20" /><Highlight points /></Svg>
	<Tooltip.Root>{#snippet children({ data })}{data.value}{/snippet}</Tooltip.Root>
</Chart>

Core Patterns

  • Tooltip: {#snippet children({ data })} - NOT let:data
  • Chart context: {#snippet children({ context })}
  • Gradient: {#snippet children({ gradient })}
  • Enable tooltip: tooltip={{ mode: 'band' | 'bisect-x' }}
  • Type data: {#snippet children({ data }: { data: MyType })}

Tooltip Modes

ModeUse Case
bandBar charts (scaleBand)
bisect-xTime-series area/line
quadtree-xArea (nearest x)
quadtreeScatter plots

References

Comments

Markdown supported