From 66b80c08de3e078a9ccaf70d64e1444c6dba4e4c Mon Sep 17 00:00:00 2001 From: archmoj Date: Wed, 2 Jun 2021 14:45:44 -0400 Subject: [PATCH 01/10] revise README --- README.md | 84 +++++++++++++++++++++++++++++++------------------------ 1 file changed, 48 insertions(+), 36 deletions(-) diff --git a/README.md b/README.md index c171f68b5a6..4cfcef7aac8 100644 --- a/README.md +++ b/README.md @@ -18,21 +18,58 @@ Plotly.js can be used to produce dozens of chart types and visualizations, inclu ## Table of contents -* [Quick start options](#quick-start-options) +* [Load from CDN](#load-from-cdn) +* [Load from npm](#load-from-npm) +* [Versioning](#versioning) * [Partial bundles](#partial-bundles) * [Alternative ways to require or build plotly.js](#alternative-ways-to-require-or-build-plotlyjs) * [Bugs and feature requests](#bugs-and-feature-requests) * [Documentation](#documentation) * [Contributing](#contributing) * [Community](#community) -* [Versioning](#versioning) * [Notable contributors](#creators) * [Copyright and license](#copyright-and-license) --- -## Quick start options +## Load from CDN +Fastly supports Plotly.js with free CDN service. Read more at . + +### Minified plotly.js X.Y.Z bundles +```html + + + + +
+ + + +``` +In the example above `Plotly` object is added to the window scope by the script in the `head` section. +The `newPlot` method is then used to draw an interactive figure as described by `data` and `layout` into the desired `div` here named `gd`. +As demonstrated in the example above basic knowledge of `html` and [JSON](https://en.wikipedia.org/wiki/JSON) syntax is enough to get started i.e. with/without JavaScript! +To learn and build more with plotly.js please visit [plotly.js documentation](https://plotly.com/javascript). + +### Un-minified versions are also available on CDN +While non-minified source files may contain characters outside UTF-8, it is recommended that you specify the `charset` when loading those bundles. +```html + +``` + +#### 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. -### Install with npm + +## Load from npm ```sh npm install plotly.js-dist-min @@ -42,37 +79,19 @@ and import plotly.js as ```js import Plotly from 'plotly.js-dist-min' -// Or using require, -var Plotly = require('plotly.js-dist-min') ``` - -### Use the plotly.js CDN hosted by Fastly - -#### A minified plotly.js X.Y.Z release -```html - -``` - -#### An un-minified version is also available -```html - +Or +```js +var Plotly = require('plotly.js-dist-min') ``` -and use the `Plotly` object in the window scope. - -##### 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. - -Fastly supports Plotly.js with free CDN service. Read more at - -### Download the latest release or a release candidate (rc) - -[Latest and rc releases on GitHub](https://github.com/plotly/plotly.js/releases/) +--- +## Versioning -and use the plotly.js `dist` file(s). More info [here](https://github.com/plotly/plotly.js/blob/master/dist/README.md). +This project is maintained under the [Semantic Versioning guidelines](https://semver.org/). -#### Read the [Getting started page](https://plotly.com/javascript/getting-started/) for more examples. +See the [Releases section](https://github.com/plotly/plotly.js/releases) of our GitHub project for changelogs for each release version of plotly.js. ---- ## Partial bundles There are two kinds of plotly.js partial bundles: @@ -159,13 +178,6 @@ Please read through our [contributing guidelines](https://github.com/plotly/plot on Stack Overflow (tagged [`plotly`](https://stackoverflow.com/questions/tagged/plotly)). * Developers should use the keyword `plotly` on packages which modify or add to the functionality of plotly.js when distributing through [npm](https://www.npmjs.com/browse/keyword/plotly). ---- -## Versioning - -This project is maintained under the [Semantic Versioning guidelines](https://semver.org/). - -See the [Releases section](https://github.com/plotly/plotly.js/releases) of our GitHub project for changelogs for each release version of plotly.js. - --- ## Notable contributors From a0bd25835c3f415dece9c5cd8604663a60d7f532 Mon Sep 17 00:00:00 2001 From: archmoj Date: Wed, 2 Jun 2021 16:35:50 -0400 Subject: [PATCH 02/10] revise readme --- README.md | 58 +++++++++++++++++++++++++++---------------------------- 1 file changed, 28 insertions(+), 30 deletions(-) diff --git a/README.md b/README.md index 4cfcef7aac8..191485ad104 100644 --- a/README.md +++ b/README.md @@ -18,9 +18,8 @@ Plotly.js can be used to produce dozens of chart types and visualizations, inclu ## Table of contents -* [Load from CDN](#load-from-cdn) -* [Load from npm](#load-from-npm) -* [Versioning](#versioning) +* [Load from npm (Node.js Package Manager)](#load-from-npm-nodejs-package-manager) +* [Load from Content Delivery Network (CDN)](#load-from-content-delivery-network-cdn) * [Partial bundles](#partial-bundles) * [Alternative ways to require or build plotly.js](#alternative-ways-to-require-or-build-plotlyjs) * [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 * [Copyright and license](#copyright-and-license) --- -## Load from CDN +## Load from npm (Node.js Package Manager) + +```sh +npm install plotly.js-dist-min +``` + +and import plotly.js as + +```js +import Plotly from 'plotly.js-dist-min' +``` +Or +```js +var Plotly = require('plotly.js-dist-min') +``` + +--- +## Load from Content Delivery Network (CDN) Fastly supports Plotly.js with free CDN service. Read more at . -### Minified plotly.js X.Y.Z bundles +### Usage example ```html @@ -66,31 +82,7 @@ While non-minified source files may contain characters outside UTF-8, it is reco ``` -#### 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. - - -## Load from npm - -```sh -npm install plotly.js-dist-min -``` - -and import plotly.js as - -```js -import Plotly from 'plotly.js-dist-min' -``` -Or -```js -var Plotly = require('plotly.js-dist-min') -``` - ---- -## Versioning - -This project is maintained under the [Semantic Versioning guidelines](https://semver.org/). - -See the [Releases section](https://github.com/plotly/plotly.js/releases) of our GitHub project for changelogs for each release version of plotly.js. +> 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. ## Partial bundles @@ -209,3 +201,9 @@ Plotly.js is at the core of a large and dynamic ecosystem with many contributors Code and documentation copyright 2021 Plotly, Inc. Code released under the [MIT license](https://github.com/plotly/plotly.js/blob/master/LICENSE). + +### Versioning + +This project is maintained under the [Semantic Versioning guidelines](https://semver.org/). + +See the [Releases section](https://github.com/plotly/plotly.js/releases) of our GitHub project for changelogs for each release version of plotly.js. From 866ca5a7d92c1e27940b9020dd81e95984a852b5 Mon Sep 17 00:00:00 2001 From: archmoj Date: Wed, 2 Jun 2021 16:43:49 -0400 Subject: [PATCH 03/10] reorder items --- README.md | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 191485ad104..ad7bc227e75 100644 --- a/README.md +++ b/README.md @@ -22,12 +22,12 @@ Plotly.js can be used to produce dozens of chart types and visualizations, inclu * [Load from Content Delivery Network (CDN)](#load-from-content-delivery-network-cdn) * [Partial bundles](#partial-bundles) * [Alternative ways to require or build plotly.js](#alternative-ways-to-require-or-build-plotlyjs) -* [Bugs and feature requests](#bugs-and-feature-requests) * [Documentation](#documentation) +* [Bugs and feature requests](#bugs-and-feature-requests) * [Contributing](#contributing) -* [Community](#community) -* [Notable contributors](#creators) +* [Notable contributors](#notable-contributors) * [Copyright and license](#copyright-and-license) +* [Community](#community) --- ## Load from npm (Node.js Package Manager) @@ -137,11 +137,6 @@ npm run partial-bundle -- --unminified --out myScatters --traces scatter,scatter ## Alternative ways to require or build plotly.js If your library needs to bundle or directly require [plotly.js/lib/index.js](https://github.com/plotly/plotly.js/blob/master/lib/index.js) or parts of its modules similar to [index-basic](https://github.com/plotly/plotly.js/blob/master/lib/index-basic.js) in some other way than via an official or a custom bundle, or in case you want to tweak the default build configurations of `browserify` or `webpack`, etc. then please visit [`BUILDING.md`](https://github.com/plotly/plotly.js/blob/master/BUILDING.md). ---- -## Bugs and feature requests - -Have a bug or a feature request? Please [open a Github issue](https://github.com/plotly/plotly.js/issues/new) keeping in mind the [issue guidelines](https://github.com/plotly/plotly.js/blob/master/.github/ISSUE_TEMPLATE.md). You may also want to read about [how changes get made to Plotly.js](https://github.com/plotly/plotly.js/blob/master/CONTRIBUTING.md) - --- ## Documentation @@ -158,17 +153,15 @@ Load relevant MathJax (v2) files *Before* the plotly.js script tag: ``` --- -## Contributing +## Bugs and feature requests + +Have a bug or a feature request? Please [open a Github issue](https://github.com/plotly/plotly.js/issues/new) keeping in mind the [issue guidelines](https://github.com/plotly/plotly.js/blob/master/.github/ISSUE_TEMPLATE.md). You may also want to read about [how changes get made to Plotly.js](https://github.com/plotly/plotly.js/blob/master/CONTRIBUTING.md) -Please read through our [contributing guidelines](https://github.com/plotly/plotly.js/blob/master/CONTRIBUTING.md). Included are directions for opening issues, using plotly.js in your project and notes on development. --- -## Community +## Contributing -* Follow [@plotlygraphs](https://twitter.com/plotlygraphs) on Twitter for the latest Plotly news. -* Implementation help may be found on community.plot.com (tagged [`plotly-js`](https://community.plotly.com/c/plotly-js)) or - on Stack Overflow (tagged [`plotly`](https://stackoverflow.com/questions/tagged/plotly)). -* Developers should use the keyword `plotly` on packages which modify or add to the functionality of plotly.js when distributing through [npm](https://www.npmjs.com/browse/keyword/plotly). +Please read through our [contributing guidelines](https://github.com/plotly/plotly.js/blob/master/CONTRIBUTING.md). Included are directions for opening issues, using plotly.js in your project and notes on development. --- ## Notable contributors @@ -207,3 +200,11 @@ Code released under the [MIT license](https://github.com/plotly/plotly.js/blob/m This project is maintained under the [Semantic Versioning guidelines](https://semver.org/). See the [Releases section](https://github.com/plotly/plotly.js/releases) of our GitHub project for changelogs for each release version of plotly.js. + +--- +## Community + +* Follow [@plotlygraphs](https://twitter.com/plotlygraphs) on Twitter for the latest Plotly news. +* Implementation help may be found on community.plot.com (tagged [`plotly-js`](https://community.plotly.com/c/plotly-js)) or + on Stack Overflow (tagged [`plotly`](https://stackoverflow.com/questions/tagged/plotly)). +* Developers should use the keyword `plotly` on packages which modify or add to the functionality of plotly.js when distributing through [npm](https://www.npmjs.com/browse/keyword/plotly). From fadac712f2ff53f42b0db680972d83af53c4779b Mon Sep 17 00:00:00 2001 From: archmoj Date: Wed, 2 Jun 2021 17:24:44 -0400 Subject: [PATCH 04/10] place mathjax note close to cdn --- README.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index ad7bc227e75..5b21bd7aabc 100644 --- a/README.md +++ b/README.md @@ -84,6 +84,13 @@ While non-minified source files may contain characters outside UTF-8, it is reco > 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. +### To support MathJax +Load relevant MathJax (v2) files *Before* the plotly.js script tag: +```html + + +``` + ## Partial bundles There are two kinds of plotly.js partial bundles: @@ -145,13 +152,6 @@ Official plotly.js documentation is hosted at [https://plotly.com/javascript](ht These pages are generated by the Plotly [graphing-library-docs repo](https://github.com/plotly/graphing-library-docs) built with [Jekyll](https://jekyllrb.com/) and publicly hosted on GitHub Pages. For more info about contributing to Plotly documentation, please read through [contributing guidelines](https://github.com/plotly/graphing-library-docs/blob/master/README.md). -### To support MathJax -Load relevant MathJax (v2) files *Before* the plotly.js script tag: -```html - - -``` - --- ## Bugs and feature requests From 394d9f4267a3ec32e62d3911a51658473046a1ab Mon Sep 17 00:00:00 2001 From: archmoj Date: Thu, 3 Jun 2021 09:43:53 -0400 Subject: [PATCH 05/10] point to bundles - simplify dist/README --- README.md | 9 ++-- dist/README.md | 142 +++++++++++-------------------------------------- tasks/stats.js | 34 +++++------- 3 files changed, 47 insertions(+), 138 deletions(-) diff --git a/README.md b/README.md index 5b21bd7aabc..2b962be10b4 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ Plotly.js can be used to produce dozens of chart types and visualizations, inclu * [Load from npm (Node.js Package Manager)](#load-from-npm-nodejs-package-manager) * [Load from Content Delivery Network (CDN)](#load-from-content-delivery-network-cdn) -* [Partial bundles](#partial-bundles) +* [Bundles](#bundles) * [Alternative ways to require or build plotly.js](#alternative-ways-to-require-or-build-plotlyjs) * [Documentation](#documentation) * [Bugs and feature requests](#bugs-and-feature-requests) @@ -91,10 +91,9 @@ Load relevant MathJax (v2) files *Before* the plotly.js script tag: ``` -## Partial bundles - -There are two kinds of plotly.js partial bundles: -1. The official partial bundles that are distributed to `npm` and the CDN, described in [the dist README](https://github.com/plotly/plotly.js/blob/master/dist/README.md). +## Bundles +There are two kinds of plotly.js bundles: +1. Complete and partial official bundles that are distributed to `npm` and the `CDN`, described in [the dist README](https://github.com/plotly/plotly.js/blob/master/dist/README.md). 2. Custom bundles you can create yourself, if none of the distributed packages meet your needs. Use the `traces` option to include just the trace types you need. diff --git a/dist/README.md b/dist/README.md index 5e517f49beb..6f23e3117b5 100644 --- a/dist/README.md +++ b/dist/README.md @@ -39,12 +39,12 @@ Plotly.newPlot(graphDiv, data, layout, {locale: 'de-CH'}) The main plotly.js bundle includes all the official (non-beta) trace modules. -It be can imported as minified javascript +It be can be imported as minified javascript - using dist file `dist/plotly.min.js` - using CDN URL https://cdn.plot.ly/plotly-2.0.0-rc.2.min.js or as raw javascript: -- using the `plotly.js-dist` npm package (starting in `v1.39.0`) +- using the `plotly.js-dist` npm package - using dist file `dist/plotly.js` - using CDN URL https://cdn.plot.ly/plotly-2.0.0-rc.2.js - using CommonJS with `require('plotly.js')` @@ -59,7 +59,7 @@ The main plotly.js bundle weights in at: ## Partial bundles -Starting in `v1.15.0`, plotly.js also ships with several _partial_ bundles: +plotly.js also ships with several _partial_ bundles: - [basic](#plotlyjs-basic) - [cartesian](#plotlyjs-cartesian) @@ -70,13 +70,11 @@ Starting in `v1.15.0`, plotly.js also ships with several _partial_ bundles: - [finance](#plotlyjs-finance) - [strict](#plotlyjs-strict) -Starting in `v1.39.0`, each plotly.js partial bundle has a corresponding npm package with no dependencies. +> Each plotly.js partial bundle has a corresponding npm package with no dependencies. -Starting in `v1.50.0`, the minified version of each partial bundle is also published to npm in a separate "dist min" package. +> The minified version of each partial bundle is also published to npm in a separate "dist-min" package. -Starting in `v2.0.0`, the strict partial bundle includes everything except the traces that require function constructors. -Over time we hope to include more of the remaining trace types here, after which we intend to work on other strict CSP issues -such as inline CSS that we may not be able to include in the main bundle. +> The strict partial bundle includes everything except the traces that require function constructors. Over time we hope to include more of the remaining trace types here, after which we intend to work on other strict CSP issues such as inline CSS that we may not be able to include in the main bundle. ### plotly.js basic @@ -95,7 +93,7 @@ The `basic` partial bundle contains trace modules `bar`, `pie` and `scatter`. | Tagged | https://cdn.plot.ly/plotly-basic-2.0.0-rc.2.js | | Tagged minified | https://cdn.plot.ly/plotly-basic-2.0.0-rc.2.min.js | -#### npm package (starting in `v1.39.0`) +#### npm package Install [`plotly.js-basic-dist`](https://www.npmjs.com/package/plotly.js-basic-dist) with ``` @@ -109,26 +107,16 @@ import Plotly from 'plotly.js-basic-dist' CommonJS usage: ```js -var Plotly = require('plotly.js-basic-dist'); +var Plotly = require('plotly.js-basic-dist') ``` -#### dist min npm package (starting in `v1.50.0`) +#### dist-min npm package Install [`plotly.js-basic-dist-min`](https://www.npmjs.com/package/plotly.js-basic-dist-min) with ``` npm install plotly.js-basic-dist-min ``` -#### Other plotly.js entry points - -| Flavor | Location | -|---------------|----------| -| dist bundle | `dist/plotly-basic.js` | -| dist bundle (minified) | `dist/plotly-basic.min.js` | -| ES6 module | `import Plotly from 'plotly.js/lib/index-basic'` | -| CommonJS | `require('plotly.js/lib/index-basic')` | - - ### plotly.js cartesian The `cartesian` partial bundle contains trace modules `bar`, `box`, `contour`, `heatmap`, `histogram`, `histogram2d`, `histogram2dcontour`, `image`, `pie`, `scatter`, `scatterternary` and `violin`. @@ -146,7 +134,7 @@ The `cartesian` partial bundle contains trace modules `bar`, `box`, `contour`, ` | Tagged | https://cdn.plot.ly/plotly-cartesian-2.0.0-rc.2.js | | Tagged minified | https://cdn.plot.ly/plotly-cartesian-2.0.0-rc.2.min.js | -#### npm package (starting in `v1.39.0`) +#### npm package Install [`plotly.js-cartesian-dist`](https://www.npmjs.com/package/plotly.js-cartesian-dist) with ``` @@ -160,26 +148,16 @@ import Plotly from 'plotly.js-cartesian-dist' CommonJS usage: ```js -var Plotly = require('plotly.js-cartesian-dist'); +var Plotly = require('plotly.js-cartesian-dist') ``` -#### dist min npm package (starting in `v1.50.0`) +#### dist-min npm package Install [`plotly.js-cartesian-dist-min`](https://www.npmjs.com/package/plotly.js-cartesian-dist-min) with ``` npm install plotly.js-cartesian-dist-min ``` -#### Other plotly.js entry points - -| Flavor | Location | -|---------------|----------| -| dist bundle | `dist/plotly-cartesian.js` | -| dist bundle (minified) | `dist/plotly-cartesian.min.js` | -| ES6 module | `import Plotly from 'plotly.js/lib/index-cartesian'` | -| CommonJS | `require('plotly.js/lib/index-cartesian')` | - - ### plotly.js geo The `geo` partial bundle contains trace modules `choropleth`, `scatter` and `scattergeo`. @@ -197,7 +175,7 @@ The `geo` partial bundle contains trace modules `choropleth`, `scatter` and `sca | Tagged | https://cdn.plot.ly/plotly-geo-2.0.0-rc.2.js | | Tagged minified | https://cdn.plot.ly/plotly-geo-2.0.0-rc.2.min.js | -#### npm package (starting in `v1.39.0`) +#### npm package Install [`plotly.js-geo-dist`](https://www.npmjs.com/package/plotly.js-geo-dist) with ``` @@ -211,26 +189,16 @@ import Plotly from 'plotly.js-geo-dist' CommonJS usage: ```js -var Plotly = require('plotly.js-geo-dist'); +var Plotly = require('plotly.js-geo-dist') ``` -#### dist min npm package (starting in `v1.50.0`) +#### dist-min npm package Install [`plotly.js-geo-dist-min`](https://www.npmjs.com/package/plotly.js-geo-dist-min) with ``` npm install plotly.js-geo-dist-min ``` -#### Other plotly.js entry points - -| Flavor | Location | -|---------------|----------| -| dist bundle | `dist/plotly-geo.js` | -| dist bundle (minified) | `dist/plotly-geo.min.js` | -| ES6 module | `import Plotly from 'plotly.js/lib/index-geo'` | -| CommonJS | `require('plotly.js/lib/index-geo')` | - - ### plotly.js gl3d The `gl3d` partial bundle contains trace modules `cone`, `isosurface`, `mesh3d`, `scatter`, `scatter3d`, `streamtube`, `surface` and `volume`. @@ -248,7 +216,7 @@ The `gl3d` partial bundle contains trace modules `cone`, `isosurface`, `mesh3d`, | Tagged | https://cdn.plot.ly/plotly-gl3d-2.0.0-rc.2.js | | Tagged minified | https://cdn.plot.ly/plotly-gl3d-2.0.0-rc.2.min.js | -#### npm package (starting in `v1.39.0`) +#### npm package Install [`plotly.js-gl3d-dist`](https://www.npmjs.com/package/plotly.js-gl3d-dist) with ``` @@ -262,26 +230,16 @@ import Plotly from 'plotly.js-gl3d-dist' CommonJS usage: ```js -var Plotly = require('plotly.js-gl3d-dist'); +var Plotly = require('plotly.js-gl3d-dist') ``` -#### dist min npm package (starting in `v1.50.0`) +#### dist-min npm package Install [`plotly.js-gl3d-dist-min`](https://www.npmjs.com/package/plotly.js-gl3d-dist-min) with ``` npm install plotly.js-gl3d-dist-min ``` -#### Other plotly.js entry points - -| Flavor | Location | -|---------------|----------| -| dist bundle | `dist/plotly-gl3d.js` | -| dist bundle (minified) | `dist/plotly-gl3d.min.js` | -| ES6 module | `import Plotly from 'plotly.js/lib/index-gl3d'` | -| CommonJS | `require('plotly.js/lib/index-gl3d')` | - - ### plotly.js gl2d The `gl2d` partial bundle contains trace modules `heatmapgl`, `parcoords`, `pointcloud`, `scatter`, `scattergl` and `splom`. @@ -299,7 +257,7 @@ The `gl2d` partial bundle contains trace modules `heatmapgl`, `parcoords`, `poin | Tagged | https://cdn.plot.ly/plotly-gl2d-2.0.0-rc.2.js | | Tagged minified | https://cdn.plot.ly/plotly-gl2d-2.0.0-rc.2.min.js | -#### npm package (starting in `v1.39.0`) +#### npm package Install [`plotly.js-gl2d-dist`](https://www.npmjs.com/package/plotly.js-gl2d-dist) with ``` @@ -313,26 +271,16 @@ import Plotly from 'plotly.js-gl2d-dist' CommonJS usage: ```js -var Plotly = require('plotly.js-gl2d-dist'); +var Plotly = require('plotly.js-gl2d-dist') ``` -#### dist min npm package (starting in `v1.50.0`) +#### dist-min npm package Install [`plotly.js-gl2d-dist-min`](https://www.npmjs.com/package/plotly.js-gl2d-dist-min) with ``` npm install plotly.js-gl2d-dist-min ``` -#### Other plotly.js entry points - -| Flavor | Location | -|---------------|----------| -| dist bundle | `dist/plotly-gl2d.js` | -| dist bundle (minified) | `dist/plotly-gl2d.min.js` | -| ES6 module | `import Plotly from 'plotly.js/lib/index-gl2d'` | -| CommonJS | `require('plotly.js/lib/index-gl2d')` | - - ### plotly.js mapbox The `mapbox` partial bundle contains trace modules `choroplethmapbox`, `densitymapbox`, `scatter` and `scattermapbox`. @@ -350,7 +298,7 @@ The `mapbox` partial bundle contains trace modules `choroplethmapbox`, `densitym | Tagged | https://cdn.plot.ly/plotly-mapbox-2.0.0-rc.2.js | | Tagged minified | https://cdn.plot.ly/plotly-mapbox-2.0.0-rc.2.min.js | -#### npm package (starting in `v1.39.0`) +#### npm package Install [`plotly.js-mapbox-dist`](https://www.npmjs.com/package/plotly.js-mapbox-dist) with ``` @@ -364,26 +312,16 @@ import Plotly from 'plotly.js-mapbox-dist' CommonJS usage: ```js -var Plotly = require('plotly.js-mapbox-dist'); +var Plotly = require('plotly.js-mapbox-dist') ``` -#### dist min npm package (starting in `v1.50.0`) +#### dist-min npm package Install [`plotly.js-mapbox-dist-min`](https://www.npmjs.com/package/plotly.js-mapbox-dist-min) with ``` npm install plotly.js-mapbox-dist-min ``` -#### Other plotly.js entry points - -| Flavor | Location | -|---------------|----------| -| dist bundle | `dist/plotly-mapbox.js` | -| dist bundle (minified) | `dist/plotly-mapbox.min.js` | -| ES6 module | `import Plotly from 'plotly.js/lib/index-mapbox'` | -| CommonJS | `require('plotly.js/lib/index-mapbox')` | - - ### plotly.js finance The `finance` partial bundle contains trace modules `bar`, `candlestick`, `funnel`, `funnelarea`, `histogram`, `indicator`, `ohlc`, `pie`, `scatter` and `waterfall`. @@ -401,7 +339,7 @@ The `finance` partial bundle contains trace modules `bar`, `candlestick`, `funne | Tagged | https://cdn.plot.ly/plotly-finance-2.0.0-rc.2.js | | Tagged minified | https://cdn.plot.ly/plotly-finance-2.0.0-rc.2.min.js | -#### npm package (starting in `v1.39.0`) +#### npm package Install [`plotly.js-finance-dist`](https://www.npmjs.com/package/plotly.js-finance-dist) with ``` @@ -415,26 +353,16 @@ import Plotly from 'plotly.js-finance-dist' CommonJS usage: ```js -var Plotly = require('plotly.js-finance-dist'); +var Plotly = require('plotly.js-finance-dist') ``` -#### dist min npm package (starting in `v1.50.0`) +#### dist-min npm package Install [`plotly.js-finance-dist-min`](https://www.npmjs.com/package/plotly.js-finance-dist-min) with ``` npm install plotly.js-finance-dist-min ``` -#### Other plotly.js entry points - -| Flavor | Location | -|---------------|----------| -| dist bundle | `dist/plotly-finance.js` | -| dist bundle (minified) | `dist/plotly-finance.min.js` | -| ES6 module | `import Plotly from 'plotly.js/lib/index-finance'` | -| CommonJS | `require('plotly.js/lib/index-finance')` | - - ### plotly.js strict The `strict` partial bundle contains trace modules `bar`, `barpolar`, `box`, `candlestick`, `carpet`, `choropleth`, `choroplethmapbox`, `contour`, `contourcarpet`, `densitymapbox`, `funnel`, `funnelarea`, `heatmap`, `histogram`, `histogram2d`, `histogram2dcontour`, `image`, `indicator`, `ohlc`, `parcats`, `parcoords`, `pie`, `sankey`, `scatter`, `scattercarpet`, `scattergeo`, `scattergl`, `scattermapbox`, `scatterpolar`, `scatterpolargl`, `scatterternary`, `splom`, `sunburst`, `table`, `treemap`, `violin` and `waterfall`. @@ -452,7 +380,7 @@ The `strict` partial bundle contains trace modules `bar`, `barpolar`, `box`, `ca | Tagged | https://cdn.plot.ly/plotly-strict-2.0.0-rc.2.js | | Tagged minified | https://cdn.plot.ly/plotly-strict-2.0.0-rc.2.min.js | -#### npm package (starting in `v1.39.0`) +#### npm package Install [`plotly.js-strict-dist`](https://www.npmjs.com/package/plotly.js-strict-dist) with ``` @@ -466,26 +394,16 @@ import Plotly from 'plotly.js-strict-dist' CommonJS usage: ```js -var Plotly = require('plotly.js-strict-dist'); +var Plotly = require('plotly.js-strict-dist') ``` -#### dist min npm package (starting in `v1.50.0`) +#### dist-min npm package Install [`plotly.js-strict-dist-min`](https://www.npmjs.com/package/plotly.js-strict-dist-min) with ``` npm install plotly.js-strict-dist-min ``` -#### Other plotly.js entry points - -| Flavor | Location | -|---------------|----------| -| dist bundle | `dist/plotly-strict.js` | -| dist bundle (minified) | `dist/plotly-strict.min.js` | -| ES6 module | `import Plotly from 'plotly.js/lib/index-strict'` | -| CommonJS | `require('plotly.js/lib/index-strict')` | - - ---------------- _This file is auto-generated by `npm run stats`. Please do not edit this file directly._ \ No newline at end of file diff --git a/tasks/stats.js b/tasks/stats.js index cea205f45c2..6852c61cbd7 100644 --- a/tasks/stats.js +++ b/tasks/stats.js @@ -85,12 +85,12 @@ function getMainBundleInfo() { '', 'The main plotly.js bundle includes all the official (non-beta) trace modules.', '', - 'It be can imported as minified javascript', + 'It be can be imported as minified javascript', '- using dist file `dist/plotly.min.js`', '- using CDN URL ' + cdnRoot + pkgVersion + MINJS, '', 'or as raw javascript:', - '- using the `plotly.js-dist` npm package (starting in `v1.39.0`)', + '- using the `plotly.js-dist` npm package', '- using dist file `dist/plotly.js`', '- using CDN URL ' + cdnRoot + pkgVersion + JS, '- using CommonJS with `require(\'plotly.js\')`', @@ -107,17 +107,19 @@ function getMainBundleInfo() { '', '## Partial bundles', '', - 'Starting in `v1.15.0`, plotly.js also ships with several _partial_ bundles:', + 'plotly.js also ships with several _partial_ bundles:', '', partialBundlePaths.map(makeBundleHeaderInfo).join('\n'), '', - 'Starting in `v1.39.0`, each plotly.js partial bundle has a corresponding npm package with no dependencies.', + '> Each plotly.js partial bundle has a corresponding npm package with no dependencies.', '', - 'Starting in `v1.50.0`, the minified version of each partial bundle is also published to npm in a separate "dist min" package.', + '> The minified version of each partial bundle is also published to npm in a separate "dist-min" package.', '', - 'Starting in `v2.0.0`, the strict partial bundle includes everything except the traces that require function constructors.', - 'Over time we hope to include more of the remaining trace types here, after which we intend to work on other strict CSP issues ', - 'such as inline CSS that we may not be able to include in the main bundle.', + [ + '> The strict partial bundle includes everything except the traces that require function constructors.', + 'Over time we hope to include more of the remaining trace types here, after which we intend to work on other strict CSP issues', + 'such as inline CSS that we may not be able to include in the main bundle.', + ].join(' '), '' ]; } @@ -166,7 +168,7 @@ function makeBundleInfo(pathObj) { '| Tagged | ' + cdnRoot + name + '-' + pkgVersion + JS + ' |', '| Tagged minified | ' + cdnRoot + name + '-' + pkgVersion + MINJS + ' |', '', - '#### npm package (starting in `v1.39.0`)', + '#### npm package', '', 'Install [`' + pkgName + '`](https://www.npmjs.com/package/' + pkgName + ') with', '```', @@ -180,25 +182,15 @@ function makeBundleInfo(pathObj) { '', 'CommonJS usage:', '```js', - 'var Plotly = require(\'' + pkgName + '\');', + 'var Plotly = require(\'' + pkgName + '\')', '```', '', - '#### dist min npm package (starting in `v1.50.0`)', + '#### dist-min npm package', '', 'Install [`' + pkgName + '-min`](https://www.npmjs.com/package/' + pkgName + '-min) with', '```', 'npm install ' + pkgName + '-min', '```', - '', - '#### Other plotly.js entry points', - '', - '| Flavor | Location |', - '|---------------|----------|', - '| dist bundle | ' + '`dist/plotly-' + name + JS + '` |', - '| dist bundle (minified) | ' + '`dist/plotly-' + name + MINJS + '` |', - '| ES6 module | ' + '`import Plotly from \'plotly.js/lib/' + 'index-' + name + '\'`' + ' |', - '| CommonJS | ' + '`require(\'plotly.js/lib/' + 'index-' + name + '\')`' + ' |', - '', '' ].join('\n'); } From 9d929b38201fc1e4a0e96469453c395706797afa Mon Sep 17 00:00:00 2001 From: archmoj Date: Thu, 3 Jun 2021 09:46:38 -0400 Subject: [PATCH 06/10] move up dist-min --- dist/README.md | 112 ++++++++++++++++++++++++------------------------- tasks/stats.js | 14 +++---- 2 files changed, 63 insertions(+), 63 deletions(-) diff --git a/dist/README.md b/dist/README.md index 6f23e3117b5..bff54aa3dc8 100644 --- a/dist/README.md +++ b/dist/README.md @@ -93,6 +93,13 @@ The `basic` partial bundle contains trace modules `bar`, `pie` and `scatter`. | Tagged | https://cdn.plot.ly/plotly-basic-2.0.0-rc.2.js | | Tagged minified | https://cdn.plot.ly/plotly-basic-2.0.0-rc.2.min.js | + +#### dist-min npm package + +Install [`plotly.js-basic-dist-min`](https://www.npmjs.com/package/plotly.js-basic-dist-min) with +``` +npm install plotly.js-basic-dist-min +``` #### npm package Install [`plotly.js-basic-dist`](https://www.npmjs.com/package/plotly.js-basic-dist) with @@ -110,13 +117,6 @@ CommonJS usage: var Plotly = require('plotly.js-basic-dist') ``` -#### dist-min npm package - -Install [`plotly.js-basic-dist-min`](https://www.npmjs.com/package/plotly.js-basic-dist-min) with -``` -npm install plotly.js-basic-dist-min -``` - ### plotly.js cartesian The `cartesian` partial bundle contains trace modules `bar`, `box`, `contour`, `heatmap`, `histogram`, `histogram2d`, `histogram2dcontour`, `image`, `pie`, `scatter`, `scatterternary` and `violin`. @@ -134,6 +134,13 @@ The `cartesian` partial bundle contains trace modules `bar`, `box`, `contour`, ` | Tagged | https://cdn.plot.ly/plotly-cartesian-2.0.0-rc.2.js | | Tagged minified | https://cdn.plot.ly/plotly-cartesian-2.0.0-rc.2.min.js | + +#### dist-min npm package + +Install [`plotly.js-cartesian-dist-min`](https://www.npmjs.com/package/plotly.js-cartesian-dist-min) with +``` +npm install plotly.js-cartesian-dist-min +``` #### npm package Install [`plotly.js-cartesian-dist`](https://www.npmjs.com/package/plotly.js-cartesian-dist) with @@ -151,13 +158,6 @@ CommonJS usage: var Plotly = require('plotly.js-cartesian-dist') ``` -#### dist-min npm package - -Install [`plotly.js-cartesian-dist-min`](https://www.npmjs.com/package/plotly.js-cartesian-dist-min) with -``` -npm install plotly.js-cartesian-dist-min -``` - ### plotly.js geo The `geo` partial bundle contains trace modules `choropleth`, `scatter` and `scattergeo`. @@ -175,6 +175,13 @@ The `geo` partial bundle contains trace modules `choropleth`, `scatter` and `sca | Tagged | https://cdn.plot.ly/plotly-geo-2.0.0-rc.2.js | | Tagged minified | https://cdn.plot.ly/plotly-geo-2.0.0-rc.2.min.js | + +#### dist-min npm package + +Install [`plotly.js-geo-dist-min`](https://www.npmjs.com/package/plotly.js-geo-dist-min) with +``` +npm install plotly.js-geo-dist-min +``` #### npm package Install [`plotly.js-geo-dist`](https://www.npmjs.com/package/plotly.js-geo-dist) with @@ -192,13 +199,6 @@ CommonJS usage: var Plotly = require('plotly.js-geo-dist') ``` -#### dist-min npm package - -Install [`plotly.js-geo-dist-min`](https://www.npmjs.com/package/plotly.js-geo-dist-min) with -``` -npm install plotly.js-geo-dist-min -``` - ### plotly.js gl3d The `gl3d` partial bundle contains trace modules `cone`, `isosurface`, `mesh3d`, `scatter`, `scatter3d`, `streamtube`, `surface` and `volume`. @@ -216,6 +216,13 @@ The `gl3d` partial bundle contains trace modules `cone`, `isosurface`, `mesh3d`, | Tagged | https://cdn.plot.ly/plotly-gl3d-2.0.0-rc.2.js | | Tagged minified | https://cdn.plot.ly/plotly-gl3d-2.0.0-rc.2.min.js | + +#### dist-min npm package + +Install [`plotly.js-gl3d-dist-min`](https://www.npmjs.com/package/plotly.js-gl3d-dist-min) with +``` +npm install plotly.js-gl3d-dist-min +``` #### npm package Install [`plotly.js-gl3d-dist`](https://www.npmjs.com/package/plotly.js-gl3d-dist) with @@ -233,13 +240,6 @@ CommonJS usage: var Plotly = require('plotly.js-gl3d-dist') ``` -#### dist-min npm package - -Install [`plotly.js-gl3d-dist-min`](https://www.npmjs.com/package/plotly.js-gl3d-dist-min) with -``` -npm install plotly.js-gl3d-dist-min -``` - ### plotly.js gl2d The `gl2d` partial bundle contains trace modules `heatmapgl`, `parcoords`, `pointcloud`, `scatter`, `scattergl` and `splom`. @@ -257,6 +257,13 @@ The `gl2d` partial bundle contains trace modules `heatmapgl`, `parcoords`, `poin | Tagged | https://cdn.plot.ly/plotly-gl2d-2.0.0-rc.2.js | | Tagged minified | https://cdn.plot.ly/plotly-gl2d-2.0.0-rc.2.min.js | + +#### dist-min npm package + +Install [`plotly.js-gl2d-dist-min`](https://www.npmjs.com/package/plotly.js-gl2d-dist-min) with +``` +npm install plotly.js-gl2d-dist-min +``` #### npm package Install [`plotly.js-gl2d-dist`](https://www.npmjs.com/package/plotly.js-gl2d-dist) with @@ -274,13 +281,6 @@ CommonJS usage: var Plotly = require('plotly.js-gl2d-dist') ``` -#### dist-min npm package - -Install [`plotly.js-gl2d-dist-min`](https://www.npmjs.com/package/plotly.js-gl2d-dist-min) with -``` -npm install plotly.js-gl2d-dist-min -``` - ### plotly.js mapbox The `mapbox` partial bundle contains trace modules `choroplethmapbox`, `densitymapbox`, `scatter` and `scattermapbox`. @@ -298,6 +298,13 @@ The `mapbox` partial bundle contains trace modules `choroplethmapbox`, `densitym | Tagged | https://cdn.plot.ly/plotly-mapbox-2.0.0-rc.2.js | | Tagged minified | https://cdn.plot.ly/plotly-mapbox-2.0.0-rc.2.min.js | + +#### dist-min npm package + +Install [`plotly.js-mapbox-dist-min`](https://www.npmjs.com/package/plotly.js-mapbox-dist-min) with +``` +npm install plotly.js-mapbox-dist-min +``` #### npm package Install [`plotly.js-mapbox-dist`](https://www.npmjs.com/package/plotly.js-mapbox-dist) with @@ -315,13 +322,6 @@ CommonJS usage: var Plotly = require('plotly.js-mapbox-dist') ``` -#### dist-min npm package - -Install [`plotly.js-mapbox-dist-min`](https://www.npmjs.com/package/plotly.js-mapbox-dist-min) with -``` -npm install plotly.js-mapbox-dist-min -``` - ### plotly.js finance The `finance` partial bundle contains trace modules `bar`, `candlestick`, `funnel`, `funnelarea`, `histogram`, `indicator`, `ohlc`, `pie`, `scatter` and `waterfall`. @@ -339,6 +339,13 @@ The `finance` partial bundle contains trace modules `bar`, `candlestick`, `funne | Tagged | https://cdn.plot.ly/plotly-finance-2.0.0-rc.2.js | | Tagged minified | https://cdn.plot.ly/plotly-finance-2.0.0-rc.2.min.js | + +#### dist-min npm package + +Install [`plotly.js-finance-dist-min`](https://www.npmjs.com/package/plotly.js-finance-dist-min) with +``` +npm install plotly.js-finance-dist-min +``` #### npm package Install [`plotly.js-finance-dist`](https://www.npmjs.com/package/plotly.js-finance-dist) with @@ -356,13 +363,6 @@ CommonJS usage: var Plotly = require('plotly.js-finance-dist') ``` -#### dist-min npm package - -Install [`plotly.js-finance-dist-min`](https://www.npmjs.com/package/plotly.js-finance-dist-min) with -``` -npm install plotly.js-finance-dist-min -``` - ### plotly.js strict The `strict` partial bundle contains trace modules `bar`, `barpolar`, `box`, `candlestick`, `carpet`, `choropleth`, `choroplethmapbox`, `contour`, `contourcarpet`, `densitymapbox`, `funnel`, `funnelarea`, `heatmap`, `histogram`, `histogram2d`, `histogram2dcontour`, `image`, `indicator`, `ohlc`, `parcats`, `parcoords`, `pie`, `sankey`, `scatter`, `scattercarpet`, `scattergeo`, `scattergl`, `scattermapbox`, `scatterpolar`, `scatterpolargl`, `scatterternary`, `splom`, `sunburst`, `table`, `treemap`, `violin` and `waterfall`. @@ -380,6 +380,13 @@ The `strict` partial bundle contains trace modules `bar`, `barpolar`, `box`, `ca | Tagged | https://cdn.plot.ly/plotly-strict-2.0.0-rc.2.js | | Tagged minified | https://cdn.plot.ly/plotly-strict-2.0.0-rc.2.min.js | + +#### dist-min npm package + +Install [`plotly.js-strict-dist-min`](https://www.npmjs.com/package/plotly.js-strict-dist-min) with +``` +npm install plotly.js-strict-dist-min +``` #### npm package Install [`plotly.js-strict-dist`](https://www.npmjs.com/package/plotly.js-strict-dist) with @@ -397,13 +404,6 @@ CommonJS usage: var Plotly = require('plotly.js-strict-dist') ``` -#### dist-min npm package - -Install [`plotly.js-strict-dist-min`](https://www.npmjs.com/package/plotly.js-strict-dist-min) with -``` -npm install plotly.js-strict-dist-min -``` - ---------------- _This file is auto-generated by `npm run stats`. Please do not edit this file directly._ \ No newline at end of file diff --git a/tasks/stats.js b/tasks/stats.js index 6852c61cbd7..f3b41cdd1d5 100644 --- a/tasks/stats.js +++ b/tasks/stats.js @@ -168,6 +168,13 @@ function makeBundleInfo(pathObj) { '| Tagged | ' + cdnRoot + name + '-' + pkgVersion + JS + ' |', '| Tagged minified | ' + cdnRoot + name + '-' + pkgVersion + MINJS + ' |', '', + '', + '#### dist-min npm package', + '', + 'Install [`' + pkgName + '-min`](https://www.npmjs.com/package/' + pkgName + '-min) with', + '```', + 'npm install ' + pkgName + '-min', + '```', '#### npm package', '', 'Install [`' + pkgName + '`](https://www.npmjs.com/package/' + pkgName + ') with', @@ -184,13 +191,6 @@ function makeBundleInfo(pathObj) { '```js', 'var Plotly = require(\'' + pkgName + '\')', '```', - '', - '#### dist-min npm package', - '', - 'Install [`' + pkgName + '-min`](https://www.npmjs.com/package/' + pkgName + '-min) with', - '```', - 'npm install ' + pkgName + '-min', - '```', '' ].join('\n'); } From 4da8c59f7c62b919e38751c4aa857dc3b72bda04 Mon Sep 17 00:00:00 2001 From: archmoj Date: Thu, 3 Jun 2021 10:00:34 -0400 Subject: [PATCH 07/10] revise stats and cleanup extra info --- dist/README.md | 253 ++++++++++--------------------------------------- tasks/stats.js | 48 +++------- 2 files changed, 67 insertions(+), 234 deletions(-) diff --git a/dist/README.md b/dist/README.md index bff54aa3dc8..2fcf114632d 100644 --- a/dist/README.md +++ b/dist/README.md @@ -37,21 +37,15 @@ Plotly.newPlot(graphDiv, data, layout, {locale: 'de-CH'}) # Bundle information -The main plotly.js bundle includes all the official (non-beta) trace modules. +The main plotly.js bundle includes all trace modules. It be can be imported as minified javascript - using dist file `dist/plotly.min.js` - using CDN URL https://cdn.plot.ly/plotly-2.0.0-rc.2.min.js -or as raw javascript: -- using the `plotly.js-dist` npm package -- using dist file `dist/plotly.js` -- using CDN URL https://cdn.plot.ly/plotly-2.0.0-rc.2.js -- using CommonJS with `require('plotly.js')` - If you would like to have access to the attribute meta information (including attribute descriptions as on the [schema reference page](https://plotly.com/javascript/reference/)), use dist file `dist/plotly-with-meta.js` -The main plotly.js bundle weights in at: +The main plotly.js bundles weight in at: | plotly.js | plotly.min.js | plotly.min.js + gzip | plotly-with-meta.js | |-----------|---------------|----------------------|---------------------| @@ -76,6 +70,8 @@ plotly.js also ships with several _partial_ bundles: > The strict partial bundle includes everything except the traces that require function constructors. Over time we hope to include more of the remaining trace types here, after which we intend to work on other strict CSP issues such as inline CSS that we may not be able to include in the main bundle. +--- + ### plotly.js basic The `basic` partial bundle contains trace modules `bar`, `pie` and `scatter`. @@ -87,35 +83,17 @@ The `basic` partial bundle contains trace modules `bar`, `pie` and `scatter`. | 2.7 MB | 1003.6 kB | 325.9 kB | #### CDN links +> https://cdn.plot.ly/plotly-basic-2.0.0-rc.2.js -| Flavor | URL | -| ------ | --- | -| Tagged | https://cdn.plot.ly/plotly-basic-2.0.0-rc.2.js | -| Tagged minified | https://cdn.plot.ly/plotly-basic-2.0.0-rc.2.min.js | +> https://cdn.plot.ly/plotly-basic-2.0.0-rc.2.min.js -#### dist-min npm package +#### npm packages +> [plotly.js-basic-dist](https://www.npmjs.com/package/plotly.js-basic-dist) -Install [`plotly.js-basic-dist-min`](https://www.npmjs.com/package/plotly.js-basic-dist-min) with -``` -npm install plotly.js-basic-dist-min -``` -#### npm package +> [plotly.js-basic-dist-min](https://www.npmjs.com/package/plotly.js-basic-dist-min) -Install [`plotly.js-basic-dist`](https://www.npmjs.com/package/plotly.js-basic-dist) with -``` -npm install plotly.js-basic-dist -``` - -ES6 module usage: -```js -import Plotly from 'plotly.js-basic-dist' -``` - -CommonJS usage: -```js -var Plotly = require('plotly.js-basic-dist') -``` +--- ### plotly.js cartesian @@ -128,35 +106,17 @@ The `cartesian` partial bundle contains trace modules `bar`, `box`, `contour`, ` | 3.3 MB | 1.2 MB | 397.1 kB | #### CDN links +> https://cdn.plot.ly/plotly-cartesian-2.0.0-rc.2.js -| Flavor | URL | -| ------ | --- | -| Tagged | https://cdn.plot.ly/plotly-cartesian-2.0.0-rc.2.js | -| Tagged minified | https://cdn.plot.ly/plotly-cartesian-2.0.0-rc.2.min.js | +> https://cdn.plot.ly/plotly-cartesian-2.0.0-rc.2.min.js -#### dist-min npm package +#### npm packages +> [plotly.js-cartesian-dist](https://www.npmjs.com/package/plotly.js-cartesian-dist) -Install [`plotly.js-cartesian-dist-min`](https://www.npmjs.com/package/plotly.js-cartesian-dist-min) with -``` -npm install plotly.js-cartesian-dist-min -``` -#### npm package - -Install [`plotly.js-cartesian-dist`](https://www.npmjs.com/package/plotly.js-cartesian-dist) with -``` -npm install plotly.js-cartesian-dist -``` +> [plotly.js-cartesian-dist-min](https://www.npmjs.com/package/plotly.js-cartesian-dist-min) -ES6 module usage: -```js -import Plotly from 'plotly.js-cartesian-dist' -``` - -CommonJS usage: -```js -var Plotly = require('plotly.js-cartesian-dist') -``` +--- ### plotly.js geo @@ -169,35 +129,17 @@ The `geo` partial bundle contains trace modules `choropleth`, `scatter` and `sca | 2.8 MB | 1 MB | 335.7 kB | #### CDN links +> https://cdn.plot.ly/plotly-geo-2.0.0-rc.2.js -| Flavor | URL | -| ------ | --- | -| Tagged | https://cdn.plot.ly/plotly-geo-2.0.0-rc.2.js | -| Tagged minified | https://cdn.plot.ly/plotly-geo-2.0.0-rc.2.min.js | - - -#### dist-min npm package +> https://cdn.plot.ly/plotly-geo-2.0.0-rc.2.min.js -Install [`plotly.js-geo-dist-min`](https://www.npmjs.com/package/plotly.js-geo-dist-min) with -``` -npm install plotly.js-geo-dist-min -``` -#### npm package -Install [`plotly.js-geo-dist`](https://www.npmjs.com/package/plotly.js-geo-dist) with -``` -npm install plotly.js-geo-dist -``` +#### npm packages +> [plotly.js-geo-dist](https://www.npmjs.com/package/plotly.js-geo-dist) -ES6 module usage: -```js -import Plotly from 'plotly.js-geo-dist' -``` +> [plotly.js-geo-dist-min](https://www.npmjs.com/package/plotly.js-geo-dist-min) -CommonJS usage: -```js -var Plotly = require('plotly.js-geo-dist') -``` +--- ### plotly.js gl3d @@ -210,35 +152,17 @@ The `gl3d` partial bundle contains trace modules `cone`, `isosurface`, `mesh3d`, | 3.8 MB | 1.5 MB | 481.3 kB | #### CDN links +> https://cdn.plot.ly/plotly-gl3d-2.0.0-rc.2.js -| Flavor | URL | -| ------ | --- | -| Tagged | https://cdn.plot.ly/plotly-gl3d-2.0.0-rc.2.js | -| Tagged minified | https://cdn.plot.ly/plotly-gl3d-2.0.0-rc.2.min.js | - - -#### dist-min npm package +> https://cdn.plot.ly/plotly-gl3d-2.0.0-rc.2.min.js -Install [`plotly.js-gl3d-dist-min`](https://www.npmjs.com/package/plotly.js-gl3d-dist-min) with -``` -npm install plotly.js-gl3d-dist-min -``` -#### npm package -Install [`plotly.js-gl3d-dist`](https://www.npmjs.com/package/plotly.js-gl3d-dist) with -``` -npm install plotly.js-gl3d-dist -``` +#### npm packages +> [plotly.js-gl3d-dist](https://www.npmjs.com/package/plotly.js-gl3d-dist) -ES6 module usage: -```js -import Plotly from 'plotly.js-gl3d-dist' -``` +> [plotly.js-gl3d-dist-min](https://www.npmjs.com/package/plotly.js-gl3d-dist-min) -CommonJS usage: -```js -var Plotly = require('plotly.js-gl3d-dist') -``` +--- ### plotly.js gl2d @@ -251,35 +175,17 @@ The `gl2d` partial bundle contains trace modules `heatmapgl`, `parcoords`, `poin | 3.8 MB | 1.5 MB | 501.8 kB | #### CDN links +> https://cdn.plot.ly/plotly-gl2d-2.0.0-rc.2.js -| Flavor | URL | -| ------ | --- | -| Tagged | https://cdn.plot.ly/plotly-gl2d-2.0.0-rc.2.js | -| Tagged minified | https://cdn.plot.ly/plotly-gl2d-2.0.0-rc.2.min.js | - +> https://cdn.plot.ly/plotly-gl2d-2.0.0-rc.2.min.js -#### dist-min npm package -Install [`plotly.js-gl2d-dist-min`](https://www.npmjs.com/package/plotly.js-gl2d-dist-min) with -``` -npm install plotly.js-gl2d-dist-min -``` -#### npm package +#### npm packages +> [plotly.js-gl2d-dist](https://www.npmjs.com/package/plotly.js-gl2d-dist) -Install [`plotly.js-gl2d-dist`](https://www.npmjs.com/package/plotly.js-gl2d-dist) with -``` -npm install plotly.js-gl2d-dist -``` +> [plotly.js-gl2d-dist-min](https://www.npmjs.com/package/plotly.js-gl2d-dist-min) -ES6 module usage: -```js -import Plotly from 'plotly.js-gl2d-dist' -``` - -CommonJS usage: -```js -var Plotly = require('plotly.js-gl2d-dist') -``` +--- ### plotly.js mapbox @@ -292,35 +198,17 @@ The `mapbox` partial bundle contains trace modules `choroplethmapbox`, `densitym | 4.3 MB | 1.7 MB | 523.4 kB | #### CDN links +> https://cdn.plot.ly/plotly-mapbox-2.0.0-rc.2.js -| Flavor | URL | -| ------ | --- | -| Tagged | https://cdn.plot.ly/plotly-mapbox-2.0.0-rc.2.js | -| Tagged minified | https://cdn.plot.ly/plotly-mapbox-2.0.0-rc.2.min.js | +> https://cdn.plot.ly/plotly-mapbox-2.0.0-rc.2.min.js -#### dist-min npm package +#### npm packages +> [plotly.js-mapbox-dist](https://www.npmjs.com/package/plotly.js-mapbox-dist) -Install [`plotly.js-mapbox-dist-min`](https://www.npmjs.com/package/plotly.js-mapbox-dist-min) with -``` -npm install plotly.js-mapbox-dist-min -``` -#### npm package - -Install [`plotly.js-mapbox-dist`](https://www.npmjs.com/package/plotly.js-mapbox-dist) with -``` -npm install plotly.js-mapbox-dist -``` +> [plotly.js-mapbox-dist-min](https://www.npmjs.com/package/plotly.js-mapbox-dist-min) -ES6 module usage: -```js -import Plotly from 'plotly.js-mapbox-dist' -``` - -CommonJS usage: -```js -var Plotly = require('plotly.js-mapbox-dist') -``` +--- ### plotly.js finance @@ -333,35 +221,17 @@ The `finance` partial bundle contains trace modules `bar`, `candlestick`, `funne | 2.9 MB | 1.1 MB | 352 kB | #### CDN links +> https://cdn.plot.ly/plotly-finance-2.0.0-rc.2.js -| Flavor | URL | -| ------ | --- | -| Tagged | https://cdn.plot.ly/plotly-finance-2.0.0-rc.2.js | -| Tagged minified | https://cdn.plot.ly/plotly-finance-2.0.0-rc.2.min.js | +> https://cdn.plot.ly/plotly-finance-2.0.0-rc.2.min.js -#### dist-min npm package +#### npm packages +> [plotly.js-finance-dist](https://www.npmjs.com/package/plotly.js-finance-dist) -Install [`plotly.js-finance-dist-min`](https://www.npmjs.com/package/plotly.js-finance-dist-min) with -``` -npm install plotly.js-finance-dist-min -``` -#### npm package - -Install [`plotly.js-finance-dist`](https://www.npmjs.com/package/plotly.js-finance-dist) with -``` -npm install plotly.js-finance-dist -``` +> [plotly.js-finance-dist-min](https://www.npmjs.com/package/plotly.js-finance-dist-min) -ES6 module usage: -```js -import Plotly from 'plotly.js-finance-dist' -``` - -CommonJS usage: -```js -var Plotly = require('plotly.js-finance-dist') -``` +--- ### plotly.js strict @@ -374,36 +244,17 @@ The `strict` partial bundle contains trace modules `bar`, `barpolar`, `box`, `ca | 6.6 MB | 2.8 MB | 835.8 kB | #### CDN links +> https://cdn.plot.ly/plotly-strict-2.0.0-rc.2.js -| Flavor | URL | -| ------ | --- | -| Tagged | https://cdn.plot.ly/plotly-strict-2.0.0-rc.2.js | -| Tagged minified | https://cdn.plot.ly/plotly-strict-2.0.0-rc.2.min.js | +> https://cdn.plot.ly/plotly-strict-2.0.0-rc.2.min.js -#### dist-min npm package +#### npm packages +> [plotly.js-strict-dist](https://www.npmjs.com/package/plotly.js-strict-dist) -Install [`plotly.js-strict-dist-min`](https://www.npmjs.com/package/plotly.js-strict-dist-min) with -``` -npm install plotly.js-strict-dist-min -``` -#### npm package - -Install [`plotly.js-strict-dist`](https://www.npmjs.com/package/plotly.js-strict-dist) with -``` -npm install plotly.js-strict-dist -``` +> [plotly.js-strict-dist-min](https://www.npmjs.com/package/plotly.js-strict-dist-min) -ES6 module usage: -```js -import Plotly from 'plotly.js-strict-dist' -``` - -CommonJS usage: -```js -var Plotly = require('plotly.js-strict-dist') -``` +--- ----------------- _This file is auto-generated by `npm run stats`. Please do not edit this file directly._ \ No newline at end of file diff --git a/tasks/stats.js b/tasks/stats.js index f3b41cdd1d5..19b8266b9ea 100644 --- a/tasks/stats.js +++ b/tasks/stats.js @@ -83,23 +83,17 @@ function getMainBundleInfo() { return [ '# Bundle information', '', - 'The main plotly.js bundle includes all the official (non-beta) trace modules.', + 'The main plotly.js bundle includes all trace modules.', '', 'It be can be imported as minified javascript', '- using dist file `dist/plotly.min.js`', '- using CDN URL ' + cdnRoot + pkgVersion + MINJS, '', - 'or as raw javascript:', - '- using the `plotly.js-dist` npm package', - '- using dist file `dist/plotly.js`', - '- using CDN URL ' + cdnRoot + pkgVersion + JS, - '- using CommonJS with `require(\'plotly.js\')`', - '', 'If you would like to have access to the attribute meta information ' + '(including attribute descriptions as on the [schema reference page](https://plotly.com/javascript/reference/)), ' + 'use dist file `dist/plotly-with-meta.js`', '', - 'The main plotly.js bundle weights in at:', + 'The main plotly.js bundles weight in at:', '', '| plotly.js | plotly.min.js | plotly.min.js + gzip | plotly-with-meta.js |', '|-----------|---------------|----------------------|---------------------|', @@ -120,6 +114,8 @@ function getMainBundleInfo() { 'Over time we hope to include more of the remaining trace types here, after which we intend to work on other strict CSP issues', 'such as inline CSS that we may not be able to include in the main bundle.', ].join(' '), + '', + '---', '' ]; } @@ -132,7 +128,6 @@ function getPartialBundleInfo() { // footer info function getFooter() { return [ - '----------------', '', '_This file is auto-generated by `npm run stats`. ' + 'Please do not edit this file directly._' @@ -144,11 +139,16 @@ function makeBundleHeaderInfo(pathObj) { return '- [' + name + '](#plotlyjs-' + name + ')'; } +function createLink(base, name) { + return '[' + name + '](' + base + name + ')'; +} + function makeBundleInfo(pathObj) { var name = pathObj.name; var sizes = findSizes(pathObj); var traceList = pathObj.traceList; var pkgName = 'plotly.js-' + name + '-dist'; + var nameVersion = name + '-' + pkgVersion; return [ '### plotly.js ' + name, @@ -162,35 +162,17 @@ function makeBundleInfo(pathObj) { '| ' + sizes.raw + ' | ' + sizes.minified + ' | ' + sizes.gzipped + ' |', '', '#### CDN links', + '> ' + cdnRoot + nameVersion + JS, '', - '| Flavor | URL |', - '| ------ | --- |', - '| Tagged | ' + cdnRoot + name + '-' + pkgVersion + JS + ' |', - '| Tagged minified | ' + cdnRoot + name + '-' + pkgVersion + MINJS + ' |', + '> ' + cdnRoot + nameVersion + MINJS, '', '', - '#### dist-min npm package', - '', - 'Install [`' + pkgName + '-min`](https://www.npmjs.com/package/' + pkgName + '-min) with', - '```', - 'npm install ' + pkgName + '-min', - '```', - '#### npm package', - '', - 'Install [`' + pkgName + '`](https://www.npmjs.com/package/' + pkgName + ') with', - '```', - 'npm install ' + pkgName, - '```', + '#### npm packages', + '> ' + createLink('https://www.npmjs.com/package/', pkgName), '', - 'ES6 module usage:', - '```js', - 'import Plotly from \'' + pkgName + '\'', - '```', + '> ' + createLink('https://www.npmjs.com/package/', pkgName + '-min'), '', - 'CommonJS usage:', - '```js', - 'var Plotly = require(\'' + pkgName + '\')', - '```', + '---', '' ].join('\n'); } From 4bc79dd058379a897ff6c597d787228cfa953c27 Mon Sep 17 00:00:00 2001 From: archmoj Date: Thu, 3 Jun 2021 10:36:31 -0400 Subject: [PATCH 08/10] rename and use dist in function and variable names --- tasks/stats.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tasks/stats.js b/tasks/stats.js index 19b8266b9ea..0af654aa1e6 100644 --- a/tasks/stats.js +++ b/tasks/stats.js @@ -122,7 +122,7 @@ function getMainBundleInfo() { // info about partial bundles function getPartialBundleInfo() { - return partialBundlePaths.map(makeBundleInfo); + return partialBundlePaths.map(distBundleInfo); } // footer info @@ -143,11 +143,11 @@ function createLink(base, name) { return '[' + name + '](' + base + name + ')'; } -function makeBundleInfo(pathObj) { +function distBundleInfo(pathObj) { var name = pathObj.name; var sizes = findSizes(pathObj); var traceList = pathObj.traceList; - var pkgName = 'plotly.js-' + name + '-dist'; + var nameDist = 'plotly.js-' + name + '-dist'; var nameVersion = name + '-' + pkgVersion; return [ @@ -168,9 +168,9 @@ function makeBundleInfo(pathObj) { '', '', '#### npm packages', - '> ' + createLink('https://www.npmjs.com/package/', pkgName), + '> ' + createLink('https://www.npmjs.com/package/', nameDist), '', - '> ' + createLink('https://www.npmjs.com/package/', pkgName + '-min'), + '> ' + createLink('https://www.npmjs.com/package/', nameDist + '-min'), '', '---', '' From a2bccfd7bd7b852db99180e675789475640d8330 Mon Sep 17 00:00:00 2001 From: archmoj Date: Thu, 3 Jun 2021 10:59:13 -0400 Subject: [PATCH 09/10] add npm and CDN links for main bundles --- dist/README.md | 25 ++++++++++++++++++------- tasks/stats.js | 31 ++++++++++++++++++++++--------- 2 files changed, 40 insertions(+), 16 deletions(-) diff --git a/dist/README.md b/dist/README.md index 2fcf114632d..557f925f1ff 100644 --- a/dist/README.md +++ b/dist/README.md @@ -1,6 +1,6 @@ # Using distributed files -All plotly.js dist bundles inject an object `Plotly` into the global scope. +All plotly.js bundles inject an object `Plotly` into the global scope. Import plotly.js as: @@ -39,18 +39,29 @@ Plotly.newPlot(graphDiv, data, layout, {locale: 'de-CH'}) The main plotly.js bundle includes all trace modules. -It be can be imported as minified javascript -- using dist file `dist/plotly.min.js` -- using CDN URL https://cdn.plot.ly/plotly-2.0.0-rc.2.min.js - -If you would like to have access to the attribute meta information (including attribute descriptions as on the [schema reference page](https://plotly.com/javascript/reference/)), use dist file `dist/plotly-with-meta.js` - The main plotly.js bundles weight in at: | plotly.js | plotly.min.js | plotly.min.js + gzip | plotly-with-meta.js | |-----------|---------------|----------------------|---------------------| | 7.9 MB | 3.3 MB | 1015.1 kB | 8.2 MB | +#### CDN links +> https://cdn.plot.ly/plotly-2.0.0-rc.2.js + +> https://cdn.plot.ly/plotly-2.0.0-rc.2.min.js + + +#### npm packages +> [plotly.js](https://www.npmjs.com/package/plotly.js) + +> [plotly.js-dist](https://www.npmjs.com/package/plotly.js-dist) + +> [plotly.js-dist-min](https://www.npmjs.com/package/plotly.js-dist-min) + +#### Meta information +> If you would like to have access to the attribute meta information (including attribute descriptions as on the [schema reference page](https://plotly.com/javascript/reference/)), use dist file `dist/plotly-with-meta.js` +--- + ## Partial bundles plotly.js also ships with several _partial_ bundles: diff --git a/tasks/stats.js b/tasks/stats.js index 0af654aa1e6..0a65b42517a 100644 --- a/tasks/stats.js +++ b/tasks/stats.js @@ -34,7 +34,7 @@ function getInfoContent() { return [ '# Using distributed files', '', - 'All plotly.js dist bundles inject an object `Plotly` into the global scope.', + 'All plotly.js bundles inject an object `Plotly` into the global scope.', '', 'Import plotly.js as:', '', @@ -85,20 +85,33 @@ function getMainBundleInfo() { '', 'The main plotly.js bundle includes all trace modules.', '', - 'It be can be imported as minified javascript', - '- using dist file `dist/plotly.min.js`', - '- using CDN URL ' + cdnRoot + pkgVersion + MINJS, - '', - 'If you would like to have access to the attribute meta information ' + - '(including attribute descriptions as on the [schema reference page](https://plotly.com/javascript/reference/)), ' + - 'use dist file `dist/plotly-with-meta.js`', - '', 'The main plotly.js bundles weight in at:', '', '| plotly.js | plotly.min.js | plotly.min.js + gzip | plotly-with-meta.js |', '|-----------|---------------|----------------------|---------------------|', '| ' + mainSizes.raw + ' | ' + mainSizes.minified + ' | ' + mainSizes.gzipped + ' | ' + mainSizes.withMeta + ' |', '', + '#### CDN links', + '> ' + cdnRoot + pkgVersion + JS, + '', + '> ' + cdnRoot + pkgVersion + MINJS, + '', + '', + '#### npm packages', + '> ' + createLink('https://www.npmjs.com/package/', 'plotly.js'), + '', + '> ' + createLink('https://www.npmjs.com/package/', 'plotly.js-dist'), + '', + '> ' + createLink('https://www.npmjs.com/package/', 'plotly.js-dist-min'), + '', + '#### Meta information', + [ + '> If you would like to have access to the attribute meta information', + '(including attribute descriptions as on the [schema reference page](https://plotly.com/javascript/reference/)),', + 'use dist file `dist/plotly-with-meta.js`' + ].join(' '), + '---', + '', '## Partial bundles', '', 'plotly.js also ships with several _partial_ bundles:', From d6b5498ba74636fea93a2da813413acdb270618f Mon Sep 17 00:00:00 2001 From: archmoj Date: Thu, 3 Jun 2021 16:36:02 -0400 Subject: [PATCH 10/10] add CUSTOM_BUNDLE file, how to install deps, more edits --- BUILDING.md | 11 +++++---- CUSTOM_BUNDLE.md | 56 ++++++++++++++++++++++++++++++++++++++++++++ README.md | 45 +---------------------------------- tasks/test_syntax.js | 1 + 4 files changed, 64 insertions(+), 49 deletions(-) create mode 100644 CUSTOM_BUNDLE.md diff --git a/BUILDING.md b/BUILDING.md index 5f5e9299a86..c609c64c123 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -1,5 +1,7 @@ # Alternative ways to require or build plotly.js -Depending on your needs, to bundle plotly.js into your application one of [the browserified distributed plotly.js packages](https://github.com/plotly/plotly.js/blob/master/dist/README.md) on npm could be used. +Depending on your needs you may require/import one of [the distributed plotly.js packages](https://github.com/plotly/plotly.js/blob/master/dist/README.md) or [a plotly.js/lib index file](https://github.com/plotly/plotly.js/tree/master/lib) and integrate it into your application. + +The sections below provide additional info in respect to alternative building frameworks. ## Browserify example @@ -16,10 +18,7 @@ then simply run browserify index.js > bundle.js ``` - - -The sections below provide additional info in respect to alternative building frameworks. - +--- ## Webpack For plotly.js to build with Webpack you will need to install [ify-loader@v1.1.0+](https://github.com/hughsk/ify-loader) and add it to your `webpack.config.json`. This adds Browserify transform compatibility to Webpack which is necessary for some plotly.js dependencies. @@ -39,6 +38,7 @@ A repo that demonstrates how to build plotly.js with Webpack can be found [here] ... ``` +--- ## Angular CLI Since Angular uses webpack under the hood and doesn't allow easily to change it's webpack configuration, there is some work needed using a `custom-webpack` builder to get things going. @@ -99,3 +99,4 @@ module.exports = { It's important to set `projects.x.architect.build.builder` and `projects.x.architect.build.options.customWebpackConfig`. If you have more projects in your `angular.json` make sure to adjust their settings accordingly. +--- diff --git a/CUSTOM_BUNDLE.md b/CUSTOM_BUNDLE.md new file mode 100644 index 00000000000..68569ce1165 --- /dev/null +++ b/CUSTOM_BUNDLE.md @@ -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-.min.js` or `plotly-.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 +``` diff --git a/README.md b/README.md index 2b962be10b4..c30c2b8f014 100644 --- a/README.md +++ b/README.md @@ -94,50 +94,7 @@ Load relevant MathJax (v2) files *Before* the plotly.js script tag: ## Bundles There are two kinds of plotly.js bundles: 1. Complete and partial official bundles that are distributed to `npm` and the `CDN`, described in [the dist README](https://github.com/plotly/plotly.js/blob/master/dist/README.md). -2. Custom bundles you can create yourself, if none of the distributed packages meet your needs. - -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. - -By default all transforms are included in the 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-.min.js` or `plotly-.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 -``` +2. Custom bundles you can create yourself to optimize the size of bundle depending on your needs. Please visit [CUSTOM_BUNDLE](https://github.com/plotly/plotly.js/blob/master/CUSTOM_BUNDLE.md) for more information. --- ## Alternative ways to require or build plotly.js diff --git a/tasks/test_syntax.js b/tasks/test_syntax.js index f6983905f30..f3eb68f7dcc 100644 --- a/tasks/test_syntax.js +++ b/tasks/test_syntax.js @@ -227,6 +227,7 @@ function assertFileNames() { base === 'CHANGELOG.md' || base === 'SECURITY.md' || base === 'BUILDING.md' || + base === 'CUSTOM_BUNDLE.md' || file.indexOf('mathjax') !== -1 ) return;