### Install Dependencies with pnpm
Source: https://github.com/techniq/layerchart/blob/main/README.md
Installs project dependencies using the pnpm package manager. Ensure pnpm is installed globally.
```bash
pnpm i
```
--------------------------------
### Run Dev Server for LayerChart Package
Source: https://github.com/techniq/layerchart/blob/main/README.md
Starts the development server for the layerchart package. Navigate to the package directory before running.
```bash
cd packages/layerchart
pnpm dev
```
--------------------------------
### Install LayerChart
Source: https://context7.com/techniq/layerchart/llms.txt
Install LayerChart using npm or pnpm.
```bash
npm install layerchart
# or
pnpm add layerchart
```
--------------------------------
### Gauge Chart Configuration
Source: https://context7.com/techniq/layerchart/llms.txt
Create a gauge-style arc by providing a single data item and setting `maxValue`. The `range` prop controls the arc's start and end angles in degrees.
```svelte
```
--------------------------------
### Basic Line Chart with Chart Component
Source: https://context7.com/techniq/layerchart/llms.txt
Demonstrates a basic line chart using the root Chart component, Svg, Axis, Grid, Spline, and Highlight components. Requires D3 scale and shape modules.
```svelte
```
--------------------------------
### Add Changeset for Versioning and Changelog
Source: https://github.com/techniq/layerchart/blob/main/README.md
Generates a changeset to record changes for the changelog and determine the next version. Run this before committing changes.
```bash
pnpm changeset
```
--------------------------------
### Force-Directed Graph with ForceSimulation
Source: https://context7.com/techniq/layerchart/llms.txt
Use ForceSimulation to wrap D3's d3-force simulation. It accepts nodes and links arrays and an array of force configurations. The simulation restarts automatically when the data changes.
```svelte
```
--------------------------------
### Create Custom Tooltips with LayerChart Tooltip Primitives
Source: https://context7.com/techniq/layerchart/llms.txt
Utilize the `Tooltip` namespace for composable HTML tooltip primitives like `Root`, `Header`, `List`, `Item`, and `Separator`. Configure positioning with `pointer` or `data` modes and `anchor` prop. The `data` slot prop provides the hovered datum.
```svelte
```
--------------------------------
### Line Chart with Brush Zoom and Custom Tooltip
Source: https://context7.com/techniq/layerchart/llms.txt
Configures the LineChart with brush-based zooming and a custom tooltip format for specific data points.
```svelte
```
--------------------------------
### Stacked Area Chart Configuration
Source: https://context7.com/techniq/layerchart/llms.txt
Use `seriesLayout="stack"` for a standard stacked area chart. Ensure data is provided with appropriate keys for series.
```svelte
```
--------------------------------
### Interactive Pan and Zoom with TransformContext
Source: https://context7.com/techniq/layerchart/llms.txt
Implement pan and zoom functionality using TransformContext. It manages the transform attribute of a element via pointer/touch drag and scroll-wheel zoom. The 'canvas' mode enables interactive behavior.
```svelte
console.log('scale', e.k)}
>
```
--------------------------------
### Donut Chart Configuration
Source: https://context7.com/techniq/layerchart/llms.txt
Configure a donut chart using `PieChart` with `innerRadius` set to a value between 0 and 1. `padAngle` and `cornerRadius` can be used to customize slice appearance.
```svelte
```
--------------------------------
### High-Density Rendering with Canvas
Source: https://context7.com/techniq/layerchart/llms.txt
Use the Canvas component for charts with a large number of data points to improve rendering performance. Swap `