
Plotly.js
A JavaScript library for drawing interactive charts in web pages, also the engine behind Plotly in Python and
- Stars
- 18.4k
- Forks
- 2.1k
- Licence
- MIT
- Language
- JavaScript
- Last update
- 7 days ago
- Type
- Library
What it is
Plotly.js is a JavaScript library that draws interactive data visualizations such as statistical charts, 3D graphs, scientific charts, map charts and financial charts. You describe your data and layout as a JSON-like object, and the library renders the chart in a web page. The same library also powers the Python and R packages named plotly.
- Embed an interactive line or bar chart in a web page using a script tag
- Render 3D or scientific plots in a browser
- Build a custom bundle that includes only the chart types you need
- Add math expressions to chart labels by loading MathJax alongside the library
Great for
- Web developers who want interactive charts in their own site or app
- Data analysts who already use Python or R Plotly and want to understand the JavaScript side
- Teams building dashboards that need 3D or scientific chart types
- People comfortable with basic HTML and JSON who want charts without much code
Not ideal for
- Users who only need a simple static chart image; a lighter charting library may be enough
- Projects with strict bundle size limits unless they choose a custom or partial bundle, since the full build is large
- Anyone needing WebGL 2 features, since the README only mentions a WebGL 1 workaround for multiple graphs
How to get it
- 1
Install with a package manager
You'll need: Node.js (for npm install)
Install the ready-to-use distributed bundle
npm i --save plotly.js-dist-min - 2
Run it
- Install the package with npm using the command shown.
- In Node.js or a bundler, import it with: import Plotly from 'plotly.js-dist-min'
- Or load it in an HTML page with a script tag pointing to the CDN build.
- Create a div with an id, then call Plotly.newPlot with your data and layout.
- 3
Get the most out of it
- Create a custom bundle with only the chart types you need to reduce size (see CUSTOM_BUNDLE.md)
- Use plotly.js-dist if you prefer an unminified package for debugging
- Load MathJax v3 or v4 separately to render $...$ math in titles, labels and annotations
- Use the virtual-webgl script if you need several WebGL graphs on one page
Downloads
Strengths
- Supports dozens of chart types, including 3D, scientific, map and financial charts
- Can be used with no build step by loading it from a CDN, or installed through npm
- Actively maintained by Plotly, with an MIT license
Trade-offs
- The full bundle is large, so you may need to build a custom bundle to keep pages light
- Advanced setup such as custom builds or bundling requires reading additional guides
- Some features like MathJax rendering need separate loading and extra configuration
How it compares
| Project | Stars | Type | Level | Updated | Best for |
|---|---|---|---|---|---|
| plotly.js (this) | 18.4k | Library | beginner | 7 days ago | Web developers who want interactive charts in their own site or app |
| Chart.js | 67.8k | Library | intermediate | 14 days ago | Web developers adding standard charts such as line or bar charts to a site |
| plotly.py | 18.9k | Library | beginner | 5 days ago | Python users who want hoverable, zoomable charts without writing JavaScript |
| visx | 21.1k | Library | intermediate | 5 months ago | React developers who want full control over how a chart looks and behaves |
| deck.gl | 14.7k | Library | intermediate | 4 days ago | Developers building interactive maps or geospatial dashboards over large data sets |
| recharts | 27.7k | Library | beginner | 4 days ago | React developers who need standard charts such as line, bar or similar graphs in a web app |
Stats synced from GitHub. The assessment above was drafted with AI from the project's README on 2026-10-29 and may miss recent changes — check the README before relying on a command. MIT licence: free to use, modify and distribute, including commercially, as long as you keep the copyright notice.