66* LICENSE file in the root directory of this source tree.
77*/
88
9-
109'use strict' ;
1110
1211var str2RgbaArray = require ( '../../../lib/str2rgbarray' ) ;
12+ var Lib = require ( '../../../lib' ) ;
1313
1414var AXES_NAMES = [ 'xaxis' , 'yaxis' , 'zaxis' ] ;
1515
@@ -66,7 +66,7 @@ function AxesOptions() {
6666
6767var proto = AxesOptions . prototype ;
6868
69- proto . merge = function ( sceneLayout ) {
69+ proto . merge = function ( fullLayout , sceneLayout ) {
7070 var opts = this ;
7171 for ( var i = 0 ; i < 3 ; ++ i ) {
7272 var axes = sceneLayout [ AXES_NAMES [ i ] ] ;
@@ -83,7 +83,10 @@ proto.merge = function(sceneLayout) {
8383 }
8484
8585 // Axes labels
86- opts . labels [ i ] = axes . title . text ;
86+ opts . labels [ i ] = fullLayout . metatext ?
87+ Lib . templateString ( axes . title . text , { metatext : fullLayout . metatext } ) :
88+ axes . title . text ;
89+
8790 if ( 'font' in axes . title ) {
8891 if ( axes . title . font . color ) opts . labelColor [ i ] = str2RgbaArray ( axes . title . font . color ) ;
8992 if ( axes . title . font . family ) opts . labelFont [ i ] = axes . title . font . family ;
@@ -151,9 +154,9 @@ proto.merge = function(sceneLayout) {
151154} ;
152155
153156
154- function createAxesOptions ( plotlyOptions ) {
157+ function createAxesOptions ( fullLayout , sceneLayout ) {
155158 var result = new AxesOptions ( ) ;
156- result . merge ( plotlyOptions ) ;
159+ result . merge ( fullLayout , sceneLayout ) ;
157160 return result ;
158161}
159162
0 commit comments