Built on top of d3.js and stack.gl, plotly.js is a high-level, declarative charting library. plotly.js ships with over 30 chart types, including scientific charts, 3D graphs, statistical charts, SVG maps, financial charts, and more.
Contact us for Plotly.js consulting, dashboard development, application integration, and feature additions.
Table of contents #
- Quick start options
- Building plotly.js
- Bugs and feature requests
- Clients for R, Python, Node, and MATLAB
- Copyright and license
Quick start options #
Install with npm #
npm install plotly.js-dist
and import plotly.js as
import Plotly from 'plotly.js-dist'; or
var Plotly = require('plotly.js-dist');.
Use the plotly.js CDN hosted by Fastly #
and use the
Plotly object in the window scope.
Download the latest release #
and use the plotly.js
dist file(s). More info here.
Read the Getting started page for more examples.
v1.15.0, plotly.js ships with several partial bundles (more info here).
v1.39.0, plotly.js publishes distributed npm packages with no dependencies. For example, run
npm install plotly.js-geo-dist and add
import Plotly from 'plotly.js-geo-dist'; to your code to start using the plotly.js geo package.
If none of the distributed npm packages meet your needs, and you would like to manually pick which plotly.js modules to include, you'll first need to run
npm install plotly.js and then create a custom bundle by using
plotly.js/lib/core, and loading only the trace types that you need (e.g.
choropleth). The recommended way to do this is by creating a bundling file. For example, in CommonJS:
// in custom-plotly.js var Plotly = require('plotly.js/lib/core'); // Load in the trace types for pie, and choropleth Plotly.register([ require('plotly.js/lib/pie'), require('plotly.js/lib/choropleth') ]); module.exports = Plotly;
Then elsewhere in your code:
var Plotly = require('./path/to/custom-plotly');
To learn more about the plotly.js module architecture, refer to our modularizing monolithic JS projects post.
Non-ascii characters #
Important: the plotly.js code base contains some non-ascii characters. Therefore, please make sure to set the
charset attribute to
"utf-8" in the script tag that imports your plotly.js bundle. For example:
<script src="my-plotly-bundle.js" charset="utf-8"></script>
Building plotly.js #
Building instructions using
browserify and other build frameworks are in
Bugs and feature requests #
Have a bug or a feature request? Please first read the issues guidelines.
These pages are generated by the Plotly documentation repo built with Jekyll and publicly hosted on GitHub Pages. For more info about contributing to Plotly documentation, please read through contributing guidelines.
Please read through our contributing guidelines. Included are directions for opening issues, using plotly.js in your project and notes on development.
- Follow @plotlygraphs on Twitter for the latest Plotly news.
- Follow @plotly_js on Twitter for plotly.js release updates.
- Implementation help may be found on community.plot.ly (tagged
plotly-js) or on Stack Overflow (tagged
- Developers should use the keyword
plotlyon packages which modify or add to the functionality of plotly.js when distributing through npm.
- Direct developer email support can be purchased through a Plotly Support Plan.
This project is maintained under the Semantic Versioning guidelines.
See the Releases section of our GitHub project for changelogs for each release version of plotly.js.
Clients for R, Python, Node, and MATLAB #
Open-source clients to the plotly.js APIs are available at these links:
|GitHub repo||Getting started|
|R / RStudio||ropensci/plotly||plot.ly/r/getting-started|
|Python / Pandas / IPython notebook||plotly/plotly.py||plot.ly/python/getting-started|
|node.js / Tonicdev / Jupyter notebook||plotly/plotly-notebook-js|
|node.js cloud client||plotly/plotly-nodejs||plot.ly/nodejs/getting-started|
plotly.js charts can also be created and saved online for free at plot.ly/create.
|Alex C. Johnson||@alexcjohnson|
Hall of Fame #
Copyright and license #
Code and documentation copyright 2019 Plotly, Inc.
Code released under the MIT license.
Docs released under the Creative Commons license.
Use this package as a library
1. Depend on it
Add this to your package's pubspec.yaml file:
dependencies: plotly_js: ^0.0.2
2. Install it
You can install packages from the command line:
$ pub get
Alternatively, your editor might support
Check the docs for your editor to learn more.
3. Import it
Now in your Dart code, you can use:
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
We analyzed this package on Nov 7, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:
- Dart: 2.6.0
- pana: 0.12.21
Detected platforms: web, other
Platform components identified in package:
Health issues and suggestions
Document public APIs. (-1 points)
213 out of 213 API elements have no dartdoc comment.Providing good documentation for libraries, classes, functions, and other API elements improves code readability and helps developers find and use your API.
Maintenance issues and suggestions
Provide a file named
CHANGELOG.md. (-20 points)
Changelog entries help developers follow the progress of your package. See the example generated by
Maintain an example. (-10 points)
Create a short demo in the
example/ directory to show how to use this package.
Common filename patterns include
plotly_js.dart. Packages with multiple examples should provide
For more information see the pub package layout conventions.
Package is pre-v0.1 release. (-10 points)
While nothing is inherently wrong with versions of
0.0.*, it might mean that the author is still experimenting with the general direction of the API.
README.md. (-2 points)
1 image link is insecure (e.g.
https URLs instead.
|Dart SDK||>=2.1.0 <3.0.0|