Skip to content
Skills Library
Data & analytics · Building & coding

observable-plot

/observable-plot

Guide for using Observable Plot, a JavaScript library for exploratory data visualization built on D3. Use this skill when creating charts, exploring data, or building visualizations with marks, scales, and transforms.

Repository
fabrik ↗
Licence
MIT
Last repository change
27.10.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
49
Scripts
0
HTML comments
0
URLs in SKILL.md
4
Deprecation

No signals detected. Repository changed on 27.10.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

Guide for using Observable Plot, a JavaScript library for exploratory data visualization built on D3. Use this skill when creating charts, exploring data, or building visualizations with marks, scales, and transforms.

Original author description

Guide for using Observable Plot, a JavaScript library for exploratory data visualization built on D3. Use this skill when creating charts, exploring data, or building visualizations with marks, scales, and transforms.

How it works

  1. Installation
  2. Core Concepts
  3. Quick Examples
  4. Documentation Files
  5. Common Patterns
  6. Framework Integration
  7. Resources
Original SKILL.md headings · 233 lines, 752 words
SKILL.md preview
---
name: observable-plot
description: Guide for using Observable Plot, a JavaScript library for exploratory data visualization built on D3. Use this skill when creating charts, exploring data, or building visualizations with marks, scales, and transforms.
license: MIT
---

# Observable Plot

Observable Plot is a JavaScript library for exploratory data visualization. It's built on D3 and provides a concise, declarative API for creating charts.

## Installation

```bash
npm install @observablehq/plot
```

Or via CDN:
```html
<script type="module">
import * as Plot from "https://cdn.jsdelivr.net/npm/@observablehq/plot@0.6/+esm";
</script>
```

## Core Concepts

### Plot.plot(options)

The main function that renders a visualization. Returns an SVG or HTML figure element.

```javascript
Plot.plot({
  marks: [
    Plot.dot(data, {x: "weight", y: "height"})
  ]
})
```

### Key Options

| Option | Description | Default |
|--------|-------------|---------|
| `width` | Outer width in pixels | 640 |
| `height` | Outer height in pixels | auto |
| `margin` | All margins | varies |
| `marginTop/Right/Bottom/Left` | Individual margins | varies |
| `marks` | Array of marks to render | required |
| `color` | Color scale options | auto |
| `x`, `y` | Position scale options | auto |
| `title`, `subtitle` | Chart titles | none |
| `caption` | Figure caption | none |

### Data Format

Plot expects tabular data as arrays of objects:

```javascript
const data = [
  {date: new Date("2024-01-01"), value: 100, category: "A"},
  {date: new Date("2024-01-02"), value: 120, category: "B"}
];
```

### Channel Mapping

Map data columns to visual properties:

```javascript
Plot.dot(data, {
  x: "date",        // column name
  y: "value",       // column name
  fill: "category", // color by category
  r: 5              // constant radius
})
```

## Quick Examples

### Line Chart
```javascript
Plot.lineY(data, {x: "date", y: "value"}).plot()
```

### Bar Chart
```javascript
Plot.barY(data, {x: "category", y: "value"}).plot()
```

### Scatter Plot
```javascript
Plot.dot(data, {x: "weight", y: "height", fill: "species"}).plot()
```

### Histogram
```javascript
Plot.rectY(data, Plot.binX({y: "count"}, {x: "value"})).plot()
```

### Area Chart
```javascript
Plot.areaY(data, {x: "date", y: "value", fill: "steelblue"}).plot()
```

## Documentation Files

This skill includes detailed documentation for each feature:

### Marks (Visual Elements)
- `marks/area.md` - Area charts and stacked areas
- `marks/bar.md` - Bar charts (horizontal and vertical)
- `marks/dot.md` - Scatter plots and bubble charts
- `marks/line.md` - Line charts
- `marks/rect.md` - Rectangles, histograms, heatmaps
- `marks/text.md` - Text labels and annotations
- `marks/rule.md` - Reference lines
- `marks/cell.md` - Heatmaps with ordinal dimensions
- `marks/tip.md` - Interactive tooltips
- `marks/axis.md` - Custom axes
- `marks/geo.md` - Geographic/map visualizations
- `marks/link.md` - Connections between points
- `marks/arrow.md` - Directed arrows
- `marks/vector.md` - Vector fields
- `marks/tick.md` - Tick marks
- `marks/box.md` - Box plots
- `marks/frame.md` - Frame decoration
- `marks/image.md` - Image glyphs
- `marks/contour.md` - Contour plots
- `marks/density.md` - Density estimation
- `marks/raster.md` - Raster/heatmap images
- `marks/hexgrid.md` - Hexagonal grids
- `marks/waffle.md` - Waffle charts
- `marks/delaunay.md` - Voronoi and Delaunay
- `marks/bollinger.md` - Bollinger bands
- `marks/difference.md` - Difference charts
- `marks/tree.md` - Hierarchical trees
- `marks/auto.md` - Automatic mark selection
- `marks/linear-regression.md` - Trend lines
- `marks/crosshair.md` - Interactive crosshairs
- `marks/grid.md` - Grid lines

### Transforms (Data Processing)
- `transforms/bin.md` - Binning for histograms
- `transforms/group.md` - Grouping categorical data
- `transforms/stack.md` - Stacking for area/bar charts
- `transforms/dodge.md` - Beeswarm plots
- `transforms/hexbin.md` - Hexagonal binning
- `transforms/window.md` - Moving averages
- `transforms/select.md` - Selecting specific points
- `transforms/normalize.md` - Normalizing values

