Threejs data visualization

From openai/plugins · View interactive version

Threejs data visualization is an AI agent skill from the GitHub repository openai/plugins. Render WebGL-accelerated data visualizations with Three.js, raw WebGL, deck.gl, luma.gl, PixiJS, Sigma.js, Plotly WebGL traces, ECharts GL, CesiumJS, Babylon.js, or related GPU libraries. Use when the visualization needs true spatial structure, dense 2D or 3D GPU rendering, particle or flow animatio

How to use this skill

Skill file

Three.js and WebGL Data Visualization

Overview

Use this skill when the user truly benefits from 3D, GPU-heavy 2D, shader-driven animation, or WebGL-accelerated interaction. Three.js is appropriate for volumetric data, 3D point clouds, spatial trajectories, surfaces, scientific or immersive scenes, and custom particle systems. WebGL or WebGL-backed libraries are also appropriate for dense 2D scatterplots, animated networks, flow maps, particle trails, GPU aggregation, or custom shader effects that exceed practical SVG/DOM limits and are not a good fit for Canvas2D.

Default assumption: use the simplest truthful renderer that meets the scale and interaction requirements. 3D is justified only when depth carries analytical meaning. WebGL is justified when GPU throughput, shader control, large mark counts, or animation quality matter enough to offset accessibility, export, debugging, bundle, and GPU-memory costs. Cosmetic 3D or decorative particles are regressions.

Mobile GPUs, touch gestures, battery, thermal limits, and permissions can change the renderer choice. Use ../../references/foundations/mobile-first-responsive-visualization.md for mobile portrait/landscape contracts, AR/camera/motion/vibration decisions, visual viewport behavior, spotty connection handling, and touch-first controls.

Choose WebGL When

Avoid WebGL When

Library Selection

Particle and Flow Effects

Use particle effects only when they make movement, accumulation, attention, or state more legible:

Do not use particles when they obscure totals, imply individual entities that are not in the data, overstate certainty, glamorize harm, or compete with labels and comparison tasks. Always provide a reduced-motion fallback and a static final or key frame.

Default Architecture

  1. Choose the renderer from data shape and interaction load before choosing visual style.
  2. Prefer orthographic projection for chart-like 3D or 2.5D scenes.
  3. Use perspective only when depth cues matter.
  4. Keep data-to-scene transforms explicit and reversible.
  5. Use GPU-friendly primitives:
  1. Batch static marks, keep dynamic attributes narrow, and avoid re-uploading full buffers every frame.
  2. Assess how many scenes may be visible at once, because GPU memory, context pressure, and overlay complexity change the recommendation.
  3. Keep labels, legends, controls, and rich annotation in DOM or SVG overlays unless the scene truly demands in-canvas text.
  4. For editorial stories, define named camera or animation states as part of the annotation plan: overview, focus, comparison, reveal, final.
  5. Keep generated textures, basemaps, or illustrated backdrops separate from data geometry so they can be reviewed and swapped.
  6. For custom shaders, define the data contract first: attributes, uniforms, textures, derived values, picking IDs, and fallbacks.
  7. For particles, define emission source, path or field, speed, lifetime, color, opacity curve, decay, selection behavior, and reduced-motion state before coding.
  8. For advanced scenes, complete ../../assets/templates/advanced-interactive-visualization-contract.md before implementation. Name one primary scene owner, a true fallback path, coordinate frames, camera states, picking model, animation clock, interaction state machine, render-ready signal, and screenshot QA.
  9. Never let a fallback or helper renderer duplicate the primary visual while WebGL is active. One renderer owns the focal scene; fallbacks appear only when the primary scene fails or is intentionally disabled.
  10. For mobile, cap DPR or quality when needed, pause offscreen/inactive loops, lazy-load heavy assets with reserved dimensions, and define stale/offline rendering for streamed or tiled data.

Interaction Rules

Output Expectations

References

Representative Prompts

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.