Plotly.js

Plotly 和 Dash 背后的开源 JavaScript 图表库。「Open-source JavaScript charting library behind Plotly and Dash」

Github星跟蹤圖

npm version
circle ci
MIT License

Built on top of d3.js and stack.gl,
plotly.js is a high-level, declarative charting library. plotly.js ships with over 40
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

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

<!-- Latest compiled and minified plotly.js JavaScript -->
<script src="https://cdn.plot.ly/plotly-latest.min.js"></script>

<!-- OR use a specific plotly.js release (e.g. version 1.5.0) -->
<script src="https://cdn.plot.ly/plotly-1.5.0.min.js"></script>

<!-- OR an un-minified version is also available -->
<script src="https://cdn.plot.ly/plotly-latest.js" charset="utf-8"></script>

and use the Plotly object in the window scope.

Fastly supports Plotly.js with free CDN service. Read more at https://www.fastly.com/open-source

Download the latest release

Latest Release on GitHub

and use the plotly.js dist file(s). More info here.

Read the Getting started page for more examples.

Modules

Starting in v1.15.0, plotly.js ships with several partial bundles (more info here).

Starting in 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. pie or 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 webpack, browserify and other build frameworks are in BUILDING.md

Bugs and feature requests

Have a bug or a feature request? Please first read the issues guidelines.

Documentation

Official plotly.js documentation is hosted on plot.ly/javascript.

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.

You can also suggest new documentation examples by submitting a Codepen on community.plot.ly with tag plotly-js.

Contributing

Please read through our contributing guidelines. Included are directions for opening issues, using plotly.js in your project and notes on development.

Community

  • 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 plotly).
  • Developers should use the keyword plotly on 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.

Versioning

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:

概覽

名稱與所有者plotly/plotly.js
主編程語言JavaScript
編程語言JavaScript (語言數: 6)
平台Web browsers
許可證MIT License
發布數256
最新版本名稱v2.32.0 (發布於 2024-04-23 14:53:04)
第一版名稱v1.0.0 (發布於 2015-11-17 11:09:46)
創建於2015-11-05 23:27:17
推送於2024-04-23 18:55:38
最后一次提交2024-04-23 14:53:03
星數16.5k
關注者數286
派生數1.8k
提交數26.3k
已啟用問題?
問題數4120
打開的問題數1550
拉請求數2514
打開的拉請求數41
關閉的拉請求數284
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?
去到頂部