diff --git a/src/plot_api/plot_api.js b/src/plot_api/plot_api.js index fb95d1be99c..828797411f2 100644 --- a/src/plot_api/plot_api.js +++ b/src/plot_api/plot_api.js @@ -2427,7 +2427,7 @@ exports._guiUpdate = guiEdit(update); // Ordered by most common edits first, to minimize our search time var layoutUIControlPatterns = [ {pattern: /^hiddenlabels/, attr: 'legend.uirevision'}, - {pattern: /^((x|y)axis\d*)\.((auto)?range|title)/}, + {pattern: /^((x|y)axis\d*)\.((auto)?range|title\.text)/}, // showspikes and modes include those nested inside scenes {pattern: /axis\d*\.showspikes$/, attr: 'modebar.uirevision'}, @@ -2435,14 +2435,14 @@ var layoutUIControlPatterns = [ {pattern: /^(scene\d*)\.camera/}, {pattern: /^(geo\d*)\.(projection|center)/}, - {pattern: /^(ternary\d*\.[abc]axis)\.(min|title)$/}, - {pattern: /^(polar\d*\.radialaxis)\.((auto)?range|angle|title)/}, + {pattern: /^(ternary\d*\.[abc]axis)\.(min|title\.text)$/}, + {pattern: /^(polar\d*\.radialaxis)\.((auto)?range|angle|title\.text)/}, {pattern: /^(polar\d*\.angularaxis)\.rotation/}, {pattern: /^(mapbox\d*)\.(center|zoom|bearing|pitch)/}, {pattern: /^legend\.(x|y)$/, attr: 'editrevision'}, {pattern: /^(shapes|annotations)/, attr: 'editrevision'}, - {pattern: /^title$/, attr: 'editrevision'} + {pattern: /^title\.text$/, attr: 'editrevision'} ]; // same for trace attributes: if `attr` is given it's in layout, @@ -2461,7 +2461,7 @@ var traceUIControlPatterns = [ // "name" also includes transform.styles {pattern: /(^|value\.)name$/}, // including nested colorbar attributes (ie marker.colorbar) - {pattern: /colorbar\.title$/}, + {pattern: /colorbar\.title\.text$/}, {pattern: /colorbar\.(x|y)$/, attr: 'editrevision'} ]; diff --git a/src/plots/polar/layout_attributes.js b/src/plots/polar/layout_attributes.js index aa7ab38909c..4d878a9fd43 100644 --- a/src/plots/polar/layout_attributes.js +++ b/src/plots/polar/layout_attributes.js @@ -136,6 +136,9 @@ var radialAxisAttrs = { } }; +// radial title is not gui-editable, so it needs dflt: '', similar to carpet axes. +radialAxisAttrs.title.text.dflt = ''; + extendFlat( radialAxisAttrs, diff --git a/test/jasmine/tests/plot_api_react_test.js b/test/jasmine/tests/plot_api_react_test.js index 838f29ecb4c..812eb6f63e5 100644 --- a/test/jasmine/tests/plot_api_react_test.js +++ b/test/jasmine/tests/plot_api_react_test.js @@ -1643,7 +1643,7 @@ describe('Plotly.react and uirevision attributes', function() { function editEditable() { return Registry.call('_guiUpdate', gd, {'colorbar.x': 0.8, 'colorbar.y': 0.6}, - {title: 'yep', 'legend.x': 1.1, 'legend.y': 0.9}, + {'title.text': 'yep', 'legend.x': 1.1, 'legend.y': 0.9}, [2] ); } @@ -1653,7 +1653,7 @@ describe('Plotly.react and uirevision attributes', function() { 'colorbar.x': original ? [undefined, 1.02] : 0.8, 'colorbar.y': original ? [undefined, 0.5] : 0.6 }], { - title: original ? [undefined, 'Click to enter Plot title'] : 'yep', + 'title.text': original ? [undefined, 'Click to enter Plot title'] : 'yep', 'legend.x': original ? [undefined, 1.02] : 1.1, 'legend.y': original ? [undefined, 1] : 0.9 }); @@ -1688,7 +1688,7 @@ describe('Plotly.react and uirevision attributes', function() { return { 'dimensions[0].constraintrange': original ? [[2.5, 3.5]] : [[[1.5, 2.5], [2.938, 3.979]]], 'dimensions[1].constraintrange': original ? undefined : [[6.937, 7.979]], - 'line.colorbar.title': original ? [undefined, 'Click to enter Colorscale title'] : 'color', + 'line.colorbar.title.text': original ? [undefined, 'Click to enter Colorscale title'] : 'color', name: original ? [undefined, 'trace 0'] : 'name' }; } @@ -1700,7 +1700,7 @@ describe('Plotly.react and uirevision attributes', function() { function editTrace() { var _; return Registry.call('_guiRestyle', gd, - {'line.colorbar.title': 'color', name: 'name'}, + {'line.colorbar.title.text': 'color', name: 'name'}, [0] ) .then(function() { @@ -1742,12 +1742,12 @@ describe('Plotly.react and uirevision attributes', function() { function attrs(original) { return { - 'xaxis.title': original ? [undefined, 'Click to enter X axis title'] : 'XXX', - 'yaxis.title': original ? [undefined, 'Click to enter Y axis title'] : 'YYY', - 'ternary.aaxis.title': original ? [undefined, 'Component A'] : 'AAA', - 'ternary.baxis.title': original ? [undefined, 'Component B'] : 'BBB', - 'ternary.caxis.title': original ? [undefined, 'Component C'] : 'CCC', - 'polar.radialaxis.title': original ? [undefined, ''] : 'RRR' + 'xaxis.title.text': original ? [undefined, 'Click to enter X axis title'] : 'XXX', + 'yaxis.title.text': original ? [undefined, 'Click to enter Y axis title'] : 'YYY', + 'ternary.aaxis.title.text': original ? [undefined, 'Component A'] : 'AAA', + 'ternary.baxis.title.text': original ? [undefined, 'Component B'] : 'BBB', + 'ternary.caxis.title.text': original ? [undefined, 'Component C'] : 'CCC', + 'polar.radialaxis.title.text': original ? [undefined, ''] : 'RRR' }; }