Skip to content

Commit c9a0a1b

Browse files
committed
remove transform option from bundle scripts
1 parent 1f36292 commit c9a0a1b

6 files changed

+6
-40
lines changed

CUSTOM_BUNDLE.md

+4-15
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Custom bundle
2-
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.
2+
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.
33

44
Make sure you have the versions of node/npm that's recommended:
55
- plotly.js before 2.5: Node 12/npm 6
@@ -27,7 +27,7 @@ cd plotly.js
2727
npm i
2828
```
2929

30-
By default all traces and transforms are included in the bundle if you simply run:
30+
By default all traces are included in the bundle if you simply run:
3131
```sh
3232
npm run custom-bundle
3333
```
@@ -39,16 +39,6 @@ npm run custom-bundle -- --traces scatter,scattergl,scatter3d
3939
Please note that the `scatter` trace is currently included in all bundles and cannot be removed.
4040
[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.
4141

42-
Use the `transforms` option to specify which should be included.
43-
```sh
44-
npm run custom-bundle -- --transforms sort,filter
45-
```
46-
47-
Or use `transforms none` to exclude them all.
48-
```sh
49-
npm run custom-bundle -- --transforms none
50-
```
51-
5242
Use the `strict` option to use strict trace types where possible.
5343
```sh
5444
npm run custom-bundle -- --traces scatter,scattergl --strict
@@ -66,15 +56,14 @@ npm run custom-bundle -- --unminified
6656
```
6757

6858
# Example illustrating use of different options together
69-
To create an unminified custom bundle named `myScatters` including `scatter`, `scattergl` and `scatter3d` traces without any transforms:
59+
To create an unminified custom bundle named `myScatters` including `scatter`, `scattergl` and `scatter3d` traces:
7060
```sh
7161
npm run custom-bundle -- \
7262
--unminified \
7363
--out myScatters \
7464
--traces scatter,scattergl,scatter3d \
75-
--transforms none
7665
```
7766
Or simply on one line:
7867
```sh
79-
npm run custom-bundle -- --unminified --out myScatters --traces scatter,scattergl,scatter3d --transforms none
68+
npm run custom-bundle -- --unminified --out myScatters --traces scatter,scattergl,scatter3d
8069
```

tasks/custom_bundle.mjs

-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import runSeries from 'run-series';
55
import partialBundle from './partial_bundle.mjs';
66
import constants from './util/constants.js';
77

8-
var allTransforms = constants.allTransforms;
98
var allTraces = constants.allTraces;
109

1110
function createList(outList, inList, allList, type) {
@@ -55,12 +54,10 @@ if(process.argv.length > 2) {
5554
var unminified = inputBoolean(args.unminified, false);
5655
var out = args.out ? args.out : 'custom';
5756
var traces = inputArray(args.traces, allTraces);
58-
var transforms = inputArray(args.transforms, allTransforms);
5957
var strict = inputBoolean(args.strict, false);
6058

6159
var opts = {
6260
traceList: createList(['scatter'], traces, allTraces, 'trace'),
63-
transformList: createList([], transforms, allTransforms, 'transform'),
6461

6562
name: out,
6663
index: path.join(constants.pathToLib, 'index-' + (strict ? 'strict-' : '') + out + '.js'),

tasks/extra_bundles.mjs

-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ for(var i = 0; i < list.length; i++) {
3939
dist: opts.dist,
4040
distMin: opts.distMin,
4141
traceList: opts.traceList,
42-
transformList: opts.transformList,
4342
calendars: opts.calendars
4443
});
4544
}

tasks/partial_bundle.mjs

+2-4
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import common from './util/common.js';
55
import _bundle from './util/bundle_wrapper.mjs';
66

77
var header = constants.licenseDist + '\n';
8-
var allTransforms = constants.allTransforms;
98
var allTraces = constants.allTraces;
109
var mainIndex = constants.mainIndex;
1110
var strictIndex = constants.strictIndex;
@@ -18,7 +17,6 @@ export default function partialBundle(tasks, opts) {
1817
var dist = opts.dist;
1918
var distMin = opts.distMin;
2019
var traceList = opts.traceList;
21-
var transformList = opts.transformList;
2220
var calendars = opts.calendars;
2321
var strict = opts.strict;
2422

@@ -27,8 +25,8 @@ export default function partialBundle(tasks, opts) {
2725
tasks.push(function(done) {
2826
var partialIndex = (strict) ? strictIndex : mainIndex;
2927

30-
var all = ['calendars'].concat(allTransforms).concat(allTraces);
31-
var includes = (calendars ? ['calendars'] : []).concat(transformList).concat(traceList);
28+
var all = ['calendars'].concat(allTraces);
29+
var includes = (calendars ? ['calendars'] : []).concat(traceList);
3230
var excludes = all.filter(function(e) { return includes.indexOf(e) === -1; });
3331

3432
excludes.forEach(function(t) {

tasks/preprocess.js

-9
Original file line numberDiff line numberDiff line change
@@ -52,15 +52,6 @@ function exposePartsInLib() {
5252

5353
insert('calendars', 'src/components');
5454

55-
[
56-
'aggregate',
57-
'filter',
58-
'groupby',
59-
'sort'
60-
].forEach(function(k) {
61-
insert(k, 'src/transforms');
62-
});
63-
6455
constants.allTraces.forEach(function(k) {
6556
insert(k, 'src/traces');
6657
});

tasks/util/constants.js

-8
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,6 @@ var strictIndex = fs.readFileSync(pathToPlotlyStrict, 'utf-8');
2424
var allTraces = fs.readdirSync(path.join(pathToSrc, 'traces'))
2525
.filter(startsWithLowerCase);
2626

27-
var allTransforms = fs.readdirSync(path.join(pathToSrc, 'transforms'))
28-
.filter(function(v) {
29-
return startsWithLowerCase(v) && v !== 'helpers.js';
30-
})
31-
.map(function(e) { return e.replace('.js', ''); });
32-
3327
var pathToTopojsonSrc;
3428
try {
3529
pathToTopojsonSrc = path.join(path.dirname(require.resolve('sane-topojson')), 'dist/');
@@ -162,7 +156,6 @@ function makePartialBundleOpts(name) {
162156
return {
163157
name: name,
164158
traceList: partialBundleTraces[name],
165-
transformList: allTransforms,
166159
calendars: true,
167160
index: path.join(pathToLib, 'index-' + name + '.js'),
168161
dist: path.join(pathToDist, 'plotly-' + name + '.js'),
@@ -185,7 +178,6 @@ module.exports = {
185178

186179
partialBundleTraces: partialBundleTraces,
187180

188-
allTransforms: allTransforms,
189181
allTraces: allTraces,
190182
mainIndex: mainIndex,
191183
strictIndex: strictIndex,

0 commit comments

Comments
 (0)