Skip to content

Commit c11beeb

Browse files
committed
Merge branch 'master' into doeg-exp-request-store
2 parents 0584c11 + 7624935 commit c11beeb

File tree

19 files changed

+241
-59
lines changed

19 files changed

+241
-59
lines changed
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
{
2+
"data": [
3+
{
4+
"y": [
5+
0.75,
6+
5.25,
7+
5.5,
8+
6,
9+
6.2,
10+
6.6,
11+
6.8,
12+
7,
13+
7.2,
14+
7.5,
15+
7.5,
16+
7.75,
17+
8.15,
18+
8.15,
19+
8.65,
20+
8.93,
21+
9.2,
22+
9.5,
23+
10,
24+
10.25,
25+
11.5,
26+
12,
27+
16,
28+
20.9,
29+
22.3,
30+
23.25
31+
],
32+
"type": "box",
33+
"marker": {
34+
"outliercolor": "green"
35+
},
36+
"uid": "511258"
37+
}
38+
],
39+
"layout": {
40+
"xaxis": {
41+
"type": "category",
42+
"range": [
43+
-0.5,
44+
0.5
45+
],
46+
"autorange": true
47+
},
48+
"yaxis": {
49+
"type": "linear",
50+
"range": [
51+
-0.5,
52+
24.5
53+
],
54+
"autorange": true
55+
},
56+
"height": 450,
57+
"width": 1000,
58+
"autosize": true
59+
}
60+
}
12.1 KB
Loading

shelly/plotlyjs/static/plotlyjs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"convex-hull": "^1.0.3",
1616
"d3": "3.3.5",
1717
"delaunay-triangulate": "^1.1.6",
18+
"es6-promise": "^3.0.2",
1819
"gl-error3d": "^1.0.0",
1920
"gl-line3d": "^1.0.1",
2021
"gl-mat4": "^1.1.2",
@@ -28,7 +29,6 @@
2829
"ndarray-fill": "^1.0.1",
2930
"ndarray-homography": "^1.0.0",
3031
"ndarray-ops": "^1.2.2",
31-
"promise": "6.1.0",
3232
"right-now": "^1.0.0",
3333
"superscript-text": "^1.0.0",
3434
"through2": "^2.0.0",

