Skip to content

Commit a0bd258

Browse files
committed
revise readme
1 parent 66b80c0 commit a0bd258

File tree

1 file changed

+28
-30
lines changed

1 file changed

+28
-30
lines changed

README.md

Lines changed: 28 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,8 @@ Plotly.js can be used to produce dozens of chart types and visualizations, inclu
1818

1919
## Table of contents
2020

21-
* [Load from CDN](#load-from-cdn)
22-
* [Load from npm](#load-from-npm)
23-
* [Versioning](#versioning)
21+
* [Load from npm (Node.js Package Manager)](#load-from-npm-nodejs-package-manager)
22+
* [Load from Content Delivery Network (CDN)](#load-from-content-delivery-network-cdn)
2423
* [Partial bundles](#partial-bundles)
2524
* [Alternative ways to require or build plotly.js](#alternative-ways-to-require-or-build-plotlyjs)
2625
* [Bugs and feature requests](#bugs-and-feature-requests)
@@ -31,10 +30,27 @@ Plotly.js can be used to produce dozens of chart types and visualizations, inclu
3130
* [Copyright and license](#copyright-and-license)
3231

3332
---
34-
## Load from CDN
33+
## Load from npm (Node.js Package Manager)
34+
35+
```sh
36+
npm install plotly.js-dist-min
37+
```
38+
39+
and import plotly.js as
40+
41+
```js
42+
import Plotly from 'plotly.js-dist-min'
43+
```
44+
Or
45+
```js
46+
var Plotly = require('plotly.js-dist-min')
47+
```
48+
49+
---
50+
## Load from Content Delivery Network (CDN)
3551
Fastly supports Plotly.js with free CDN service. Read more at <https://www.fastly.com/open-source>.
3652

37-
### Minified plotly.js X.Y.Z bundles
53+
### Usage example
3854
```html
3955
<head>
4056
<script src="https://cdn.plot.ly/plotly-2.0.0-rc.2.min.js"></script>
@@ -66,31 +82,7 @@ While non-minified source files may contain characters outside UTF-8, it is reco
6682
<script src="https://cdn.plot.ly/plotly-2.0.0-rc.2.js" charset="utf-8"></script>
6783
```
6884

69-
#### Please note that as of v2 the "plotly-latest" outputs (e.g. https://cdn.plot.ly/plotly-latest.min.js) will no longer be updated on the CDN, and will stay at the last v1 patch v1.58.4. Therefore, to use the CDN with plotly.js v2 and higher, you must specify an exact plotly.js version.
70-
71-
72-
## Load from npm
73-
74-
```sh
75-
npm install plotly.js-dist-min
76-
```
77-
78-
and import plotly.js as
79-
80-
```js
81-
import Plotly from 'plotly.js-dist-min'
82-
```
83-
Or
84-
```js
85-
var Plotly = require('plotly.js-dist-min')
86-
```
87-
88-
---
89-
## Versioning
90-
91-
This project is maintained under the [Semantic Versioning guidelines](https://semver.org/).
92-
93-
See the [Releases section](https://github.com/plotly/plotly.js/releases) of our GitHub project for changelogs for each release version of plotly.js.
85+
> Please note that as of v2 the "plotly-latest" outputs (e.g. https://cdn.plot.ly/plotly-latest.min.js) will no longer be updated on the CDN, and will stay at the last v1 patch v1.58.4. Therefore, to use the CDN with plotly.js v2 and higher, you must specify an exact plotly.js version.
9486
9587
## Partial bundles
9688

@@ -209,3 +201,9 @@ Plotly.js is at the core of a large and dynamic ecosystem with many contributors
209201
Code and documentation copyright 2021 Plotly, Inc.
210202

211203
Code released under the [MIT license](https://github.com/plotly/plotly.js/blob/master/LICENSE).
204+
205+
### Versioning
206+
207+
This project is maintained under the [Semantic Versioning guidelines](https://semver.org/).
208+
209+
See the [Releases section](https://github.com/plotly/plotly.js/releases) of our GitHub project for changelogs for each release version of plotly.js.

0 commit comments

Comments
 (0)