Skip to content

Commit f755bcb

Browse files
committed
add metatext support to xy & gl3d annotation text
1 parent 17565f9 commit f755bcb

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/components/annotations/draw.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,9 +209,13 @@ 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}) :
214+
options.text;
215+
212216
var annText = annTextGroupInner.append('text')
213217
.classed('annotation-text', true)
214-
.text(options.text);
218+
.text(text);
215219

216220
function textLayout(s) {
217221
s.call(Drawing.font, font)
@@ -678,6 +682,7 @@ function drawRaw(gd, options, index, subplotId, xa, ya) {
678682
.call(textLayout)
679683
.on('edit', function(_text) {
680684
options.text = _text;
685+
681686
this.call(textLayout);
682687

683688
modifyItem('text', _text);

0 commit comments

Comments
 (0)