Skip to content

Commit 4382fc7

Browse files
committed
Merge branch 'master' into scatterpolargl-2-scatterpolar
2 parents cab319d + 7ae6fd6 commit 4382fc7

File tree

80 files changed

+628
-153
lines changed

Some content is hidden

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

80 files changed

+628
-153
lines changed

.circleci/config.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ jobs:
8888
command: ./.circleci/test.sh image
8989
- store_artifacts:
9090
path: build
91+
destination: /
9192

9293
test-image2:
9394
docker:
@@ -107,6 +108,7 @@ jobs:
107108
command: ./.circleci/test.sh image2
108109
- store_artifacts:
109110
path: build
111+
destination: /
110112

111113
test-syntax:
112114
docker:
@@ -120,6 +122,24 @@ jobs:
120122
name: Run syntax tests
121123
command: ./.circleci/test.sh syntax
122124

125+
publish:
126+
docker:
127+
- image: circleci/node:10.9.0
128+
working_directory: ~/plotly.js
129+
steps:
130+
- checkout
131+
- attach_workspace:
132+
at: ~/plotly.js
133+
- store_artifacts:
134+
path: build/plotly.js
135+
destination: /plotly.js
136+
- store_artifacts:
137+
path: dist/plotly.min.js
138+
destination: /plotly.min.js
139+
- store_artifacts:
140+
path: dist/plot-schema.json
141+
destination: /plot-schema.json
142+
123143
workflows:
124144
version: 2
125145
build-and-test:
@@ -140,3 +160,10 @@ workflows:
140160
- test-syntax:
141161
requires:
142162
- build
163+
- publish:
164+
requires:
165+
- test-jasmine
166+
- test-jasmine2
167+
- test-image
168+
- test-image2
169+
- test-syntax

devtools/test_dashboard/server.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ var PORT = process.argv[2] || 3000;
1616
var server = http.createServer(ecstatic({
1717
root: constants.pathToRoot,
1818
cache: 0,
19-
gzip: true
19+
gzip: true,
20+
cors: true
2021
}));
2122

2223
// Make watchified bundle for plotly.js

package-lock.json

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
"gl-mat4": "^1.2.0",
7979
"gl-mesh3d": "^2.0.0",
8080
"gl-plot2d": "^1.3.1",
81-
"gl-plot3d": "^1.5.6",
81+
"gl-plot3d": "^1.5.10",
8282
"gl-pointcloud2d": "^1.0.1",
8383
"gl-scatter3d": "^1.0.11",
8484
"gl-select-box": "^1.0.2",

