Skip to content

Revise process of making bundles and simplify making partial bundles #5508

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 15 commits into from
Feb 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,13 +96,9 @@ Then elsewhere in your code:
var Plotly = require('./path/to/custom-plotly');
```

#### Non-ascii characters
Alternatively you could browserify a custom bundle of desired trace modules e.g. `pie` and `choropleth` using
`npm run partial-bundle pie choropleth --name=custom`

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:

```html
<script src="my-plotly-bundle.js" charset="utf-8"></script>
```

## Building plotly.js

Expand Down
14 changes: 12 additions & 2 deletions lib/index-basic.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,18 @@
var Plotly = require('./core');

Plotly.register([
// traces
require('./bar'),
require('./pie')
require('./pie'),

// transforms
require('./aggregate'),
require('./filter'),
require('./groupby'),
require('./sort'),

// components
require('./calendars')
]);

module.exports = require('./register_extra')(Plotly);
module.exports = Plotly;
18 changes: 14 additions & 4 deletions lib/index-cartesian.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,27 @@
var Plotly = require('./core');

Plotly.register([
// traces
require('./bar'),
require('./box'),
require('./heatmap'),
require('./histogram'),
require('./histogram2d'),
require('./histogram2dcontour'),
require('./image'),
require('./pie'),
require('./contour'),
require('./scatterternary'),
require('./violin')
require('./violin'),
require('./image'),
require('./pie'),

Copy link
Contributor Author

@archmoj archmoj Feb 22, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As you can see, image and pie used to be registered in a different order in cartesian bundles.

// transforms
require('./aggregate'),
require('./filter'),
require('./groupby'),
require('./sort'),

// components
require('./calendars')
]);

module.exports = require('./register_extra')(Plotly);
module.exports = Plotly;
18 changes: 14 additions & 4 deletions lib/index-finance.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,25 @@
var Plotly = require('./core');

Plotly.register([
// traces
require('./bar'),
require('./histogram'),
require('./funnel'),
require('./waterfall'),
require('./pie'),
require('./funnelarea'),
require('./indicator'),
require('./ohlc'),
require('./candlestick'),
require('./funnel'),
require('./waterfall'),
require('./indicator')
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As you can see, funnel and waterfall and indicator used to be registered in a different order in finance bundles.


// transforms
require('./aggregate'),
require('./filter'),
require('./groupby'),
require('./sort'),

// components
require('./calendars')
]);

module.exports = require('./register_extra')(Plotly);
module.exports = Plotly;
14 changes: 12 additions & 2 deletions lib/index-geo.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,18 @@
var Plotly = require('./core');

Plotly.register([
// traces
require('./scattergeo'),
require('./choropleth')
require('./choropleth'),

// transforms
require('./aggregate'),
require('./filter'),
require('./groupby'),
require('./sort'),

// components
require('./calendars')
]);

module.exports = require('./register_extra')(Plotly);
module.exports = Plotly;
14 changes: 12 additions & 2 deletions lib/index-gl2d.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,21 @@
var Plotly = require('./core');

Plotly.register([
// traces
require('./scattergl'),
require('./splom'),
require('./pointcloud'),
require('./heatmapgl'),
require('./parcoords')
require('./parcoords'),

// transforms
require('./aggregate'),
require('./filter'),
require('./groupby'),
require('./sort'),

// components
require('./calendars')
]);

module.exports = require('./register_extra')(Plotly);
module.exports = Plotly;
16 changes: 13 additions & 3 deletions lib/index-gl3d.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,23 @@
var Plotly = require('./core');

Plotly.register([
// traces
require('./scatter3d'),
require('./surface'),
require('./mesh3d'),
require('./isosurface'),
require('./volume'),
require('./mesh3d'),
require('./cone'),
require('./streamtube')
require('./streamtube'),

// transforms
require('./aggregate'),
require('./filter'),
require('./groupby'),
require('./sort'),

// components
require('./calendars')
]);

module.exports = require('./register_extra')(Plotly);
module.exports = Plotly;
14 changes: 12 additions & 2 deletions lib/index-mapbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,19 @@
var Plotly = require('./core');

Plotly.register([
// traces
require('./scattermapbox'),
require('./choroplethmapbox'),
require('./densitymapbox')
require('./densitymapbox'),

// transforms
require('./aggregate'),
require('./filter'),
require('./groupby'),
require('./sort'),

// components
require('./calendars')
]);

module.exports = require('./register_extra')(Plotly);
module.exports = Plotly;
25 changes: 12 additions & 13 deletions lib/index-strict.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

var Plotly = require('./core');

// traces
Plotly.register([
// traces
require('./bar'),
require('./box'),
require('./heatmap'),
Expand All @@ -16,40 +16,39 @@ Plotly.register([
require('./funnel'),
require('./waterfall'),
require('./image'),

require('./pie'),
require('./sunburst'),
require('./treemap'),
require('./funnelarea'),

require('./scattergeo'),
require('./choropleth'),

require('./scattergl'),
require('./splom'),

require('./parcoords'),
require('./parcats'),

require('./scattermapbox'),
require('./choroplethmapbox'),
require('./densitymapbox'),

require('./sankey'),
require('./indicator'),

require('./table'),

require('./carpet'),
require('./scattercarpet'),
require('./contourcarpet'),

require('./ohlc'),
require('./candlestick'),

require('./scatterpolar'),
require('./scatterpolargl'),
require('./barpolar')
require('./barpolar'),

// transforms
require('./aggregate'),
require('./filter'),
require('./groupby'),
require('./sort'),

// components
require('./calendars')
]);

module.exports = require('./register_extra')(Plotly);
module.exports = Plotly;
28 changes: 12 additions & 16 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

var Plotly = require('./core');

// traces
Plotly.register([
// traces
require('./bar'),
require('./box'),
require('./heatmap'),
Expand All @@ -16,52 +16,48 @@ Plotly.register([
require('./funnel'),
require('./waterfall'),
require('./image'),

require('./pie'),
require('./sunburst'),
require('./treemap'),
require('./funnelarea'),

require('./scatter3d'),
require('./surface'),
require('./isosurface'),
require('./volume'),
require('./mesh3d'),
require('./cone'),
require('./streamtube'),

require('./scattergeo'),
require('./choropleth'),

require('./scattergl'),
require('./splom'),

require('./pointcloud'),
require('./heatmapgl'),

require('./parcoords'),

require('./parcats'),

require('./scattermapbox'),
require('./choroplethmapbox'),
require('./densitymapbox'),

require('./sankey'),
require('./indicator'),

require('./table'),

require('./carpet'),
require('./scattercarpet'),
require('./contourcarpet'),

require('./ohlc'),
require('./candlestick'),

require('./scatterpolar'),
require('./scatterpolargl'),
require('./barpolar')
require('./barpolar'),

// transforms
require('./aggregate'),
require('./filter'),
require('./groupby'),
require('./sort'),

// components
require('./calendars')
]);

module.exports = require('./register_extra')(Plotly);
module.exports = Plotly;
27 changes: 0 additions & 27 deletions lib/register_extra.js

This file was deleted.

7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,13 @@
"plotly"
],
"scripts": {
"partial-bundle": "node tasks/partial_bundle.js",
"bundle": "node tasks/bundle.js",
"header-dist": "node tasks/header_dist.js",
"extra-bundles": "node tasks/extra_bundles.js",
"stats": "node tasks/stats.js",
"find-strings": "node tasks/find_locale_strings.js",
"preprocess": "node tasks/preprocess.js",
"build": "node tasks/empty_dist.js && npm run preprocess && npm run find-strings && npm run bundle && npm run header-dist && npm run stats",
"build": "node tasks/empty_dist.js && npm run preprocess && npm run find-strings && npm run bundle && npm run extra-bundles && npm run stats",
"cibuild": "node tasks/empty_dist.js && npm run preprocess && node tasks/cibundle.js",
"watch": "node tasks/watch.js",
"lint": "eslint --version && eslint .",
Expand All @@ -50,7 +51,7 @@
"start": "npm run start-test_dashboard",
"baseline": "node tasks/baseline.js",
"preversion": "check-node-version --node 12 --npm 6.14 && npm-link-check && npm ls --prod",
"version": "npm run build && npm run no-bad-char && git add -A dist build src/version.js",
"version": "npm run build && npm run no-bad-char && git add -A lib dist build src/version.js",
"postversion": "node -e \"console.log('Version bumped and committed. If ok, run: git push && git push --tags')\"",
"postpublish": "node tasks/sync_packages.js",
"postshrinkwrap": "chttps ."
Expand Down
Loading