Skip to content

Commit 0ff7ca5

Browse files
Merge branch 'first_poc_tickmode_sync' of https://github.com/VictorBezak/plotly.js into first_poc_tickmode_sync
2 parents 25d015c + 77dee05 commit 0ff7ca5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+1287058
-1533030
lines changed

.circleci/config.yml

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -404,14 +404,11 @@ jobs:
404404
name: Test plotly.min.js import using requirejs
405405
command: npm run test-requirejs
406406
- run:
407-
name: Test plotly bundles againt unexpected characters
408-
command: npm run no-bad-char
409-
- run:
410-
name: Display function constructors in plotly.js bundle
411-
command: npm run log-new-func
412-
- run:
413-
name: Test certain bundles against function constructors
414-
command: npm run no-new-func
407+
name: Display function constructors in all bundles (only on master)
408+
command: |
409+
if [ $CIRCLE_BRANCH == "master" ]
410+
then npm run no-new-func
411+
fi
415412
- run:
416413
name: Test plotly bundles against es6
417414
command: npm run no-es6-dist

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ build/*
44
!build/plotcss.js
55
!build/README.md
66

7+
dist/*.LICENSE.txt
8+
79
npm-debug.log*
810
*.sublime*
911
*~

BUILDING.md

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -3,41 +3,6 @@ Depending on your needs you may require/import one of [the distributed plotly.js
33

44
The sections below provide additional info in respect to alternative building frameworks.
55

6-
## Browserify example
7-
8-
Given source file:
9-
```js
10-
// file: index.js
11-
var Plotly = require('plotly.js-dist-min');
12-
// ....
13-
```
14-
15-
then simply run
16-
17-
```sh
18-
browserify index.js > bundle.js
19-
```
20-
21-
---
22-
## Webpack
23-
24-
For plotly.js to build with Webpack you will need to install [[email protected]+](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.
25-
26-
A repo that demonstrates how to build plotly.js with Webpack can be found [here](https://github.com/plotly/plotly-webpack). In short add `ify-loader` to the `module` section in your `webpack.config.js`:
27-
28-
```js
29-
...
30-
module: {
31-
rules: [
32-
{
33-
test: /\.js$/,
34-
loader: 'ify-loader'
35-
}
36-
]
37-
},
38-
...
39-
```
40-
416
---
427
## Angular CLI
438

CHANGELOG.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,23 @@ To see all merged commits on the master branch that will be part of the next plo
99

1010
where X.Y.Z is the semver of most recent plotly.js release.
1111

12+
## [2.17.0] -- 2022-12-22
13+
14+
### Added
15+
- Add `shift` and `autoshift` to cartesian y axes to help avoid overlapping of multiple axes [[#6334](https://github.com/plotly/plotly.js/pull/6334)],
16+
with thanks to [Gamma Technologies](https://www.gtisoft.com) for sponsoring the related development!
17+
- Introduce group attributes for `scatter` trace i.e. `alignmentgroup`, `offsetgroup`, `scattermode` and `scattergap` [[#6381](https://github.com/plotly/plotly.js/pull/6381)],
18+
this feature was anonymously sponsored: thank you to our sponsor!
19+
- Add `marker.cornerradius` attribute to `treemap` trace [[#6351](https://github.com/plotly/plotly.js/pull/6351)]
20+
21+
### Changed
22+
- Change bundler from browserify to webpack [[#6355](https://github.com/plotly/plotly.js/pull/6355)]
23+
24+
### Fixed
25+
- Fix auto `backoff` when marker symbols and sizes are arrays [[#6414](https://github.com/plotly/plotly.js/pull/6414)]
26+
- Avoid displaying resize cursor on static sliders [[#6397](https://github.com/plotly/plotly.js/pull/6397)]
27+
28+
1229
## [2.16.5] -- 2022-12-13
1330

1431
### Fixed

CONTRIBUTING.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -116,11 +116,7 @@ npm run pretest
116116
npm start
117117
```
118118

119-
This command bundles up the source files with source maps using
120-
[browserify](https://github.com/substack/node-browserify), starts a
121-
[watchify](https://github.com/substack/watchify) file watcher (making your
122-
dev plotly.js bundle update every time a source file is saved) and opens up a
123-
tab in your browser.
119+
This command bundles up the source files and opens up a tab in your browser.
124120

125121
#### Step 6: Open up the console and start developing
126122

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ You may also consider using [`plotly.js-dist`](https://www.npmjs.com/package/plo
5555
5656
```html
5757
<head>
58-
<script src="https://cdn.plot.ly/plotly-2.16.5.min.js"></script>
58+
<script src="https://cdn.plot.ly/plotly-2.17.0.min.js"></script>
5959
</head>
6060
<body>
6161
<div id="gd"></div>
@@ -72,7 +72,7 @@ You may also consider using [`plotly.js-dist`](https://www.npmjs.com/package/plo
7272
Alternatively you may consider using [native ES6 import](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules) in the script tag.
7373
```html
7474
<script type="module">
75-
import "https://cdn.plot.ly/plotly-2.16.5.min.js"
75+
import "https://cdn.plot.ly/plotly-2.17.0.min.js"
7676
Plotly.newPlot("gd", [{ y: [1, 2, 3] }])
7777
</script>
7878
```
@@ -82,7 +82,7 @@ Fastly supports Plotly.js with free CDN service. Read more at <https://www.fastl
8282
### Un-minified versions are also available on CDN
8383
While non-minified source files may contain characters outside UTF-8, it is recommended that you specify the `charset` when loading those bundles.
8484
```html
85-
<script src="https://cdn.plot.ly/plotly-2.16.5.js" charset="utf-8"></script>
85+
<script src="https://cdn.plot.ly/plotly-2.17.0.js" charset="utf-8"></script>
8686
```
8787

8888
> 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.5. Therefore, to use the CDN with plotly.js v2 and higher, you must specify an exact plotly.js version.
@@ -108,7 +108,7 @@ There are two kinds of plotly.js bundles:
108108

109109
---
110110
## Alternative ways to load and build plotly.js
111-
If your library needs to bundle or directly load [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).
111+
If your library needs to bundle or directly load [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, then please visit [`BUILDING.md`](https://github.com/plotly/plotly.js/blob/master/BUILDING.md).
112112

113113
---
114114
## Documentation

devtools/regl_codegen/devtools.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
var mocks = require('../../build/test_dashboard_mocks.json');
66
var reglTraces = require('../../build/regl_traces.json');
7-
var Lib = require('@src/lib');
7+
var Lib = require('../../src/lib');
88

99
// Our gracious testing object
1010
var Tabs = {
@@ -158,3 +158,5 @@ function handleOnLoad() {
158158
window.close();
159159
});
160160
}
161+
162+
module.exports = Tabs;

devtools/regl_codegen/server.js

Lines changed: 48 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,24 @@ var path = require('path');
33
var http = require('http');
44
var ecstatic = require('ecstatic');
55
var open = require('open');
6-
var browserify = require('browserify');
6+
var webpack = require('webpack');
77
var minimist = require('minimist');
88

99
var constants = require('../../tasks/util/constants');
10-
var makeWatchifiedBundle = require('../../tasks/util/watchified_bundle');
11-
var shortcutPaths = require('../../tasks/util/shortcut_paths');
10+
var config = require('../../webpack.config.js');
11+
config.optimization = { minimize: false };
1212

1313
var args = minimist(process.argv.slice(2), {});
1414
var PORT = args.port || 3000;
1515
var strict = args.strict;
1616

17+
var reglTraceList = [
18+
'parcoords',
19+
'scattergl',
20+
'scatterpolargl',
21+
'splom'
22+
];
23+
1724
// Create server
1825
var static = ecstatic({
1926
root: constants.pathToRoot,
@@ -51,38 +58,53 @@ var server = http.createServer(function(req, res) {
5158
});
5259

5360

54-
// Make watchified bundle for plotly.js
55-
var bundlePlotly = makeWatchifiedBundle(strict, function() {
56-
// open up browser window on first bundle callback
57-
open('http://localhost:' + PORT + '/devtools/regl_codegen/index' + (strict ? '-strict' : '') + '.html');
58-
});
59-
60-
// Bundle devtools code
61-
var devtoolsPath = path.join(constants.pathToRoot, 'devtools/regl_codegen');
62-
var devtools = browserify(path.join(devtoolsPath, 'devtools.js'), {
63-
transform: [shortcutPaths]
64-
});
65-
6661
// Start the server up!
6762
server.listen(PORT);
6863

69-
var reglTraceList = [
70-
'parcoords',
71-
'scattergl',
72-
'scatterpolargl',
73-
'splom'
74-
];
75-
76-
purgeGeneratedCode(reglTraceList);
64+
// open up browser window
65+
open('http://localhost:' + PORT + '/devtools/regl_codegen/index' + (strict ? '-strict' : '') + '.html');
7766

7867
// Build and bundle all the things!
7968
getMockFiles()
8069
.then(readFiles)
8170
.then(createMocksList)
8271
.then(saveMockListToFile)
83-
.then(saveReglTracesToFile.bind(null, reglTraceList))
84-
.then(bundleDevtools)
85-
.then(bundlePlotly);
72+
.then(saveReglTracesToFile.bind(null, reglTraceList));
73+
74+
// Devtools config
75+
var devtoolsConfig = {};
76+
77+
var devtoolsPath = path.join(constants.pathToRoot, 'devtools/regl_codegen');
78+
devtoolsConfig.entry = path.join(devtoolsPath, 'devtools.js');
79+
80+
devtoolsConfig.output = {
81+
path: config.output.path,
82+
filename: 'regl_codegen-bundle.js',
83+
library: {
84+
name: 'Tabs',
85+
type: 'umd'
86+
}
87+
};
88+
89+
devtoolsConfig.target = config.target;
90+
devtoolsConfig.plugins = config.plugins;
91+
devtoolsConfig.optimization = config.optimization;
92+
devtoolsConfig.mode = 'production';
93+
94+
var compiler;
95+
96+
compiler = webpack(devtoolsConfig);
97+
compiler.run(function(devtoolsErr, devtoolsStats) {
98+
if(devtoolsErr) {
99+
console.log('err:', devtoolsErr);
100+
} else if(devtoolsStats.errors && devtoolsStats.errors.length) {
101+
console.log('stats.errors:', devtoolsStats.errors);
102+
} else {
103+
console.log('success:', devtoolsConfig.output.path + '/' + devtoolsConfig.output.filename);
104+
105+
purgeGeneratedCode(reglTraceList);
106+
}
107+
});
86108

87109

88110
function getMockFiles() {
@@ -178,19 +200,6 @@ function writeFilePromise(path, contents) {
178200
});
179201
}
180202

181-
function bundleDevtools() {
182-
return new Promise(function(resolve, reject) {
183-
devtools.bundle(function(err) {
184-
if(err) {
185-
console.error('Error while bundling!', JSON.stringify(String(err)));
186-
return reject(err);
187-
} else {
188-
return resolve();
189-
}
190-
}).pipe(fs.createWriteStream(constants.pathToReglCodegenBundle));
191-
});
192-
}
193-
194203
function handleCodegen(data) {
195204
var trace = data.trace;
196205
var generated = data.generated;

devtools/test_dashboard/devtools.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
var Fuse = require('fuse.js/dist/fuse.common.js');
66
var mocks = require('../../build/test_dashboard_mocks.json');
77
var credentials = require('../../build/credentials.json');
8-
var Lib = require('@src/lib');
8+
var Lib = require('../../src/lib');
99

1010
require('./perf');
1111

@@ -268,3 +268,5 @@ function handleOnLoad() {
268268
Tabs.setPlotConfig();
269269
plotFromHash();
270270
}
271+
272+
module.exports = Tabs;

0 commit comments

Comments
 (0)