Skip to content
Back to skills

D3

ASecurity

Learn how to use D3.js with Helios for data visualization. Use when creating charts, graphs, or data-driven animations.

  • 124 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 5, 2026
ai-agentstypescriptapiperformance

Works with

  • api

Security analysis

A100/100

Scanned November 5, 2026

npx -y skills add BintzGavin/helios --skill d3 --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of D3?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for D3
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/bintzgavin-helios/badge)](https://www.skillsdirectory.com/skills/bintzgavin-helios)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: example-d3-animation
description: Learn how to use D3.js with Helios for data visualization. Use when creating charts, graphs, or data-driven animations.
---

# D3.js Animation

Integrate D3.js with Helios by driving D3 scales and attributes using the Helios frame/time state.

## Quick Start

```typescript
import { Helios } from '@helios-project/core';
import * as d3 from 'd3';

const helios = new Helios({ duration: 5, fps: 60 });
const svg = d3.select('#chart');

// Data
const data = [10, 20, 30, 40, 50];

// Setup D3
const x = d3.scaleLinear().domain([0, 50]).range([0, 500]);
const bars = svg.selectAll('rect').data(data).enter().append('rect')
  .attr('height', 20)
  .attr('y', (d, i) => i * 25);

// Animate
helios.subscribe(({ currentFrame, fps }) => {
  const time = currentFrame / fps;

  // Update D3 attributes based on time
  bars.attr('width', d => x(d) * Math.min(1, time));
});
```

## Key Patterns

### Frame-Driven Scales
Instead of using `d3.transition()`, use `helios.subscribe()` to update attributes on every frame. This ensures frame-perfect rendering and seeking.

```typescript
helios.subscribe((state) => {
  const t = state.currentFrame / (state.duration * state.fps); // 0 to 1

  // Interpolate data
  const interpolatedData = data.map(d => d * t);

  // Re-bind and render
  path.datum(interpolatedData).attr('d', lineGenerator);
});
```

## Common Issues

- **d3.transition():** Do NOT use `d3.transition()`. It relies on internal timers that won't sync with Helios's seek/render cycle. Always set attributes directly in the subscription callback.
- **Performance:** For large datasets, consider using Canvas with D3 (`d3-force` + Canvas API) instead of SVG for better performance.

## Source
- Example: `examples/d3-animation/`

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.