Skip to content

Commit

Permalink
Merge pull request #5413 from plotly/add-strict-bundle
Browse files Browse the repository at this point in the history
Add strict partial bundles
  • Loading branch information
archmoj authored Jan 19, 2021
2 parents e1705fd + c0a3d92 commit 83f105d
Show file tree
Hide file tree
Showing 5 changed files with 89 additions and 1 deletion.
6 changes: 6 additions & 0 deletions dist/plotly-strict.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/**
* plotly.js (strict) v2.0.0
* Copyright 2012-2021, Plotly, Inc.
* All rights reserved.
* Licensed under the MIT license
*/
6 changes: 6 additions & 0 deletions dist/plotly-strict.min.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/**
* plotly.js (strict) v2.0.0
* Copyright 2012-2021, Plotly, Inc.
* All rights reserved.
* Licensed under the MIT license
*/
72 changes: 72 additions & 0 deletions lib/index-strict.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
/**
* Copyright 2012-2021, Plotly, Inc.
* All rights reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

'use strict';

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

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

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

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

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('./barpolar')
]);

// transforms
Plotly.register([
require('./aggregate'),
require('./filter'),
require('./groupby'),
require('./sort')
]);

// components
Plotly.register([
require('./calendars')
]);

module.exports = Plotly;
4 changes: 4 additions & 0 deletions tasks/stats.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,10 @@ function getMainBundleInfo() {
'Starting in `v1.39.0`, 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.',
'',
'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.',
''
];
}
Expand Down
2 changes: 1 addition & 1 deletion tasks/util/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ try {
}

var partialBundleNames = [
'basic', 'cartesian', 'geo', 'gl3d', 'gl2d', 'mapbox', 'finance'
'basic', 'cartesian', 'geo', 'gl3d', 'gl2d', 'mapbox', 'finance', 'strict'
];

var partialBundlePaths = partialBundleNames.map(function(name) {
Expand Down

0 comments on commit 83f105d

Please sign in to comment.