src/lib/loggers.js

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,24 @@ loggers.error = function() {
6161
* apply like other functions do
6262
*/
6363
function apply(f, args) {
64-
if(f.apply) {
65-
f.apply(f, args);
64+
if(f && f.apply) {
65+
try {
66+
// `this` should always be console, since here we're always
67+
// applying a method of the console object.
68+
f.apply(console, args);
69+
return;
70+
}
71+
catch(e) { /* in case apply failed, fall back on the code below */ }
6672
}
67-
else {
68-
for(var i = 0; i < args.length; i++) {
73+
74+
// no apply - just try calling the function on each arg independently
75+
for(var i = 0; i < args.length; i++) {
76+
try {
6977
f(args[i]);
7078
}
79+
catch(e) {
80+
// still fails - last resort simple console.log
81+
console.log(args[i]);
82+
}
7183
}
7284
}

src/lib/search.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,10 @@ exports.roundUp = function(val, arrayIn, reverse) {
118118
/**
119119
* Tweak to Array.sort(sortFn) that improves performance for pre-sorted arrays
120120
*
121+
* Note that newer browsers (such as Chrome v70+) are starting to pick up
122+
* on pre-sorted arrays which may render the following optimization unnecessary
123+
* in the future.
124+
*
121125
* Motivation: sometimes we need to sort arrays but the input is likely to
122126
* already be sorted. Browsers don't seem to pick up on pre-sorted arrays,
123127
* and in fact Chrome is actually *slower* sorting pre-sorted arrays than purely

src/plot_api/helpers.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -490,6 +490,17 @@ exports.coerceTraceIndices = function(gd, traceIndices) {
490490
else if(!Array.isArray(traceIndices) || !traceIndices.length) {
491491
return gd.data.map(function(_, i) { return i; });
492492
}
493+
else if(Array.isArray(traceIndices)) {
494+
var traceIndicesOut = [];
495+
for(var i = 0; i < traceIndices.length; i++) {
496+
if(Lib.isIndex(traceIndices[i], gd.data.length)) {
497+
traceIndicesOut.push(traceIndices[i]);
498+
} else {
499+
Lib.warn('trace index (', traceIndices[i], ') is not a number or is out of bounds');
500+
}
501+
}
502+
return traceIndicesOut;
503+
}
493504

494505
return traceIndices;
495506
};

src/plot_api/plot_api.js

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1922,8 +1922,24 @@ function _relayout(gd, aobj) {
19221922
// back to its initial value as computed during the first pass in Plots.plotAutoSize.
19231923
//
19241924
// To do so, we must manually set them back here using the _initialAutoSize cache.
1925-
if(['width', 'height'].indexOf(ai) !== -1 && vi === null) {
1926-
fullLayout[ai] = gd._initialAutoSize[ai];
1925+
// can't use impliedEdits for this because behavior depends on vi
1926+
if(['width', 'height'].indexOf(ai) !== -1) {
1927+
if(vi) {
1928+
doextra('autosize', null);
1929+
// currently we don't support autosize one dim only - so
1930+
// explicitly set the other one. Note that doextra will
1931+
// ignore this if the same relayout call also provides oppositeAttr
1932+
var oppositeAttr = ai === 'height' ? 'width' : 'height';
1933+
doextra(oppositeAttr, fullLayout[oppositeAttr]);
1934+
}
1935+
else {
1936+
fullLayout[ai] = gd._initialAutoSize[ai];
1937+
}
1938+
}
1939+
else if(ai === 'autosize') {
1940+
// depends on vi here too, so again can't use impliedEdits
1941+
doextra('width', vi ? null : fullLayout.width);
1942+
doextra('height', vi ? null : fullLayout.height);
19271943
}
19281944
// check autorange vs range
19291945
else if(pleafPlus.match(AX_RANGE_RE)) {
@@ -2625,6 +2641,7 @@ function diffConfig(oldConfig, newConfig) {
26252641
var key;
26262642

26272643
for(key in oldConfig) {
2644+
if(key.charAt(0) === '_') continue;
26282645
var oldVal = oldConfig[key];
26292646
var newVal = newConfig[key];
26302647
if(oldVal !== newVal) {

src/plot_api/template_api.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ var dfltConfig = require('./plot_config');
3131
* `layout.template` in another figure.
3232
*/
3333
exports.makeTemplate = function(figure) {
34-
figure = Lib.extendDeep({_context: dfltConfig}, figure);
34+
figure = Lib.extendDeep({_context: dfltConfig}, {data: figure.data, layout: figure.layout});
3535
Plots.supplyDefaults(figure);
3636
var data = figure.data || [];
3737
var layout = figure.layout || {};

src/plots/gl3d/layout/convert.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ function AxesOptions() {
3232
this.labelEnable = [ true, true, true ];
3333
this.labelFont = ['Open Sans', 'Open Sans', 'Open Sans'];
3434
this.labelSize = [ 20, 20, 20 ];
35-
this.labelAngle = [ 0, 0, 0 ];
3635
this.labelColor = [ [0, 0, 0, 1], [0, 0, 0, 1], [0, 0, 0, 1] ];
3736
this.labelPad = [ 30, 30, 30 ];
3837

@@ -119,9 +118,10 @@ proto.merge = function(sceneLayout) {
119118
if('tickwidth' in axes) opts.lineTickWidth[i] = axes.tickwidth;
120119
if('tickangle' in axes) {
121120
opts.tickAngle[i] = (axes.tickangle === 'auto') ?
122-
0 :
121+
-3600 : // i.e. special number to set auto option
123122
Math.PI * -axes.tickangle / 180;
124123
}
124+
125125
// tick labels
126126
if('showticklabels' in axes) opts.tickEnable[i] = axes.showticklabels;
127127
if('tickfont' in axes) {

0 commit comments

Comments
 (0)