### Features
- `features/scales.md` - Scale configuration
- `features/facets.md` - Small multiples
- `features/projections.md` - Map projections
- `features/legends.md` - Legend configuration
- `features/interactions.md` - Interactive features
- `features/curves.md` - Line interpolation
- `features/markers.md` - Line markers
- `features/shorthand.md` - Concise syntax
- `features/intervals.md` - Time intervals

## Common Patterns

### Adding a Grid
```javascript
Plot.plot({
  y: {grid: true},
  marks: [Plot.line(data, {x: "date", y: "value"})]
})
```

### Color Legend
```javascript
Plot.plot({
  color: {legend: true},
  marks: [Plot.dot(data, {x: "x", y: "y", fill: "category"})]
})
```

### Faceting (Small Multiples)
```javascript
Plot.plot({
  facet: {data, x: "region"},
  marks: [Plot.dot(data, {x: "income", y: "lifeExpectancy"})]
})
```

### Interactive Tooltips
```javascript
Plot.plot({
  marks: [
    Plot.dot(data, {x: "x", y: "y", tip: true})
  ]
})
```

### Stacked Area Chart
```javascript
Plot.plot({
  marks: [
    Plot.areaY(data, {x: "date", y: "value", fill: "category"})
  ]
})
```

## Framework Integration

### React
```jsx
import * as Plot from "@observablehq/plot";
import { useRef, useEffect } from "react";

function Chart({ data }) {
  const ref = useRef();
  useEffect(() => {
    const plot = Plot.plot({
      marks: [Plot.dot(data, {x: "x", y: "y"})]
    });
    ref.current.append(plot);
    return () => plot.remove();
  }, [data]);
  return <div ref={ref} />;
}
```

### Vanilla JS
```javascript
const plot = Plot.plot({
  marks: [Plot.dot(data, {x: "x", y: "y"})]
});
document.body.append(plot);
```

## Resources

- [Official Documentation](https://observablehq.com/plot/)
- [Examples Gallery](https://observablehq.com/@observablehq/plot-gallery)
- [GitHub Repository](https://github.com/observablehq/plot)
Files in this package (49)
  • SKILL.md 6 KB
  • features/curves.md 3 KB
  • features/facets.md 3 KB
  • features/interactions.md 3 KB
  • features/intervals.md 3 KB
  • features/legends.md 3 KB
  • features/markers.md 2 KB
  • features/projections.md 3 KB
  • features/scales.md 3 KB
  • features/shorthand.md 2 KB
  • marks/area.md 2 KB
  • marks/arrow.md 2 KB
  • marks/auto.md 2 KB
  • marks/axis.md 3 KB
  • marks/bar.md 2 KB
  • marks/bollinger.md 2 KB
  • marks/box.md 2 KB
  • marks/cell.md 2 KB
  • marks/contour.md 3 KB
  • marks/crosshair.md 2 KB
  • marks/delaunay.md 3 KB
  • marks/density.md 2 KB
  • marks/difference.md 2 KB
  • marks/dot.md 2 KB
  • marks/frame.md 2 KB
  • marks/geo.md 3 KB
  • marks/grid.md 2 KB
  • marks/hexgrid.md 1 KB
  • marks/image.md 2 KB
  • marks/line.md 2 KB
  • marks/linear-regression.md 2 KB
  • marks/link.md 2 KB
  • marks/raster.md 2 KB
  • marks/rect.md 2 KB
  • marks/rule.md 2 KB
  • marks/text.md 2 KB
  • marks/tick.md 2 KB
  • marks/tip.md 3 KB
  • marks/tree.md 2 KB
  • marks/vector.md 2 KB
  • marks/waffle.md 2 KB
  • transforms/bin.md 3 KB
  • transforms/dodge.md 2 KB
  • transforms/group.md 3 KB
  • transforms/hexbin.md 2 KB
  • transforms/normalize.md 2 KB
  • transforms/select.md 3 KB
  • transforms/stack.md 2 KB
  • transforms/window.md 3 KB

Versions

The database has no other skills named observable-plot.

Database snapshot: 13.11.2026 · package version f24be7b1b49a (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100creating-data-visualizations
    Generate plots, charts, and graphs from data with automatic visualization type selection. Use when requesting "visualization", "plot", "chart", or "graph". Trigger with phrases like ''generate'', ''create'', or ''scaffold''.
  • 100creating-data-visualizations
    Generate plots, charts, and graphs from data with automatic visualization type selection. Use when requesting "visualization", "plot", "chart", or "graph". Trigger with phrases like 'generate', 'create', or 'scaffold'.
  • 90local-grammar-of-graphics-and-declarative-visualizatio-5e0feec0
    Build data visualizations with declarative grammars. Use when the user needs Vega-Lite, Vega, Observable Plot, or grammar-of-graphics reasoning, especially for tabular charts that do not require bespoke rendering.
  • 90plot-recon
    Audit existing visualizations in a codebase or notebook — find misleading charts and quality issues. Use when asked to "audit our charts", "find misleading visualizations", or "review chart quality".
  • 90plot-chart
    Design or critique a data visualization — chart type selection, encoding, and clarity. Use when asked "what chart should I use", "critique this visualization", or "design this chart".
  • 100visualizations
    Use ONLY when the user explicitly asks to see, show, graph, visualize, chart, or plot data, or when another loaded Datadog data-domain skill directs you to visualization guidance. This is the plugin's local copy of the `datadog/visualizations` server skill; prefer it over…

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.