Skip to content

Commit c451573

Browse files
committed
Merge pull request #3961 from plotly/plotly-extend
Unify extend and clone patterns in plotlyjs with in-house extend
2 parents 7c7c959 + 132a2a9 commit c451573

38 files changed

+699
-275
lines changed

image_server/test/mocks/polar_line.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -693,7 +693,7 @@
693693
"size": 12,
694694
"color": "#000"
695695
},
696-
"showlegend": false,
696+
"showlegend": true,
697697
"width": 500,
698698
"height": 400,
699699
"margin": {
1.41 KB
Loading

shelly/plotlyjs/static/plotlyjs/package.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,8 @@
1212
"alpha-shape": "^1.0.0",
1313
"arraytools": "^1.0.0",
1414
"browserify": "^6.1.0",
15-
"clone": "^1.0.2",
16-
"colormap": "^1.3.1",
1715
"convex-hull": "^1.0.3",
1816
"delaunay-triangulate": "^1.1.6",
19-
"extend": "^3.0.0",
2017
"gl-error3d": "^1.0.0",
2118
"gl-line3d": "^1.0.1",
2219
"gl-mat4": "^1.1.2",

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ annotations.layoutAttributes = {
7777
'with respect to the horizontal.'
7878
].join(' ')
7979
},
80-
font: Plotly.Lib.extendFlat(Plotly.Plots.fontAttrs, {
80+
font: Plotly.Lib.extendFlat({}, Plotly.Plots.fontAttrs, {
8181
description: 'Sets the annotation text font.'
8282
}),
8383
opacity: {

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ axes.layoutAttributes = {
4242
role: 'info',
4343
description: 'Sets the title of this axis.'
4444
},
45-
titlefont: extendFlat(Plotly.Plots.fontAttrs, {
45+
titlefont: extendFlat({}, Plotly.Plots.fontAttrs, {
4646
description: [
4747
'Sets this axis\' title font.'
4848
].join(' ')
@@ -216,7 +216,7 @@ axes.layoutAttributes = {
216216
role: 'style',
217217
description: 'Determines whether or not the tick labels are drawn.'
218218
},
219-
tickfont: extendFlat(Plotly.Plots.fontAttrs, {
219+
tickfont: extendFlat({}, Plotly.Plots.fontAttrs, {
220220
description: 'Sets the tick font.'
221221
}),
222222
tickangle: {

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -140,18 +140,18 @@ boxes.attributes = {
140140
role: 'style',
141141
description: 'Sets the color of the outlier sample points.'
142142
},
143-
symbol: extendFlat(scatterMarkerAttrs.symbol,
143+
symbol: extendFlat({}, scatterMarkerAttrs.symbol,
144144
{arrayOk: false}),
145-
opacity: extendFlat(scatterMarkerAttrs.opacity,
145+
opacity: extendFlat({}, scatterMarkerAttrs.opacity,
146146
{arrayOk: false, dflt: 1}),
147-
size: extendFlat(scatterMarkerAttrs.size,
147+
size: extendFlat({}, scatterMarkerAttrs.size,
148148
{arrayOk: false}),
149-
color: extendFlat(scatterMarkerAttrs.color,
149+
color: extendFlat({}, scatterMarkerAttrs.color,
150150
{arrayOk: false}),
151151
line: {
152-
color: extendFlat(scatterMarkerLineAttrs.color,
152+
color: extendFlat({}, scatterMarkerLineAttrs.color,
153153
{arrayOk: false, dflt: Plotly.Color.defaultLine}),
154-
width: extendFlat(scatterMarkerLineAttrs.width,
154+
width: extendFlat({}, scatterMarkerLineAttrs.width,
155155
{arrayOk: false, dflt: 0}),
156156
outliercolor: {
157157
valType: 'color',

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -659,7 +659,7 @@ colorbar.attributes = {
659659
dtick: axesAttrs.dtick,
660660
tickvals: axesAttrs.tickvals,
661661
ticktext: axesAttrs.ticktext,
662-
ticks: extendFlat(axesAttrs.ticks, {dflt: ''}),
662+
ticks: extendFlat({}, axesAttrs.ticks, {dflt: ''}),
663663
ticklen: axesAttrs.ticklen,
664664
tickwidth: axesAttrs.tickwidth,
665665
tickcolor: axesAttrs.tickcolor,
@@ -679,7 +679,7 @@ colorbar.attributes = {
679679
dflt: 'Click to enter colorscale title',
680680
description: 'Sets the title of the color bar.'
681681
},
682-
titlefont: extendFlat(Plotly.Plots.fontAttrs, {
682+
titlefont: extendFlat({}, Plotly.Plots.fontAttrs, {
683683
description: [
684684
'Sets this color bar\'s title font.'
685685
].join(' ')

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,15 +103,15 @@ contour.attributes = {
103103
}
104104
},
105105
line: {
106-
color: extendFlat(scatterLineAttrs.color, {
106+
color: extendFlat({}, scatterLineAttrs.color, {
107107
description: [
108108
'Sets the color of the contour level.',
109109
'Has no if `contours.coloring` is set to *lines*.'
110110
].join(' ')
111111
}),
112112
width: scatterLineAttrs.width,
113113
dash: scatterLineAttrs.dash,
114-
smoothing: extendFlat(scatterLineAttrs.smoothing, {
114+
smoothing: extendFlat({}, scatterLineAttrs.smoothing, {
115115
description: [
116116
'Sets the amount of smoothing for the contour lines,',
117117
'where *0* corresponds to no smoothing.'

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -973,7 +973,7 @@ drawing.bBox = function(node) {
973973
node.setAttribute('data-bb',savedBBoxes.length);
974974
savedBBoxes.push(bb);
975975

976-
return Plotly.Lib.extendFlat(bb);
976+
return Plotly.Lib.extendFlat({}, bb);
977977
};
978978

979979
/*

shelly/plotlyjs/static/plotlyjs/src/geo/attributes/choropleth.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ module.exports = {
3434
autocolorscale: traceColorbarAttrs.autocolorscale,
3535
reversescale: traceColorbarAttrs.reversescale,
3636
showscale: traceColorbarAttrs.showscale,
37-
hoverinfo: Plotly.Lib.extendFlat(Plotly.Plots.attributes.hoverinfo, {
37+
hoverinfo: Plotly.Lib.extendFlat({}, Plotly.Plots.attributes.hoverinfo, {
3838
flags: ['location', 'z', 'text', 'name']
3939
}),
4040
_nestedModules: {

0 commit comments

Comments
 (0)