shelly/plotlyjs/static/plotlyjs/src/boxes.js

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ boxes.attributes = {
135135
marker: {
136136
outliercolor: {
137137
valType: 'color',
138-
dflt: 'rgba(0,0,0,0)',
138+
dflt: 'rgba(0, 0, 0, 0)',
139139
role: 'style',
140140
description: 'Sets the color of the outlier sample points.'
141141
},
@@ -155,7 +155,10 @@ boxes.attributes = {
155155
outliercolor: {
156156
valType: 'color',
157157
role: 'style',
158-
description: 'Sets the border line color of the outlier sample points.'
158+
description: [
159+
'Sets the border line color of the outlier sample points.',
160+
'Defaults to marker.color'
161+
].join(' ')
159162
},
160163
outlierwidth: {
161164
valType: 'number',
@@ -252,7 +255,13 @@ boxes.supplyDefaults = function(traceIn, traceOut, defaultColor) {
252255

253256
coerce('whiskerwidth');
254257
coerce('boxmean');
255-
var boxpoints = coerce('boxpoints');
258+
259+
var outlierColorDflt = Plotly.Lib.coerce2(traceIn, traceOut, boxes.attributes, 'marker.outliercolor'),
260+
lineoutliercolor = coerce('marker.line.outliercolor'),
261+
boxpoints = outlierColorDflt ||
262+
lineoutliercolor ? coerce('boxpoints', 'suspectedoutliers') :
263+
coerce('boxpoints');
264+
256265
if(boxpoints) {
257266
coerce('jitter', boxpoints==='all' ? 0.3 : 0);
258267
coerce('pointpos', boxpoints==='all' ? -1.5 : 0);
@@ -265,8 +274,7 @@ boxes.supplyDefaults = function(traceIn, traceOut, defaultColor) {
265274
coerce('marker.line.width');
266275

267276
if(boxpoints==='suspectedoutliers') {
268-
coerce('marker.outliercolor');
269-
coerce('marker.line.outliercolor', traceOut.marker.color);
277+
coerce('marker.line.outliercolor', traceOut.marker.color)
270278
coerce('marker.line.outlierwidth');
271279
}
272280
}

shelly/plotlyjs/static/plotlyjs/src/contour.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -124,10 +124,9 @@ contour.supplyDefaults = function(traceIn, traceOut, defaultColor, layout) {
124124
return Plotly.Lib.coerce(traceIn, traceOut, contour.attributes, attr, dflt);
125125
}
126126

127-
var contourstart = coerce('contours.start'),
128-
contourend = coerce('contours.end'),
129-
validcont = contourstart!==undefined && contourend!==undefined,
130-
autocontour = validcont ? coerce('autocontour', false) : coerce('autocontour');
127+
var contourStart = Plotly.Lib.coerce2(traceIn, traceOut, contour.attributes, 'contours.start'),
128+
contourEnd = Plotly.Lib.coerce2(traceIn, traceOut, contour.attributes, 'contours.end'),
129+
autocontour = contourStart && contourEnd ? coerce('autocontour', false) : coerce('autocontour');
131130
if(autocontour) coerce('ncontours');
132131
else coerce('contours.size');
133132

shelly/plotlyjs/static/plotlyjs/src/graph_interact.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -121,25 +121,25 @@ fx.init = function(gd) {
121121
})
122122
.mouseout(function(evt) {
123123
/*
124-
* !!! TERRIBLE HACK !!!
125-
*
126-
* For some reason, a 'mouseout' event is fired in IE on clicks
124+
* IMPORTANT: `fx.unhover(gd, evt)` has been commented out below
125+
* because in some browsers a 'mouseout' event is fired on clicks
127126
* on the maindrag container before reaching the 'click' handler.
128127
*
129128
* This results in a call to `fx.unhover` before `fx.click` where
130129
* `unhover` sets `gd._hoverdata` to `undefined` causing the call
131130
* to `fx.click` to return early.
132131
*
133-
* The hack below makes the 'mouseout' handler bypass
134-
* `fx.unhover` in IE.
135-
*
136132
* Note that the 'mouseout' handler is called only when the mouse
137-
* cursor gets lost. Most 'unhover' calls happen from 'mousemove':
138-
* these are not affected by the hack below.
133+
* cursor gets lost. Most 'unhover' calls happen from 'mousemove';
134+
* these are not affected by the change below.
135+
*
136+
* Browsers where this behavior has been noticed:
137+
* - Chrome 46.0.2490.71
138+
* - Firefox 41.0.2
139+
* - IE 9, 10, 11
139140
*/
140-
if( Plotly.Lib.isIE() ) return;
141-
142-
fx.unhover(gd,evt);
141+
// fx.unhover(gd, evt);
142+
return;
143143
})
144144
.click(function(evt){ fx.click(gd,evt); });
145145
// corner draggers

shelly/plotlyjs/static/plotlyjs/src/graph_obj.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ plots.registerSubplot = function(subplotType, attr, idRoot, attributes) {
150150

151151
// TODO separate the 'find subplot' step from the 'get subplot ids' step
152152
plots.getSubplotIds = function getSubplotIds(layout, type) {
153+
if(plots.subplotsRegistry[type] === undefined) return [];
153154

154155
// layout must be 'fullLayout' here
155156
if(type === 'cartesian') {
@@ -170,6 +171,8 @@ plots.getSubplotIds = function getSubplotIds(layout, type) {
170171
};
171172

172173
plots.getSubplotIdsInData = function getSubplotsInData(data, type) {
174+
if(plots.subplotsRegistry[type] === undefined) return [];
175+
173176
var attr = plots.subplotsRegistry[type].attr,
174177
subplotIds = [],
175178
trace;
@@ -185,6 +188,8 @@ plots.getSubplotIdsInData = function getSubplotsInData(data, type) {
185188
};
186189

187190
plots.getSubplotData = function getSubplotData(data, type, subplotId) {
191+
if(plots.subplotsRegistry[type] === undefined) return [];
192+
188193
var attr = plots.subplotsRegistry[type].attr,
189194
subplotData = [],
190195
trace;

shelly/plotlyjs/static/plotlyjs/src/histogram.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ Plotly.Plots.register(Plotly.Heatmap, 'histogram2d',
4040
// histogram has its own calc function,
4141
// but uses Bars.plot to display
4242
// and Bars.setPositions for stacking and grouping
43-
4443
function makeBinsAttr(axLetter) {
4544
return {
4645
start: {
@@ -218,13 +217,12 @@ histogram.supplyDefaults = function(traceIn, traceOut) {
218217
binDirections.forEach(function(binDirection){
219218
// data being binned - note that even though it's a little weird,
220219
// it's possible to have bins without data, if there's inferred data
221-
var binstrt = coerce(binDirection + 'bins.start'),
222-
binend = coerce(binDirection + 'bins.end'),
223-
validbin = binstrt!==undefined && binend!==undefined,
224-
autobin = validbin ?
220+
var binstrt = Plotly.Lib.coerce(traceIn, traceOut, histogram.attributes, binDirection + 'bins.start'),
221+
binend = Plotly.Lib.coerce(traceIn, traceOut, histogram.attributes, binDirection + 'bins.end'),
222+
autobin = binstrt && binend ?
225223
coerce('autobin' + binDirection, false) :
226224
coerce('autobin' + binDirection);
227-
225+
228226
if(autobin) coerce('nbins' + binDirection);
229227
else coerce(binDirection + 'bins.size');
230228
});

shelly/plotlyjs/static/plotlyjs/src/lib/lib.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1652,6 +1652,14 @@ lib.coerce = function(containerIn, containerOut, attributes, attribute, dflt) {
16521652
return propOut.get();
16531653
};
16541654

1655+
// use coerce to get attibute value if user input is valid, return attribute default
1656+
// if user input it not valid or retun false if there is no user input.
1657+
lib.coerce2 = function(containerIn, containerOut, attributes, attribute, dflt) {
1658+
var propIn = lib.nestedProperty(containerIn, attribute),
1659+
propOut = lib.coerce(containerIn, containerOut, attributes, attribute, dflt);
1660+
return propIn.get() ? propOut : false;
1661+
};
1662+
16551663
// shortcut to coerce the three font attributes
16561664
// 'coerce' is a lib.coerce wrapper with implied first three arguments
16571665
lib.coerceFont = function(coerce, attr, dfltObj) {

shelly/plotlyjs/static/plotlyjs/src/plotly.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
require('es6-promise').polyfill();
2+
13
// order of requires should matter only for interdependencies
24
// in attributes definitions. put the common modules first
35
exports.Lib = require('./lib/lib');
@@ -58,9 +60,5 @@ exports.Snapshot = require('./snapshot/snapshot');
5860
// Queue for undo/redo
5961
exports.Queue = require('./queue');
6062

61-
// promise polyfill, embed rather than requiring dependencies
62-
require('../../../../shelly/static/js/plugins/promise-1.0.0.min.js');
63-
require('../../../../shelly/static/js/plugins/promise-done-1.0.0.js');
64-
6563
// exports d3 used in the bundle
6664
exports.d3 = require('d3');

0 commit comments

Comments
 (0)