Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
with
64 additions
and 49 deletions.
- +6 −5 BUILDING.md
- +56 −0 CUSTOM_BUNDLE.md
- +1 −44 README.md
- +1 −0 tasks/test_syntax.js
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -0,0 +1,56 @@ | ||
# Custom bundle | ||
You can simply make custom bundles yourself, if none of the [distributed packages](https://github.com/plotly/plotly.js/blob/master/dist/README.md) meet your needs, or you want to make a more optimized bundle file with/without specific traces and transforms. | ||
|
||
Install plotly.js, move to plotly.js folder then install plotly.js dependencies: | ||
```sh | ||
npm i plotly.js@2.0.0-rc.2 | ||
cd node_modules/plotly.js | ||
npm i | ||
``` | ||
|
||
By default all traces and transforms are included in the bundle if you simply run: | ||
```sh | ||
npm run partial-bundle | ||
``` | ||
|
||
Use the `traces` option to include just the trace types you need. | ||
```sh | ||
npm run partial-bundle -- --traces scatter,scattergl,scatter3d | ||
``` | ||
Please note that the `scatter` trace is currently included in all bundles and cannot be removed. | ||
[This behaviour may change in the future](https://github.com/plotly/plotly.js/pull/5535), so we recommend that you explicitly include `scatter` anyway if you need it in your bundle. | ||
|
||
Use the `transforms` option to specify which should be included. | ||
```sh | ||
npm run partial-bundle -- --transforms sort,filter | ||
``` | ||
|
||
Or use `transforms none` to exclude them all. | ||
```sh | ||
npm run partial-bundle -- --transforms none | ||
``` | ||
|
||
Use the `out` option to change the bundle filename (default `custom`). | ||
The new bundle will be created in the `dist/` directory and named `plotly-<out>.min.js` or `plotly-<out>.js` if unminified. | ||
```sh | ||
npm run partial-bundle -- --out myBundleName | ||
``` | ||
|
||
Use the `unminified` option to disable compression. | ||
```sh | ||
npm run partial-bundle -- --unminified | ||
``` | ||
|
||
# Example illustrating use of different options together | ||
To create an unminified custom bundle named `myScatters` including `scatter`, `scattergl` and `scatter3d` traces without any transforms: | ||
```sh | ||
npm run partial-bundle -- \ | ||
--unminified \ | ||
--out myScatters \ | ||
--traces scatter,scattergl,scatter3d \ | ||
--transforms none | ||
``` | ||
Or simply on one line: | ||
```sh | ||
npm run partial-bundle -- --unminified --out myScatters --traces scatter,scattergl,scatter3d --transforms none | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -227,6 +227,7 @@ function assertFileNames() { | ||
base === 'CHANGELOG.md' || | ||
base === 'SECURITY.md' || | ||
base === 'BUILDING.md' || | ||
base === 'CUSTOM_BUNDLE.md' || | ||
file.indexOf('mathjax') !== -1 | ||
) return; | ||
|
||