Plotly.js is an open-source JavaScript data visualization library that provides a wide array of interactive, publication-quality charts and graphs. It is the core engine powering the popular Plotly.py and Plotly.R libraries, offering a unified graphing experience across different programming environments. The library supports dozens of chart types, including statistical, 3D, scientific, SVG/tile maps, and financial charts. It is currently stable at version 3.5.0, with minor releases featuring new attributes, bug fixes, and performance improvements appearing frequently. Its key differentiators include comprehensive chart type support, robust interactivity features, and its foundational role in the broader Plotly ecosystem, enabling complex data narratives in web applications. It can be used as a Node.js module via bundled distributions or directly in the browser via script tags and CDNs.
npm install plotly.jsVerified import paths — ran on the pinned version, not inferred.
This example demonstrates how to embed a simple interactive scatter plot using Plotly.js directly in an HTML file via CDN, initializing it with basic data and layout configurations.
Consult the Plotly.js v3 migration guide for detailed attribute mapping and update chart configurations accordingly. Ensure all title-related attributes are nested under `title.*` and use modern attribute equivalents.
Upgrade Node.js to version 18.0.0 or newer.
Always use `import Plotly from 'plotly.js-dist-min'` or `require('plotly.js-dist-min')` for module usage.Always use default import syntax: `import Plotly from 'plotly.js-dist-min'` or `const Plotly = require('plotly.js-dist-min')`.Ensure your Plotly.js version is 3.1.2 or newer to resolve this specific regression.
No dependency data recorded yet.