mcpField
S
svelte-layerchart

svelte-layerchart

github.com/spences10Development1670 installsUpdated 15w ago
Repository

About svelte-layerchart

Svelte LayerChart is a skill reference for building charts with LayerChart in Svelte. It documents tooltip patterns, chart context, gradients, and modes for different chart types.

Key features

  1. 01Svelte chart setup guidance
  2. 02Snippet-based tooltip patterns
  3. 03Chart context and gradient snippets
  4. 04Tooltip modes for chart types
  5. 05References for chart and graph patterns

Use cases

  1. 01Add tooltips to bar charts
  2. 02Show nearest-x values on time-series charts
  3. 03Build scatter plot tooltips
  4. 04Reference area, pie, calendar, and graph examples

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/spences10/skills --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