diff --git a/CUSTOM_BUNDLE.md b/CUSTOM_BUNDLE.md index 9ab72ceba14..4e7ebf7ba68 100644 --- a/CUSTOM_BUNDLE.md +++ b/CUSTOM_BUNDLE.md @@ -1,5 +1,5 @@ # 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. +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. Make sure you have the versions of node/npm that's recommended: - plotly.js before 2.5: Node 12/npm 6 @@ -27,7 +27,7 @@ cd plotly.js npm i ``` -By default all traces and transforms are included in the bundle if you simply run: +By default all traces are included in the bundle if you simply run: ```sh npm run custom-bundle ``` @@ -39,16 +39,6 @@ npm run custom-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 custom-bundle -- --transforms sort,filter -``` - -Or use `transforms none` to exclude them all. -```sh -npm run custom-bundle -- --transforms none -``` - Use the `strict` option to use strict trace types where possible. ```sh npm run custom-bundle -- --traces scatter,scattergl --strict @@ -66,15 +56,14 @@ npm run custom-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: +To create an unminified custom bundle named `myScatters` including `scatter`, `scattergl` and `scatter3d` traces: ```sh npm run custom-bundle -- \ --unminified \ --out myScatters \ --traces scatter,scattergl,scatter3d \ - --transforms none ``` Or simply on one line: ```sh -npm run custom-bundle -- --unminified --out myScatters --traces scatter,scattergl,scatter3d --transforms none +npm run custom-bundle -- --unminified --out myScatters --traces scatter,scattergl,scatter3d ``` diff --git a/draftlogs/7240_remove.md b/draftlogs/7240_remove.md index 5c6c224b70f..94524c63a4e 100644 --- a/draftlogs/7240_remove.md +++ b/draftlogs/7240_remove.md @@ -1 +1 @@ - - Drop transforms from the API [[#7240](https://github.com/plotly/plotly.js/pull/7240)] + - Drop transforms from the API [[#7240](https://github.com/plotly/plotly.js/pull/7240), [#7254](https://github.com/plotly/plotly.js/pull/7254)] diff --git a/lib/aggregate.js b/lib/aggregate.js deleted file mode 100644 index a076feab6c5..00000000000 --- a/lib/aggregate.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = require('../src/transforms/aggregate'); diff --git a/lib/filter.js b/lib/filter.js deleted file mode 100644 index f53c81505c3..00000000000 --- a/lib/filter.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = require('../src/transforms/filter'); diff --git a/lib/groupby.js b/lib/groupby.js deleted file mode 100644 index ca5334865b6..00000000000 --- a/lib/groupby.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = require('../src/transforms/groupby'); diff --git a/lib/index-basic.js b/lib/index-basic.js index 590f545eec0..f45984283c1 100644 --- a/lib/index-basic.js +++ b/lib/index-basic.js @@ -7,12 +7,6 @@ Plotly.register([ require('./bar'), require('./pie'), - // transforms - require('./aggregate'), - require('./filter'), - require('./groupby'), - require('./sort'), - // components require('./calendars'), ]); diff --git a/lib/index-cartesian.js b/lib/index-cartesian.js index db9855a26b6..ed559341c0c 100644 --- a/lib/index-cartesian.js +++ b/lib/index-cartesian.js @@ -16,12 +16,6 @@ Plotly.register([ require('./image'), require('./pie'), - // transforms - require('./aggregate'), - require('./filter'), - require('./groupby'), - require('./sort'), - // components require('./calendars'), ]); diff --git a/lib/index-finance.js b/lib/index-finance.js index 695fdf31cdc..0d4796bcaef 100644 --- a/lib/index-finance.js +++ b/lib/index-finance.js @@ -14,12 +14,6 @@ Plotly.register([ require('./ohlc'), require('./candlestick'), - // transforms - require('./aggregate'), - require('./filter'), - require('./groupby'), - require('./sort'), - // components require('./calendars'), ]); diff --git a/lib/index-geo.js b/lib/index-geo.js index 3dff88a6fd2..ad1cced6b19 100644 --- a/lib/index-geo.js +++ b/lib/index-geo.js @@ -7,12 +7,6 @@ Plotly.register([ require('./scattergeo'), require('./choropleth'), - // transforms - require('./aggregate'), - require('./filter'), - require('./groupby'), - require('./sort'), - // components require('./calendars'), ]); diff --git a/lib/index-gl2d.js b/lib/index-gl2d.js index 1a2410a33b1..b87672fa8ca 100644 --- a/lib/index-gl2d.js +++ b/lib/index-gl2d.js @@ -8,12 +8,6 @@ Plotly.register([ require('./splom'), require('./parcoords'), - // transforms - require('./aggregate'), - require('./filter'), - require('./groupby'), - require('./sort'), - // components require('./calendars'), ]); diff --git a/lib/index-gl3d.js b/lib/index-gl3d.js index a965c91d2d4..10b10237ee9 100644 --- a/lib/index-gl3d.js +++ b/lib/index-gl3d.js @@ -12,12 +12,6 @@ Plotly.register([ require('./cone'), require('./streamtube'), - // transforms - require('./aggregate'), - require('./filter'), - require('./groupby'), - require('./sort'), - // components require('./calendars'), ]); diff --git a/lib/index-map.js b/lib/index-map.js index 422aec7f104..49abc8cf320 100644 --- a/lib/index-map.js +++ b/lib/index-map.js @@ -8,12 +8,6 @@ Plotly.register([ require('./choroplethmap'), require('./densitymap'), - // transforms - require('./aggregate'), - require('./filter'), - require('./groupby'), - require('./sort'), - // components require('./calendars'), ]); diff --git a/lib/index-mapbox.js b/lib/index-mapbox.js index ddb69b93430..2e1e386de07 100644 --- a/lib/index-mapbox.js +++ b/lib/index-mapbox.js @@ -8,12 +8,6 @@ Plotly.register([ require('./choroplethmapbox'), require('./densitymapbox'), - // transforms - require('./aggregate'), - require('./filter'), - require('./groupby'), - require('./sort'), - // components require('./calendars'), ]); diff --git a/lib/index-strict.js b/lib/index-strict.js index 7a64e10a309..cac9738bff8 100644 --- a/lib/index-strict.js +++ b/lib/index-strict.js @@ -53,12 +53,6 @@ Plotly.register([ require('./barpolar'), require('./scattersmith'), - // transforms - require('./aggregate'), - require('./filter'), - require('./groupby'), - require('./sort'), - // components require('./calendars'), ]); diff --git a/lib/index.js b/lib/index.js index 26a2270d8c6..d4cb5bdcc87 100644 --- a/lib/index.js +++ b/lib/index.js @@ -53,12 +53,6 @@ Plotly.register([ require('./barpolar'), require('./scattersmith'), - // transforms - require('./aggregate'), - require('./filter'), - require('./groupby'), - require('./sort'), - // components require('./calendars'), ]); diff --git a/lib/sort.js b/lib/sort.js deleted file mode 100644 index 5180b3299ff..00000000000 --- a/lib/sort.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = require('../src/transforms/sort'); diff --git a/tasks/custom_bundle.mjs b/tasks/custom_bundle.mjs index 6fa490a1ed4..c5027d5cdbb 100644 --- a/tasks/custom_bundle.mjs +++ b/tasks/custom_bundle.mjs @@ -5,7 +5,6 @@ import runSeries from 'run-series'; import partialBundle from './partial_bundle.mjs'; import constants from './util/constants.js'; -var allTransforms = constants.allTransforms; var allTraces = constants.allTraces; function createList(outList, inList, allList, type) { @@ -55,12 +54,10 @@ if(process.argv.length > 2) { var unminified = inputBoolean(args.unminified, false); var out = args.out ? args.out : 'custom'; var traces = inputArray(args.traces, allTraces); - var transforms = inputArray(args.transforms, allTransforms); var strict = inputBoolean(args.strict, false); var opts = { traceList: createList(['scatter'], traces, allTraces, 'trace'), - transformList: createList([], transforms, allTransforms, 'transform'), name: out, index: path.join(constants.pathToLib, 'index-' + (strict ? 'strict-' : '') + out + '.js'), diff --git a/tasks/extra_bundles.mjs b/tasks/extra_bundles.mjs index 412b31dc9d8..49d742c7b33 100644 --- a/tasks/extra_bundles.mjs +++ b/tasks/extra_bundles.mjs @@ -39,7 +39,6 @@ for(var i = 0; i < list.length; i++) { dist: opts.dist, distMin: opts.distMin, traceList: opts.traceList, - transformList: opts.transformList, calendars: opts.calendars }); } diff --git a/tasks/partial_bundle.mjs b/tasks/partial_bundle.mjs index 9f8b868eb97..09c8ea0bfff 100644 --- a/tasks/partial_bundle.mjs +++ b/tasks/partial_bundle.mjs @@ -5,7 +5,6 @@ import common from './util/common.js'; import _bundle from './util/bundle_wrapper.mjs'; var header = constants.licenseDist + '\n'; -var allTransforms = constants.allTransforms; var allTraces = constants.allTraces; var mainIndex = constants.mainIndex; var strictIndex = constants.strictIndex; @@ -18,7 +17,6 @@ export default function partialBundle(tasks, opts) { var dist = opts.dist; var distMin = opts.distMin; var traceList = opts.traceList; - var transformList = opts.transformList; var calendars = opts.calendars; var strict = opts.strict; @@ -27,8 +25,8 @@ export default function partialBundle(tasks, opts) { tasks.push(function(done) { var partialIndex = (strict) ? strictIndex : mainIndex; - var all = ['calendars'].concat(allTransforms).concat(allTraces); - var includes = (calendars ? ['calendars'] : []).concat(transformList).concat(traceList); + var all = ['calendars'].concat(allTraces); + var includes = (calendars ? ['calendars'] : []).concat(traceList); var excludes = all.filter(function(e) { return includes.indexOf(e) === -1; }); excludes.forEach(function(t) { diff --git a/tasks/preprocess.js b/tasks/preprocess.js index 39075c178d4..2436d8add38 100644 --- a/tasks/preprocess.js +++ b/tasks/preprocess.js @@ -52,15 +52,6 @@ function exposePartsInLib() { insert('calendars', 'src/components'); - [ - 'aggregate', - 'filter', - 'groupby', - 'sort' - ].forEach(function(k) { - insert(k, 'src/transforms'); - }); - constants.allTraces.forEach(function(k) { insert(k, 'src/traces'); }); diff --git a/tasks/util/constants.js b/tasks/util/constants.js index c1a7fc96a6f..6442501d9aa 100644 --- a/tasks/util/constants.js +++ b/tasks/util/constants.js @@ -24,12 +24,6 @@ var strictIndex = fs.readFileSync(pathToPlotlyStrict, 'utf-8'); var allTraces = fs.readdirSync(path.join(pathToSrc, 'traces')) .filter(startsWithLowerCase); -var allTransforms = fs.readdirSync(path.join(pathToSrc, 'transforms')) - .filter(function(v) { - return startsWithLowerCase(v) && v !== 'helpers.js'; - }) - .map(function(e) { return e.replace('.js', ''); }); - var pathToTopojsonSrc; try { pathToTopojsonSrc = path.join(path.dirname(require.resolve('sane-topojson')), 'dist/'); @@ -162,7 +156,6 @@ function makePartialBundleOpts(name) { return { name: name, traceList: partialBundleTraces[name], - transformList: allTransforms, calendars: true, index: path.join(pathToLib, 'index-' + name + '.js'), dist: path.join(pathToDist, 'plotly-' + name + '.js'), @@ -185,7 +178,6 @@ module.exports = { partialBundleTraces: partialBundleTraces, - allTransforms: allTransforms, allTraces: allTraces, mainIndex: mainIndex, strictIndex: strictIndex, diff --git a/test/jasmine/bundle_tests/component_first_test.js b/test/jasmine/bundle_tests/component_first_test.js index 0d48da8ef86..de35faa9da6 100644 --- a/test/jasmine/bundle_tests/component_first_test.js +++ b/test/jasmine/bundle_tests/component_first_test.js @@ -1,7 +1,6 @@ var Plotly = require('../../../lib/core'); var Bar = require('../../../lib/bar'); var Scatter3d = require('../../../lib/scatter3d'); -var Filter = require('../../../lib/filter'); var Calendars = require('../../../lib/calendars'); var checkComponent = require('../assets/check_component'); @@ -9,7 +8,7 @@ var checkComponent = require('../assets/check_component'); describe('Bundle with a component loaded before traces', function() { 'use strict'; - Plotly.register([Calendars, Filter, Scatter3d, Bar]); + Plotly.register([Calendars, Scatter3d, Bar]); checkComponent(Plotly); }); diff --git a/test/jasmine/bundle_tests/component_last_test.js b/test/jasmine/bundle_tests/component_last_test.js index f3b3841f5b0..6d594c3a2a8 100644 --- a/test/jasmine/bundle_tests/component_last_test.js +++ b/test/jasmine/bundle_tests/component_last_test.js @@ -1,7 +1,6 @@ var Plotly = require('../../../lib/core'); var Bar = require('../../../lib/bar'); var Scatter3d = require('../../../lib/scatter3d'); -var Filter = require('../../../lib/filter'); var Calendars = require('../../../lib/calendars'); var checkComponent = require('../assets/check_component'); @@ -9,7 +8,7 @@ var checkComponent = require('../assets/check_component'); describe('Bundle with a component loaded after traces', function() { 'use strict'; - Plotly.register([Bar, Scatter3d, Filter, Calendars]); + Plotly.register([Bar, Scatter3d, Calendars]); checkComponent(Plotly); });