Skip to content

Commit 045f3ed

Browse files
Merge remote-tracking branch 'origin/master' into DirectoryStoreScansRootForOrphans
2 parents 95cd7ac + 1a79671 commit 045f3ed

File tree

20 files changed

+275
-67
lines changed

20 files changed

+275
-67
lines changed

shelly/plotlyjs/static/plotlyjs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
"alpha-shape": "^1.0.0",
1313
"arraytools": "^1.0.0",
1414
"browserify": "^6.1.0",
15+
"clone": "^1.0.2",
1516
"colormap": "^1.3.1",
1617
"convex-hull": "^1.0.3",
1718
"delaunay-triangulate": "^1.1.6",
@@ -29,7 +30,6 @@
2930
"ndarray-fill": "^1.0.1",
3031
"ndarray-homography": "^1.0.0",
3132
"ndarray-ops": "^1.2.2",
32-
"object-assign": "2.0.0",
3333
"promise": "6.1.0",
3434
"right-now": "^1.0.0",
3535
"superscript-text": "^1.0.0",

shelly/plotlyjs/static/plotlyjs/src/annotations.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,8 @@ annotations.layoutAttributes = {
281281

282282
_deprecated: {
283283
ref: {
284+
valType: 'string',
285+
role: 'info',
284286
description: [
285287
'Obsolete. Set `xref` and `yref` separately instead.'
286288
].join(' ')
@@ -453,7 +455,9 @@ annotations.draw = function(gd, index, opt, value) {
453455
else if(value==='add' || Plotly.Lib.isPlainObject(value)) {
454456
fullLayout.annotations.splice(index,0,{});
455457

456-
var rule = Plotly.Lib.isPlainObject(value) ? $.extend({},value) : {text: 'New text'};
458+
var rule = Plotly.Lib.isPlainObject(value) ?
459+
Plotly.Lib.extendFlat({}, value) :
460+
{text: 'New text'};
457461

458462
if (layout.annotations) {
459463
layout.annotations.splice(index, 0, rule);

shelly/plotlyjs/static/plotlyjs/src/axes.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -449,6 +449,8 @@ axes.layoutAttributes = {
449449

450450
_deprecated: {
451451
autotick: {
452+
valType: 'boolean',
453+
role: 'info',
452454
description: [
453455
'Obsolete.',
454456
'Set `tickmode` to *auto* for old `autotick` *true* behavior.',

shelly/plotlyjs/static/plotlyjs/src/bars.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,9 @@ bars.attributes = {
7676

7777
_deprecated: {
7878
bardir: {
79+
valType: 'enumerated',
80+
role: 'info',
81+
values: ['v', 'h'],
7982
description: 'Renamed to `orientation`.'
8083
}
8184
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -810,7 +810,7 @@ boxes.hoverPoints = function(pointData, xval, yval, hovermode) {
810810

811811
// copy out to a new object for each value to label
812812
val = valAxis.c2p(di[attr], true);
813-
pointData2 = $.extend({}, pointData);
813+
pointData2 = Plotly.Lib.extendFlat({}, pointData);
814814
pointData2[valLetter+'0'] = pointData2[valLetter+'1'] = val;
815815
pointData2[valLetter+'LabelVal'] = di[attr];
816816
pointData2.attr = attr;

shelly/plotlyjs/static/plotlyjs/src/colorbar.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -496,8 +496,10 @@ var colorbar = module.exports = function(td, id) {
496496

497497
// setter - for multi-part properties,
498498
// set only the parts that are provided
499-
if(Plotly.Lib.isPlainObject(opts[name])) $.extend(opts[name],v);
500-
else opts[name] = v;
499+
opts[name] = Plotly.Lib.isPlainObject(opts[name]) ?
500+
Plotly.Lib.extendFlat(opts[name], v) :
501+
v;
502+
501503
return component;
502504
};
503505
});
@@ -816,9 +818,13 @@ colorbar.traceColorbarAttributes = {
816818

817819
_deprecated: {
818820
scl: {
821+
valType: 'colorscale',
822+
role: 'style',
819823
description: 'Renamed to `colorscale`.'
820824
},
821825
reversescl: {
826+
valType: 'boolean',
827+
role: 'style',
822828
description: 'Renamed to `reversescale`.'
823829
}
824830
}

shelly/plotlyjs/static/plotlyjs/src/drawing.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -934,7 +934,7 @@ drawing.bBox = function(node) {
934934
// remeasure the same thing many times
935935
var saveNum = node.attributes['data-bb'];
936936
if(saveNum && saveNum.value) {
937-
return $.extend({}, savedBBoxes[saveNum.value]);
937+
return Plotly.Lib.extendFlat({}, savedBBoxes[saveNum.value]);
938938
}
939939

940940
var test3 = d3.select('#js-plotly-tester'),

shelly/plotlyjs/static/plotlyjs/src/errorbars.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,8 @@ errorBars.attributes = {
128128

129129
_deprecated: {
130130
opacity: {
131+
valType: 'number',
132+
role: 'style',
131133
description: [
132134
'Obsolete.',
133135
'Use the alpha channel in error bar `color` to set the opacity.'

shelly/plotlyjs/static/plotlyjs/src/gl3d/attributes/gl3dlayout.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,8 @@ module.exports = {
135135

136136
_deprecated: {
137137
cameraposition: {
138+
valType: 'info_array',
139+
role: 'info',
138140
description: 'Obsolete. Use `camera` instead.'
139141
}
140142
}

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

Lines changed: 21 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010

1111
var Plotly = require('./plotly'),
1212
m4FromQuat = require('gl-mat4/fromQuat'),
13-
isNumeric = require('./isnumeric');
13+
isNumeric = require('./isnumeric'),
14+
clone = require('clone');
1415

1516
var plots = module.exports = {};
1617
// Most of the generic plotting functions get put into Plotly.Plots,
@@ -192,24 +193,6 @@ plots.getSubplotData = function getSubplotData(data, type, subplotId) {
192193
return subplotData;
193194
};
194195

195-
// new workspace tab. Perhaps this goes elsewhere, a workspace-only file???
196-
plots.newTab = function(divid, layout) {
197-
var gd = document.getElementById(divid);
198-
var toolPanel = new Plotly.ToolPanel(Plotly, gd);
199-
200-
toolPanel.makeMenu();
201-
202-
var config = {
203-
workspace: true,
204-
editable: true,
205-
autosizable: true,
206-
scrollZoom: true,
207-
showLink: false,
208-
setBackground: 'opaque'
209-
};
210-
return Plotly.plot(divid, [], layout, config);
211-
};
212-
213196
// in some cases the browser doesn't seem to know how big
214197
// the text is at first, so it needs to draw it,
215198
// then wait a little, then draw it again
@@ -287,7 +270,7 @@ plots.defaultConfig = {
287270
};
288271

289272
function setPlotContext(gd, config) {
290-
if(!gd._context) gd._context = $.extend({}, plots.defaultConfig);
273+
if(!gd._context) gd._context = Plotly.Lib.extendFlat(plots.defaultConfig);
291274
var context = gd._context;
292275

293276
if(config) {
@@ -551,9 +534,6 @@ Plotly.plot = function(gd, data, layout, config) {
551534
}
552535
else if(graphwasempty) makePlotFramework(gd);
553536

554-
// enable or disable formatting buttons
555-
$(gd).find('.data-only').attr('disabled', !hasData);
556-
557537
var fullLayout = gd._fullLayout;
558538

559539
// prepare the data and find the autorange
@@ -2240,7 +2220,7 @@ function getExtendProperties (gd, update, indices, maxPoints) {
22402220
}
22412221

22422222
/**
2243-
* A private function to keey Extend and Prepend traces DRY
2223+
* A private function to key Extend and Prepend traces DRY
22442224
*
22452225
* @param {Object|HTMLDivElement} gd
22462226
* @param {Object} update
@@ -2590,19 +2570,22 @@ Plotly.moveTraces = function moveTraces (gd, currentIndices, newIndices) {
25902570

25912571
// restyle: change styling of an existing plot
25922572
// can be called two ways:
2593-
// restyle(gd,astr,val[,traces])
2594-
// gd - graph div (dom element)
2573+
//
2574+
// restyle(gd, astr, val [,traces])
2575+
// gd - graph div (string id or dom element)
25952576
// astr - attribute string (like 'marker.symbol')
25962577
// val - value to give this attribute
25972578
// traces - integer or array of integers for the traces
25982579
// to alter (all if omitted)
2599-
// relayout(gd,aobj[,traces])
2580+
//
2581+
// restyle(gd, aobj [,traces])
26002582
// aobj - {astr1:val1, astr2:val2...} allows setting
26012583
// multiple attributes simultaneously
2584+
//
26022585
// val (or val1, val2... in the object form) can be an array,
2603-
// to apply different values to each trace
2604-
// if the array is too short, it will wrap around (useful for
2605-
// style files that want to specify cyclical default values)
2586+
// to apply different values to each trace.
2587+
// If the array is too short, it will wrap around (useful for
2588+
// style files that want to specify cyclical default values).
26062589
Plotly.restyle = function restyle(gd, astr, val, traces) {
26072590
gd = getGraphDiv(gd);
26082591

@@ -3082,9 +3065,9 @@ Plotly.restyle = function restyle(gd, astr, val, traces) {
30823065
var plotDone = Plotly.Lib.syncOrAsync(seq, gd);
30833066

30843067
if(!plotDone || !plotDone.then) plotDone = Promise.resolve();
3068+
30853069
return plotDone.then(function(){
3086-
$(gd).trigger('plotly_restyle',
3087-
$.extend(true, [], [redoit, traces]));
3070+
$(gd).trigger('plotly_restyle', clone([redoit, traces]));
30883071
});
30893072
};
30903073

@@ -3117,10 +3100,12 @@ function swapXYData(trace) {
31173100

31183101
// relayout: change layout in an existing plot
31193102
// can be called two ways:
3120-
// relayout(gd,astr,val)
3121-
// gd - graph div (dom element)
3103+
//
3104+
// relayout(gd, astr, val)
3105+
// gd - graph div (string id or dom element)
31223106
// astr - attribute string (like 'xaxis.range[0]')
31233107
// val - value to give this attribute
3108+
//
31243109
// relayout(gd,aobj)
31253110
// aobj - {astr1:val1, astr2:val2...}
31263111
// allows setting multiple attributes simultaneously
@@ -3440,8 +3425,9 @@ Plotly.relayout = function relayout(gd, astr, val) {
34403425
var plotDone = Plotly.Lib.syncOrAsync(seq, gd);
34413426

34423427
if(!plotDone || !plotDone.then) plotDone = Promise.resolve();
3428+
34433429
return plotDone.then(function(){
3444-
$(gd).trigger('plotly_relayout', $.extend(true, {}, redoit));
3430+
$(gd).trigger('plotly_relayout', clone(redoit));
34453431
});
34463432
};
34473433

0 commit comments

Comments
 (0)