@@ -90,28 +90,6 @@ exports.cleanLayout = function(layout) {
9090 delete ax . autotick ;
9191 }
9292
93- cleanTitle ( ax ) ;
94- } else if ( polarAttrRegex && polarAttrRegex . test ( key ) ) {
95- // modifications for polar
96-
97- var polar = layout [ key ] ;
98- cleanTitle ( polar . radialaxis ) ;
99- } else if ( ternaryAttrRegex && ternaryAttrRegex . test ( key ) ) {
100- // modifications for ternary
101-
102- var ternary = layout [ key ] ;
103- cleanTitle ( ternary . aaxis ) ;
104- cleanTitle ( ternary . baxis ) ;
105- cleanTitle ( ternary . caxis ) ;
106- } else if ( sceneAttrRegex && sceneAttrRegex . test ( key ) ) {
107- // modifications for 3D scenes
108-
109- var scene = layout [ key ] ;
110-
111- // clean axis titles
112- cleanTitle ( scene . xaxis ) ;
113- cleanTitle ( scene . yaxis ) ;
114- cleanTitle ( scene . zaxis ) ;
11593 }
11694 }
11795
@@ -165,9 +143,6 @@ exports.cleanLayout = function(layout) {
165143 }
166144 }
167145
168- // clean plot title
169- cleanTitle ( layout ) ;
170-
171146 /*
172147 * Moved from rotate -> orbit for dragmode
173148 */
@@ -193,44 +168,6 @@ function cleanAxRef(container, attr) {
193168 }
194169}
195170
196- /**
197- * Cleans up old title attribute structure (flat) in favor of the new one (nested).
198- *
199- * @param {Object } titleContainer - an object potentially including deprecated title attributes
200- */
201- function cleanTitle ( titleContainer ) {
202- if ( titleContainer ) {
203- // title -> title.text
204- // (although title used to be a string attribute,
205- // numbers are accepted as well)
206- if ( typeof titleContainer . title === 'string' || typeof titleContainer . title === 'number' ) {
207- titleContainer . title = {
208- text : titleContainer . title
209- } ;
210- }
211-
212- rewireAttr ( 'titlefont' , 'font' ) ;
213- rewireAttr ( 'titleposition' , 'position' ) ;
214- rewireAttr ( 'titleside' , 'side' ) ;
215- rewireAttr ( 'titleoffset' , 'offset' ) ;
216- }
217-
218- function rewireAttr ( oldAttrName , newAttrName ) {
219- var oldAttrSet = titleContainer [ oldAttrName ] ;
220- var newAttrSet = titleContainer . title && titleContainer . title [ newAttrName ] ;
221-
222- if ( oldAttrSet && ! newAttrSet ) {
223- // Ensure title object exists
224- if ( ! titleContainer . title ) {
225- titleContainer . title = { } ;
226- }
227-
228- titleContainer . title [ newAttrName ] = titleContainer [ oldAttrName ] ;
229- delete titleContainer [ oldAttrName ] ;
230- }
231- }
232- }
233-
234171/*
235172 * cleanData: Make a few changes to the data for backward compatibility
236173 * before it gets used for anything. Modifies the data traces users provide.
@@ -410,13 +347,6 @@ exports.cleanData = function(data) {
410347 delete trace . autobiny ;
411348 delete trace . ybins ;
412349 }
413-
414- cleanTitle ( trace ) ;
415- if ( trace . colorbar ) cleanTitle ( trace . colorbar ) ;
416- if ( trace . marker && trace . marker . colorbar ) cleanTitle ( trace . marker . colorbar ) ;
417- if ( trace . line && trace . line . colorbar ) cleanTitle ( trace . line . colorbar ) ;
418- if ( trace . aaxis ) cleanTitle ( trace . aaxis ) ;
419- if ( trace . baxis ) cleanTitle ( trace . baxis ) ;
420350 }
421351} ;
422352
0 commit comments