Skip to content

Commit e4c2f86

Browse files
committed
update README on how to use the script to make custom bundles
1 parent 4f862ca commit e4c2f86

File tree

1 file changed

+2
-19
lines changed

1 file changed

+2
-19
lines changed

README.md

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -75,26 +75,9 @@ Starting in `v1.15.0`, plotly.js ships with several _partial_ bundles (more info
7575

7676
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.
7777

78-
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:
78+
If none of the distributed npm packages meet your needs, you create custom bundle of desired trace modules e.g. `pie` and `sunburst` using
79+
`npm run partial-bundle pie sunburst name=custom`
7980

80-
```javascript
81-
// in custom-plotly.js
82-
var Plotly = require('plotly.js/lib/core');
83-
84-
// Load in the trace types for pie, and choropleth
85-
Plotly.register([
86-
require('plotly.js/lib/pie'),
87-
require('plotly.js/lib/choropleth')
88-
]);
89-
90-
module.exports = Plotly;
91-
```
92-
93-
Then elsewhere in your code:
94-
95-
```javascript
96-
var Plotly = require('./path/to/custom-plotly');
97-
```
9881

9982
#### Non-ascii characters
10083

0 commit comments

Comments
 (0)