Skip to content

Commit 6bc4fec

Browse files
authored
Merge pull request #4100 from plotly/atts-to-attrs
using Attrs as the short form of Attributes everywhere
2 parents 265bcaa + ce90e82 commit 6bc4fec

File tree

4 files changed

+57
-57
lines changed

4 files changed

+57
-57
lines changed

src/components/annotations3d/attributes.js

+34-34
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@
99

1010
'use strict';
1111

12-
var annAtts = require('../annotations/attributes');
12+
var annAttrs = require('../annotations/attributes');
1313
var overrideAll = require('../../plot_api/edit_types').overrideAll;
1414
var templatedArray = require('../../plot_api/plot_template').templatedArray;
1515

1616
module.exports = overrideAll(templatedArray('annotation', {
17-
visible: annAtts.visible,
17+
visible: annAttrs.visible,
1818
x: {
1919
valType: 'any',
2020
role: 'info',
@@ -51,41 +51,41 @@ module.exports = overrideAll(templatedArray('annotation', {
5151
].join(' ')
5252
},
5353

54-
xanchor: annAtts.xanchor,
55-
xshift: annAtts.xshift,
56-
yanchor: annAtts.yanchor,
57-
yshift: annAtts.yshift,
54+
xanchor: annAttrs.xanchor,
55+
xshift: annAttrs.xshift,
56+
yanchor: annAttrs.yanchor,
57+
yshift: annAttrs.yshift,
5858

59-
text: annAtts.text,
60-
textangle: annAtts.textangle,
61-
font: annAtts.font,
62-
width: annAtts.width,
63-
height: annAtts.height,
64-
opacity: annAtts.opacity,
65-
align: annAtts.align,
66-
valign: annAtts.valign,
67-
bgcolor: annAtts.bgcolor,
68-
bordercolor: annAtts.bordercolor,
69-
borderpad: annAtts.borderpad,
70-
borderwidth: annAtts.borderwidth,
71-
showarrow: annAtts.showarrow,
72-
arrowcolor: annAtts.arrowcolor,
73-
arrowhead: annAtts.arrowhead,
74-
startarrowhead: annAtts.startarrowhead,
75-
arrowside: annAtts.arrowside,
76-
arrowsize: annAtts.arrowsize,
77-
startarrowsize: annAtts.startarrowsize,
78-
arrowwidth: annAtts.arrowwidth,
79-
standoff: annAtts.standoff,
80-
startstandoff: annAtts.startstandoff,
81-
hovertext: annAtts.hovertext,
82-
hoverlabel: annAtts.hoverlabel,
83-
captureevents: annAtts.captureevents,
59+
text: annAttrs.text,
60+
textangle: annAttrs.textangle,
61+
font: annAttrs.font,
62+
width: annAttrs.width,
63+
height: annAttrs.height,
64+
opacity: annAttrs.opacity,
65+
align: annAttrs.align,
66+
valign: annAttrs.valign,
67+
bgcolor: annAttrs.bgcolor,
68+
bordercolor: annAttrs.bordercolor,
69+
borderpad: annAttrs.borderpad,
70+
borderwidth: annAttrs.borderwidth,
71+
showarrow: annAttrs.showarrow,
72+
arrowcolor: annAttrs.arrowcolor,
73+
arrowhead: annAttrs.arrowhead,
74+
startarrowhead: annAttrs.startarrowhead,
75+
arrowside: annAttrs.arrowside,
76+
arrowsize: annAttrs.arrowsize,
77+
startarrowsize: annAttrs.startarrowsize,
78+
arrowwidth: annAttrs.arrowwidth,
79+
standoff: annAttrs.standoff,
80+
startstandoff: annAttrs.startstandoff,
81+
hovertext: annAttrs.hovertext,
82+
hoverlabel: annAttrs.hoverlabel,
83+
captureevents: annAttrs.captureevents,
8484

8585
// maybes later?
86-
// clicktoshow: annAtts.clicktoshow,
87-
// xclick: annAtts.xclick,
88-
// yclick: annAtts.yclick,
86+
// clicktoshow: annAttrs.clicktoshow,
87+
// xclick: annAttrs.xclick,
88+
// yclick: annAttrs.yclick,
8989

9090
// not needed!
9191
// axref: 'pixel'

src/components/colorscale/cross_trace_defaults.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ module.exports = function crossTraceDefaults(fullData, fullLayout) {
2020
}
2121
}
2222

23-
function relinkColorAtts(outerCont, cbOpt) {
23+
function relinkColorAttrs(outerCont, cbOpt) {
2424
var cont = cbOpt.container ?
2525
Lib.nestedProperty(outerCont, cbOpt.container).get() :
2626
outerCont;
@@ -53,15 +53,15 @@ module.exports = function crossTraceDefaults(fullData, fullLayout) {
5353
if(cbOpts) {
5454
if(Array.isArray(cbOpts)) {
5555
for(var j = 0; j < cbOpts.length; j++) {
56-
relinkColorAtts(trace, cbOpts[j]);
56+
relinkColorAttrs(trace, cbOpts[j]);
5757
}
5858
} else {
59-
relinkColorAtts(trace, cbOpts);
59+
relinkColorAttrs(trace, cbOpts);
6060
}
6161
}
6262

6363
if(hasColorscale(trace, 'marker.line')) {
64-
relinkColorAtts(trace, {
64+
relinkColorAttrs(trace, {
6565
container: 'marker.line',
6666
min: 'cmin',
6767
max: 'cmax'
@@ -70,6 +70,6 @@ module.exports = function crossTraceDefaults(fullData, fullLayout) {
7070
}
7171

7272
for(var k in fullLayout._colorAxes) {
73-
relinkColorAtts(fullLayout[k], {min: 'cmin', max: 'cmax'});
73+
relinkColorAttrs(fullLayout[k], {min: 'cmin', max: 'cmax'});
7474
}
7575
};

src/traces/mesh3d/attributes.js

+9-9
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
var colorScaleAttrs = require('../../components/colorscale/attributes');
1212
var hovertemplateAttrs = require('../../components/fx/hovertemplate_attributes');
13-
var surfaceAtts = require('../surface/attributes');
13+
var surfaceAttrs = require('../surface/attributes');
1414
var baseAttrs = require('../../plots/attributes');
1515

1616
var extendFlat = require('../../lib/extend').extendFlat;
@@ -185,7 +185,7 @@ colorScaleAttrs('', {
185185
showScaleDflt: true,
186186
editTypeOverride: 'calc'
187187
}), {
188-
opacity: surfaceAtts.opacity,
188+
opacity: surfaceAttrs.opacity,
189189

190190
// Flat shaded mode
191191
flatshading: {
@@ -200,20 +200,20 @@ colorScaleAttrs('', {
200200
},
201201

202202
contour: {
203-
show: extendFlat({}, surfaceAtts.contours.x.show, {
203+
show: extendFlat({}, surfaceAttrs.contours.x.show, {
204204
description: [
205205
'Sets whether or not dynamic contours are shown on hover'
206206
].join(' ')
207207
}),
208-
color: surfaceAtts.contours.x.color,
209-
width: surfaceAtts.contours.x.width,
208+
color: surfaceAttrs.contours.x.color,
209+
width: surfaceAttrs.contours.x.width,
210210
editType: 'calc'
211211
},
212212

213213
lightposition: {
214-
x: extendFlat({}, surfaceAtts.lightposition.x, {dflt: 1e5}),
215-
y: extendFlat({}, surfaceAtts.lightposition.y, {dflt: 1e5}),
216-
z: extendFlat({}, surfaceAtts.lightposition.z, {dflt: 0}),
214+
x: extendFlat({}, surfaceAttrs.lightposition.x, {dflt: 1e5}),
215+
y: extendFlat({}, surfaceAttrs.lightposition.y, {dflt: 1e5}),
216+
z: extendFlat({}, surfaceAttrs.lightposition.z, {dflt: 0}),
217217
editType: 'calc'
218218
},
219219
lighting: extendFlat({
@@ -236,7 +236,7 @@ colorScaleAttrs('', {
236236
description: 'Epsilon for face normals calculation avoids math issues arising from degenerate geometry.'
237237
},
238238
editType: 'calc'
239-
}, surfaceAtts.lighting),
239+
}, surfaceAttrs.lighting),
240240

241241
hoverinfo: extendFlat({}, baseAttrs.hoverinfo, {editType: 'calc'})
242242
});

src/traces/sunburst/attributes.js

+9-9
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
var plotAttrs = require('../../plots/attributes');
1212
var hovertemplateAttrs = require('../../components/fx/hovertemplate_attributes');
1313
var domainAttrs = require('../../plots/domain').attributes;
14-
var pieAtts = require('../pie/attributes');
14+
var pieAttrs = require('../pie/attributes');
1515

1616
var extendFlat = require('../../lib/extend').extendFlat;
1717

@@ -98,14 +98,14 @@ module.exports = {
9898
// },
9999

100100
line: {
101-
color: extendFlat({}, pieAtts.marker.line.color, {
101+
color: extendFlat({}, pieAttrs.marker.line.color, {
102102
dflt: null,
103103
description: [
104104
'Sets the color of the line enclosing each sector.',
105105
'Defaults to the `paper_bgcolor` value.'
106106
].join(' ')
107107
}),
108-
width: extendFlat({}, pieAtts.marker.line.width, {dflt: 1}),
108+
width: extendFlat({}, pieAttrs.marker.line.width, {dflt: 1}),
109109
editType: 'calc'
110110
},
111111
editType: 'calc'
@@ -124,21 +124,21 @@ module.exports = {
124124
editType: 'plot'
125125
},
126126

127-
text: pieAtts.text,
128-
textinfo: extendFlat({}, pieAtts.textinfo, {
127+
text: pieAttrs.text,
128+
textinfo: extendFlat({}, pieAttrs.textinfo, {
129129
editType: 'plot',
130130
flags: ['label', 'text', 'value']
131131
}),
132-
textfont: pieAtts.textfont,
132+
textfont: pieAttrs.textfont,
133133

134-
hovertext: pieAtts.hovertext,
134+
hovertext: pieAttrs.hovertext,
135135
hoverinfo: extendFlat({}, plotAttrs.hoverinfo, {
136136
flags: ['label', 'text', 'value', 'name']
137137
}),
138138
hovertemplate: hovertemplateAttrs(),
139139

140-
insidetextfont: pieAtts.insidetextfont,
141-
outsidetextfont: pieAtts.outsidetextfont,
140+
insidetextfont: pieAttrs.insidetextfont,
141+
outsidetextfont: pieAttrs.outsidetextfont,
142142

143143
domain: domainAttrs({name: 'sunburst', trace: true, editType: 'calc'})
144144
};

0 commit comments

Comments
 (0)