Skip to content

Commit b03e777

Browse files
committed
sub metatext -> meta
1 parent 4201f0a commit b03e777

File tree

7 files changed

+29
-29
lines changed

7 files changed

+29
-29
lines changed

src/components/annotations/draw.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -209,8 +209,8 @@ function drawRaw(gd, options, index, subplotId, xa, ya) {
209209

210210
var font = options.font;
211211

212-
var text = fullLayout.metatext ?
213-
Lib.templateString(options.text, {metatext: fullLayout.metatext}) :
212+
var text = fullLayout.meta ?
213+
Lib.templateString(options.text, {meta: fullLayout.meta}) :
214214
options.text;
215215

216216
var annText = annTextGroupInner.append('text')

src/components/titles/index.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,8 @@ function draw(gd, titleClass, options) {
9797
if(!editable) txt = '';
9898
}
9999

100-
if(fullLayout.metatext) {
101-
txt = Lib.templateString(txt, {metatext: fullLayout.metatext});
100+
if(fullLayout.meta) {
101+
txt = Lib.templateString(txt, {meta: fullLayout.meta});
102102
}
103103

104104
var elShouldExist = txt || editable;

src/plots/gl3d/layout/convert.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@ proto.merge = function(fullLayout, sceneLayout) {
8383
}
8484

8585
// Axes labels
86-
opts.labels[i] = fullLayout.metatext ?
87-
Lib.templateString(axes.title.text, {metatext: fullLayout.metatext}) :
86+
opts.labels[i] = fullLayout.meta ?
87+
Lib.templateString(axes.title.text, {meta: fullLayout.meta}) :
8888
axes.title.text;
8989

9090
if('font' in axes.title) {

src/plots/layout_attributes.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -409,14 +409,14 @@ module.exports = {
409409
},
410410
editType: 'modebar'
411411
},
412-
metatext: {
412+
meta: {
413413
valType: 'data_array',
414414
editType: 'plot',
415415
description: [
416416
'Assigns extra meta information that can be used in various `text` attributes.',
417417
'Attributes such as the graph, axis and colorbar `title.text` and annotation `text`',
418-
'support `metatext`. One can access `metatext` fields using template strings:',
419-
'`%{metatext[i]}` where `i` is the index of the `metatext`',
418+
'support `meta`. One can access `meta` fields using template strings:',
419+
'`%{meta[i]}` where `i` is the index of the `meta`',
420420
'item in question.'
421421
].join(' ')
422422
},

src/plots/plots.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1455,7 +1455,7 @@ plots.supplyLayoutGlobalDefaults = function(layoutIn, layoutOut, formatObj) {
14551455
coerce('modebar.activecolor', Color.addOpacity(modebarDefaultColor, 0.7));
14561456
coerce('modebar.uirevision', uirevision);
14571457

1458-
coerce('metatext');
1458+
coerce('meta');
14591459

14601460
Registry.getComponentMethod(
14611461
'calendars',

src/traces/pie/plot.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -334,8 +334,8 @@ module.exports = function plot(gd, cdpie) {
334334
s.attr('data-notex', 1);
335335
});
336336

337-
var txt = fullLayout.metatext ?
338-
Lib.templateString(trace.title.text, {metatext: fullLayout.metatext}) :
337+
var txt = fullLayout.meta ?
338+
Lib.templateString(trace.title.text, {meta: fullLayout.meta}) :
339339
trace.title.text;
340340

341341
titleText.text(txt)
@@ -480,8 +480,8 @@ function prerenderTitles(cdpie, gd) {
480480
trace = cd0.trace;
481481

482482
if(trace.title.text) {
483-
var txt = fullLayout.metatext ?
484-
Lib.templateString(trace.title.text, {metatext: fullLayout.metatext}) :
483+
var txt = fullLayout.meta ?
484+
Lib.templateString(trace.title.text, {meta: fullLayout.meta}) :
485485
trace.title.text;
486486

487487
var dummyTitle = Drawing.tester.append('text')

test/image/mocks/layout_metatext.json

+15-15
Original file line numberDiff line numberDiff line change
@@ -13,57 +13,57 @@
1313
"type": "surface",
1414
"z": [[1, 2, 3], [1, 2, 1], [3, 2, 1]],
1515
"colorbar": {
16-
"title": {"text": "Product %{metatext[0]}", "side": "right"},
16+
"title": {"text": "Product %{meta[0]}", "side": "right"},
1717
"len": 0.3
1818
}
1919
}, {
2020
"type": "pie",
2121
"labels": ["a", "b", "c"],
2222
"values": [1, 2, 3],
2323
"domain": {"row": 0, "column": 1},
24-
"title": {"text": "Employee %{metatext[1]}"}
24+
"title": {"text": "Employee %{meta[1]}"}
2525
}],
2626
"layout": {
27-
"metatext": ["A", "B", "<b>IMPORTANT</b>", "company<sup>TM</sup>", 1000],
27+
"meta": ["A", "B", "<b>IMPORTANT</b>", "company<sup>TM</sup>", 1000],
2828
"grid": {"rows": 3, "columns": 2, "xgap": 0.2, "ygap": 0.35},
2929
"width": 700,
3030
"height": 800,
3131
"margin": {"b": 40},
3232
"showlegend": false,
3333

34-
"title": {"text": "This graph is %{metatext[2]}"},
34+
"title": {"text": "This graph is %{meta[2]}"},
3535
"xaxis": {
3636
"domain": {"row": 0, "column": 0},
37-
"title": {"text": "Worth more than %{metatext[4]} %{metatext[1]}"}
37+
"title": {"text": "Worth more than %{meta[4]} %{meta[1]}"}
3838
},
3939
"yaxis": {
4040
"domain": {"row": 0, "column": 0},
41-
"title": {"text": "$ by %{metatext[3]}"}
41+
"title": {"text": "$ by %{meta[3]}"}
4242
},
4343
"polar": {
4444
"bgcolor": "#d3d3d3",
4545
"domain": {"row": 1, "column": 0},
4646
"radialaxis": {
4747
"title": {
48-
"text": "%{metatext[3]} -> %{metatext[4]}",
48+
"text": "%{meta[3]} -> %{meta[4]}",
4949
"font": {"color": "red"}
5050
}
5151
}
5252
},
5353
"ternary": {
5454
"domain": {"row": 2, "column": 0},
55-
"aaxis": {"title": {"text": "%{metatext[2]}"}},
56-
"baxis": {"title": {"text": "%{metatext[1]}"}},
57-
"caxis": {"title": {"text": "%{metatext[4]}"}}
55+
"aaxis": {"title": {"text": "%{meta[2]}"}},
56+
"baxis": {"title": {"text": "%{meta[1]}"}},
57+
"caxis": {"title": {"text": "%{meta[4]}"}}
5858
},
5959
"scene": {
6060
"domain": {"row": 1, "column": 1},
6161
"camera": {"eye": {"x": 0.01, "y": 0.01, "z": 2.165}},
62-
"xaxis": {"title": {"text": "AX:%{metatext[1]}"}},
63-
"yaxis": {"title": {"text": "AX:%{metatext[0]}"}},
64-
"zaxis": {"title": {"text": "%{metatext[1]}%{metatext[0]}"}},
62+
"xaxis": {"title": {"text": "AX:%{meta[1]}"}},
63+
"yaxis": {"title": {"text": "AX:%{meta[0]}"}},
64+
"zaxis": {"title": {"text": "%{meta[1]}%{meta[0]}"}},
6565
"annotations": [{
66-
"text": "Look at %{metatext[1]}",
66+
"text": "Look at %{meta[1]}",
6767
"bgcolor": "#d3d3d3",
6868
"borderpad": 2,
6969
"bordercolor": "#000",
@@ -75,7 +75,7 @@
7575
},
7676

7777
"annotations": [{
78-
"text": "<i>N.B.</i> %{metatext[2]}",
78+
"text": "<i>N.B.</i> %{meta[2]}",
7979
"xref": "x",
8080
"yref": "y",
8181
"x": 1,

0 commit comments

Comments
 (0)