Skip to content

Commit c8b03ee

Browse files
committed
Merge branch 'master' into finance-refactor
2 parents dc01685 + b938842 commit c8b03ee

File tree

101 files changed

+7340
-683
lines changed

Some content is hidden

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

101 files changed

+7340
-683
lines changed

.circleci/config.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,25 @@ jobs:
9797
- store_artifacts:
9898
path: build
9999

100+
test-image2:
101+
docker:
102+
- image: plotly/testbed:latest
103+
working_directory: /var/www/streambed/image_server/plotly.js/
104+
steps:
105+
- checkout
106+
- attach_workspace:
107+
at: /var/www/streambed/image_server/plotly.js/
108+
- run:
109+
name: Run and setup container
110+
command: |
111+
supervisord &
112+
npm run docker -- setup
113+
- run:
114+
name: Run image tests
115+
command: ./.circleci/test.sh image2
116+
- store_artifacts:
117+
path: build
118+
100119
test-syntax:
101120
docker:
102121
- image: circleci/node:8.9.4
@@ -123,6 +142,9 @@ workflows:
123142
- test-image:
124143
requires:
125144
- build
145+
- test-image2:
146+
requires:
147+
- build
126148
- test-syntax:
127149
requires:
128150
- build

.circleci/test.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ case $1 in
4141

4242
image)
4343
npm run test-image || EXIT_STATE=$?
44+
exit $EXIT_STATE
45+
;;
46+
47+
image2)
4448
npm run test-export || EXIT_STATE=$?
4549
npm run test-image-gl2d || EXIT_STATE=$?
4650
exit $EXIT_STATE

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ Thanks for your interest in plotly.js!
33
### Translations:
44

55
- Make a PR directly to the main repository
6-
- Label it `type: translation`
76
- Please @ mention a few other speakers of this language who can help review your translations.
87
- If you've omitted any keys from [dist/translation_keys.txt](https://github.com/plotly/plotly.js/blob/master/dist/translation-keys.txt) - which means they will fall back on the US English text - just make a short comment about why in the PR description: the English text works fine in your language, or you would like someone else to help translating those, or whatever the reason.
98
- You should only update files in `lib/locales/`, not those in `dist/`

lib/index-gl2d.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ var Plotly = require('./core');
1212

1313
Plotly.register([
1414
require('./scattergl'),
15+
require('./splom'),
1516
require('./pointcloud'),
1617
require('./heatmapgl'),
1718
require('./contourgl'),

lib/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ Plotly.register([
3131
require('./choropleth'),
3232

3333
require('./scattergl'),
34+
require('./splom'),
35+
3436
require('./pointcloud'),
3537
require('./heatmapgl'),
3638
require('./parcoords'),

lib/splom.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/**
2+
* Copyright 2012-2018, Plotly, Inc.
3+
* All rights reserved.
4+
*
5+
* This source code is licensed under the MIT license found in the
6+
* LICENSE file in the root directory of this source tree.
7+
*/
8+
9+
'use strict';
10+
11+
module.exports = require('../src/traces/splom');

package-lock.json

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

package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@
7575
"gl-heatmap2d": "^1.0.4",
7676
"gl-line3d": "^1.1.2",
7777
"gl-mat4": "^1.1.2",
78-
"gl-mesh3d": "^1.3.2",
78+
"gl-mesh3d": "^2.0.0",
7979
"gl-plot2d": "^1.3.1",
8080
"gl-plot3d": "^1.5.5",
8181
"gl-pointcloud2d": "^1.0.1",
@@ -99,8 +99,9 @@
9999
"polybooljs": "^1.2.0",
100100
"regl": "^1.3.1",
101101
"regl-error2d": "^2.0.3",
102-
"regl-line2d": "^3.0.1",
103-
"regl-scatter2d": "^3.0.0",
102+
"regl-line2d": "^3.0.2",
103+
"regl-scatter2d": "^3.0.1",
104+
"regl-splom": "^1.0.0",
104105
"right-now": "^1.0.0",
105106
"robust-orientation": "^1.1.3",
106107
"sane-topojson": "^2.0.0",

src/components/fx/helpers.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,30 @@
1111
var Lib = require('../../lib');
1212

1313
// look for either subplot or xaxis and yaxis attributes
14+
// does not handle splom case
1415
exports.getSubplot = function getSubplot(trace) {
1516
return trace.subplot || (trace.xaxis + trace.yaxis) || trace.geo;
1617
};
1718

19+
// is trace in given list of subplots?
20+
// does handle splom case
21+
exports.isTraceInSubplots = function isTraceInSubplot(trace, subplots) {
22+
if(trace.type === 'splom') {
23+
var xaxes = trace.xaxes || [];
24+
var yaxes = trace.yaxes || [];
25+
for(var i = 0; i < xaxes.length; i++) {
26+
for(var j = 0; j < yaxes.length; j++) {
27+
if(subplots.indexOf(xaxes[i] + yaxes[j]) !== -1) {
28+
return true;
29+
}
30+
}
31+
}
32+
return false;
33+
}
34+
35+
return subplots.indexOf(exports.getSubplot(trace)) !== -1;
36+
};
37+
1838
// convenience functions for mapping all relevant axes
1939
exports.flat = function flat(subplots, v) {
2040
var out = new Array(subplots.length);

src/components/fx/hover.js

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ function _hover(gd, evt, subplot, noHoverEvent) {
215215
var hoverdistance = fullLayout.hoverdistance === -1 ? Infinity : fullLayout.hoverdistance;
216216
var spikedistance = fullLayout.spikedistance === -1 ? Infinity : fullLayout.spikedistance;
217217

218-
// hoverData: the set of candidate points we've found to highlight
218+
// hoverData: the set of candidate points we've found to highlight
219219
var hoverData = [],
220220

221221
// searchData: the data to search in. Mostly this is just a copy of
@@ -265,7 +265,7 @@ function _hover(gd, evt, subplot, noHoverEvent) {
265265
for(curvenum = 0; curvenum < gd.calcdata.length; curvenum++) {
266266
cd = gd.calcdata[curvenum];
267267
trace = cd[0].trace;
268-
if(trace.hoverinfo !== 'skip' && subplots.indexOf(helpers.getSubplot(trace)) !== -1) {
268+
if(trace.hoverinfo !== 'skip' && helpers.isTraceInSubplots(trace, subplots)) {
269269
searchData.push(cd);
270270
}
271271
}
@@ -338,8 +338,15 @@ function _hover(gd, evt, subplot, noHoverEvent) {
338338
// the rest of this function from running and failing
339339
if(['carpet', 'contourcarpet'].indexOf(trace._module.name) !== -1) continue;
340340

341-
subplotId = helpers.getSubplot(trace);
342-
subploti = subplots.indexOf(subplotId);
341+
if(trace.type === 'splom') {
342+
// splom traces do not generate overlay subplots,
343+
// it is safe to assume here splom traces correspond to the 0th subplot
344+
subploti = 0;
345+
subplotId = subplots[subploti];
346+
} else {
347+
subplotId = helpers.getSubplot(trace);
348+
subploti = subplots.indexOf(subplotId);
349+
}
343350

344351
// within one trace mode can sometimes be overridden
345352
mode = hovermode;

0 commit comments

Comments
 (0)