layercake

Manage coordinate systems and scales for Svelte visualizations across SVG, Canvas, and HTML.

4|Updated Dec 13, 2025
One-click install
npx skills add https://github.com/linehaul-ai/linehaulai-claude-marketplace --skill layercake
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: layercake
Source: https://github.com/linehaul-ai/linehaulai-claude-marketplace/tree/main/.claude-plugin/layercake/skills/layercake
Command: npx skills add https://github.com/linehaul-ai/linehaulai-claude-marketplace --skill layercake

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides an expert guide to Layer Cake, a headless Svelte visualization framework that manages the complex mathematics of coordinate systems, scales, and dimensions, allowing you to build responsive data visualizations without being constrained by opinionated visual components.

Core Features & Use Cases

  • Headless Visualization Core: Handles scales (D3 linear, time, ordinal), dimensions, and data flow, making them available via Svelte's context API.
  • Multi-Context Rendering: Supports SVG for interactivity, Canvas for high-volume data, and HTML for overlays, all within the same coordinate system.
  • Data Transformation Utilities: Includes functions like stack(), bin(), groupLonger(), and calcExtents() to prepare your data for various chart types.
  • Responsive Design: Automatically adjusts scales and layouts as container dimensions change, ensuring your visualizations look great on any screen.
  • Use Case: Create a custom time series chart that displays 10,000+ data points using Canvas for performance, while overlaying interactive SVG axes and HTML tooltips for a rich user experience.

Quick Start

Use the layercake skill to set up a basic Layer Cake chart with X and Y scales for my data, using x="date" and y="value".

Frequently Asked Questions about layercake

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I build responsive data visualizations with Svelte and Canvas?

Layer Cake is a headless Svelte framework that manages scales, dimensions, and coordinate systems automatically. It supports Canvas for high-volume data, SVG for interactivity, and HTML overlays—all sharing the same coordinate space—enabling responsive charts that adapt to container changes without opinionated component constraints.

Can I render 10,000+ data points efficiently in a Svelte chart?

Yes. Layer Cake uses Canvas rendering for performance-critical visualizations with high data volume. You layer Canvas for the dataset, SVG for interactive axes, and HTML for tooltips within a unified coordinate system, handling device pixel ratio automatically for sharp rendering.

What scales and data transforms does Layer Cake support?

Layer Cake provides D3 scale types—linear, time, ordinal, logarithmic, and threshold—plus data utilities including stack(), bin(), groupLonger(), and calcExtents(). Scales derive domains and ranges from data automatically or accept explicit configuration for time series, histograms, stacked, and scatter plot charts.

Do I need to manage coordinate systems separately for SVG, Canvas, and HTML?

No. Layer Cake distributes scales (xScale$, yScale$, rScale$) via Svelte context, so all rendering contexts—SVG, Canvas, HTML—share identical coordinate transformations. You write responsive layouts once and apply them across all output formats without recalculation.

How does Layer Cake handle responsive chart layouts?

Layer Cake automatically recalculates scales and dimensions when container size changes. Reactive Svelte stores trigger updates across all rendering layers, ensuring padding, domain ranges, and visual output stay synchronized without manual breakpoint logic.

Is Layer Cake suitable for time series and histogram visualization?

Yes. Layer Cake's time scales, stacking utilities, binning functions, and multi-context rendering make it well-suited for time series with 10,000+ points, histograms with grouped data, and complex overlaid charts combining Canvas performance with SVG interactivity.