From 072fbeec2a7fe3d50ecd3e1eb2cb8925e2c0f121 Mon Sep 17 00:00:00 2001 From: Emily Kellison-Linn <4672118+emilykl@users.noreply.github.com> Date: Wed, 16 Oct 2024 19:51:43 -0400 Subject: [PATCH 1/5] reinstate support for title-as-string --- src/components/colorbar/attributes.js | 6 +++ src/plot_api/helpers.js | 52 ++++++++++++++++++++++++ src/plot_api/plot_api.js | 38 +++++++++++++++++ src/plots/cartesian/layout_attributes.js | 5 +++ src/plots/gl3d/layout/axis_attributes.js | 3 ++ src/plots/layout_attributes.js | 7 ++++ src/plots/polar/layout_attributes.js | 4 ++ src/plots/ternary/layout_attributes.js | 3 ++ src/traces/carpet/axis_attributes.js | 12 +++++- src/traces/pie/attributes.js | 9 ++++ 10 files changed, 138 insertions(+), 1 deletion(-) diff --git a/src/components/colorbar/attributes.js b/src/components/colorbar/attributes.js index 3a562b516a0..75ea3aa19c9 100644 --- a/src/components/colorbar/attributes.js +++ b/src/components/colorbar/attributes.js @@ -228,4 +228,10 @@ module.exports = overrideAll({ ].join(' ') } }, + _deprecated: { + title: { + valType: 'string', + description: 'It is recommended to use the color bar\'s `title.text` attribute instead.' + } + } }, 'colorbars', 'from-root'); diff --git a/src/plot_api/helpers.js b/src/plot_api/helpers.js index ff8ca40c986..844d2a692be 100644 --- a/src/plot_api/helpers.js +++ b/src/plot_api/helpers.js @@ -90,6 +90,29 @@ exports.cleanLayout = function(layout) { delete ax.autotick; } + cleanTitle(ax); + } else if(polarAttrRegex && polarAttrRegex.test(key)) { + // modifications for polar + + var polar = layout[key]; + cleanTitle(polar.radialaxis); + } else if(ternaryAttrRegex && ternaryAttrRegex.test(key)) { + // modifications for ternary + + var ternary = layout[key]; + cleanTitle(ternary.aaxis); + cleanTitle(ternary.baxis); + cleanTitle(ternary.caxis); + } else if(sceneAttrRegex && sceneAttrRegex.test(key)) { + // modifications for 3D scenes + + var scene = layout[key]; + + // clean axis titles + cleanTitle(scene.xaxis); + cleanTitle(scene.yaxis); + cleanTitle(scene.zaxis); + } } @@ -143,6 +166,9 @@ exports.cleanLayout = function(layout) { } } + // clean plot title + cleanTitle(layout); + /* * Moved from rotate -> orbit for dragmode */ @@ -168,6 +194,25 @@ function cleanAxRef(container, attr) { } } +/** + * Cleans up old title-as-string attribute by moving a string passed as `title` to `title.text`. + * + * @param {Object} titleContainer - an object potentially including a `title` attribute + * which may be a string + */ +function cleanTitle(titleContainer) { + if(titleContainer) { + // title -> title.text + // (although title used to be a string attribute, + // numbers are accepted as well) + if(typeof titleContainer.title === 'string' || typeof titleContainer.title === 'number') { + titleContainer.title = { + text: titleContainer.title + }; + } + } +} + /* * cleanData: Make a few changes to the data for backward compatibility * before it gets used for anything. Modifies the data traces users provide. @@ -347,6 +392,13 @@ exports.cleanData = function(data) { delete trace.autobiny; delete trace.ybins; } + + cleanTitle(trace); + if(trace.colorbar) cleanTitle(trace.colorbar); + if(trace.marker && trace.marker.colorbar) cleanTitle(trace.marker.colorbar); + if(trace.line && trace.line.colorbar) cleanTitle(trace.line.colorbar); + if(trace.aaxis) cleanTitle(trace.aaxis); + if(trace.baxis) cleanTitle(trace.baxis); } }; diff --git a/src/plot_api/plot_api.js b/src/plot_api/plot_api.js index ff5c0b62aa5..9b79f7a51a2 100644 --- a/src/plot_api/plot_api.js +++ b/src/plot_api/plot_api.js @@ -1397,6 +1397,8 @@ function _restyle(gd, aobj, traces) { var eventData = Lib.extendDeepAll({}, aobj); var i; + cleanTitleAttribute(aobj); + // initialize flags var flags = editTypes.traceFlags(); @@ -1698,6 +1700,40 @@ function _restyle(gd, aobj, traces) { }; } +/** + * When a string is passed to the title attribute, convert it + * to title.text instead. + * + * This is needed for the update mechanism to determine which + * subroutines to run based on the actual attribute + * definitions (that don't include the deprecated ones). + * + * E.g. Maps {'xaxis.title': 'A chart'} to {'xaxis.title.text': 'A chart'}. + * + * @param aobj + */ +function cleanTitleAttribute(aobj) { + var oldAxisTitleRegex = Lib.counterRegex('axis', '\.title', false, false); + var colorbarRegex = /colorbar\.title$/; + var keys = Object.keys(aobj); + var i, key, value; + + for(i = 0; i < keys.length; i++) { + key = keys[i]; + value = aobj[key]; + + if((key === 'title' || oldAxisTitleRegex.test(key) || colorbarRegex.test(key)) && + (typeof value === 'string' || typeof value === 'number')) { + replace(key, key.replace('title', 'title.text')); + } + } + + function replace(oldAttrStr, newAttrStr) { + aobj[newAttrStr] = aobj[oldAttrStr]; + delete aobj[oldAttrStr]; + } +} + /** * relayout: update layout attributes of an existing plot * @@ -1883,6 +1919,8 @@ function _relayout(gd, aobj) { keys = Object.keys(aobj); + cleanTitleAttribute(aobj); + // look for 'allaxes', split out into all axes // in case of 3D the axis are nested within a scene which is held in _id for(i = 0; i < keys.length; i++) { diff --git a/src/plots/cartesian/layout_attributes.js b/src/plots/cartesian/layout_attributes.js index e52643debd4..d32333a5335 100644 --- a/src/plots/cartesian/layout_attributes.js +++ b/src/plots/cartesian/layout_attributes.js @@ -1241,5 +1241,10 @@ module.exports = { 'Set `tickmode` to *linear* for `autotick` *false*.' ].join(' ') }, + title: { + valType: 'string', + editType: 'ticks', + description: 'It is recommended to use the layout\'s `title.text` attribute instead.' + }, } }; diff --git a/src/plots/gl3d/layout/axis_attributes.js b/src/plots/gl3d/layout/axis_attributes.js index b501c570575..9d24ade3fb4 100644 --- a/src/plots/gl3d/layout/axis_attributes.js +++ b/src/plots/gl3d/layout/axis_attributes.js @@ -121,4 +121,7 @@ module.exports = overrideAll({ zeroline: axesAttrs.zeroline, zerolinecolor: axesAttrs.zerolinecolor, zerolinewidth: axesAttrs.zerolinewidth, + _deprecated: { + title: axesAttrs._deprecated.title + } }, 'plot', 'from-root'); diff --git a/src/plots/layout_attributes.js b/src/plots/layout_attributes.js index 60540e53b94..fefe5ff86c7 100644 --- a/src/plots/layout_attributes.js +++ b/src/plots/layout_attributes.js @@ -451,4 +451,11 @@ module.exports = { ].join(' '), editType: 'none' }), + _deprecated: { + title: { + valType: 'string', + editType: 'layoutstyle', + description: 'It is recommended to use the layout\'s `title.text` attribute instead.' + } + } }; diff --git a/src/plots/polar/layout_attributes.js b/src/plots/polar/layout_attributes.js index 052749af701..1c6512d5bcc 100644 --- a/src/plots/polar/layout_attributes.js +++ b/src/plots/polar/layout_attributes.js @@ -146,6 +146,10 @@ var radialAxisAttrs = { }, editType: 'calc', + + _deprecated: { + title: axesAttrs._deprecated.title + } }; extendFlat( diff --git a/src/plots/ternary/layout_attributes.js b/src/plots/ternary/layout_attributes.js index abc6fe29f6f..7ba9be54326 100644 --- a/src/plots/ternary/layout_attributes.js +++ b/src/plots/ternary/layout_attributes.js @@ -62,6 +62,9 @@ var ternaryAxesAttrs = { 'all the minima set to zero.' ].join(' ') }, + _deprecated: { + title: axesAttrs._deprecated.title + } }; var attrs = module.exports = overrideAll({ diff --git a/src/traces/carpet/axis_attributes.js b/src/traces/carpet/axis_attributes.js index 688f1a11a50..994f5a50082 100644 --- a/src/traces/carpet/axis_attributes.js +++ b/src/traces/carpet/axis_attributes.js @@ -451,5 +451,15 @@ module.exports = { editType: 'calc', description: 'The stride between grid lines along the axis' }, - editType: 'calc' + + + _deprecated: { + title: { + valType: 'string', + editType: 'calc', + description: 'It is recommended to use the axis\'s `title.text` attribute instead.' + } + }, + + editType: 'calc', }; diff --git a/src/traces/pie/attributes.js b/src/traces/pie/attributes.js index cd1c657346f..36d289075b6 100644 --- a/src/traces/pie/attributes.js +++ b/src/traces/pie/attributes.js @@ -292,4 +292,13 @@ module.exports = { 'or an array to highlight one or more slices.' ].join(' ') }, + + _deprecated: { + title: { + valType: 'string', + dflt: '', + editType: 'calc', + description: 'It is recommended to use the pie\'s `title.text` attribute instead.' + } + } }; From 42caf57c3b392db9e988255412435acbeaa0109b Mon Sep 17 00:00:00 2001 From: Emily Kellison-Linn <4672118+emilykl@users.noreply.github.com> Date: Wed, 16 Oct 2024 19:52:18 -0400 Subject: [PATCH 2/5] update jasmine tests --- test/jasmine/tests/funnelarea_test.js | 18 ++++++ test/jasmine/tests/pie_test.js | 18 ++++++ test/jasmine/tests/plot_api_test.js | 24 ++++++++ test/jasmine/tests/titles_test.js | 80 +++++++++++++++++++++++++++ 4 files changed, 140 insertions(+) diff --git a/test/jasmine/tests/funnelarea_test.js b/test/jasmine/tests/funnelarea_test.js index 078a29f8f9b..6fa86e18cca 100644 --- a/test/jasmine/tests/funnelarea_test.js +++ b/test/jasmine/tests/funnelarea_test.js @@ -568,6 +568,24 @@ describe('Funnelarea traces', function() { .then(done, done.fail); }); + it('should be able to restyle title despite using deprecated title-as-string', function(done) { + Plotly.newPlot(gd, [{ + type: 'funnelarea', + values: [1, 2, 3], + title: 'yo', + }]) + .then(function() { + _assertTitle('base', 'yo', 'rgb(0, 0, 0)'); + return Plotly.restyle(gd, { + title: 'oy', + }); + }) + .then(function() { + _assertTitle('base', 'oy', 'rgb(0, 0, 0)'); + }) + .then(done, done.fail); + }); + it('should be able to react with new text colors', function(done) { Plotly.newPlot(gd, [{ type: 'funnelarea', diff --git a/test/jasmine/tests/pie_test.js b/test/jasmine/tests/pie_test.js index d1820868f82..7bfdcf286c2 100644 --- a/test/jasmine/tests/pie_test.js +++ b/test/jasmine/tests/pie_test.js @@ -786,6 +786,24 @@ describe('Pie traces', function() { .then(done, done.fail); }); + it('should be able to restyle title despite using deprecated title-as-string', function(done) { + Plotly.newPlot(gd, [{ + type: 'funnelarea', + values: [1, 2, 3], + title: 'yo', + }]) + .then(function() { + _assertTitle('base', 'yo', 'rgb(0, 0, 0)'); + return Plotly.restyle(gd, { + title: 'oy', + }); + }) + .then(function() { + _assertTitle('base', 'oy', 'rgb(0, 0, 0)'); + }) + .then(done, done.fail); + }); + it('should be able to react with new text colors', function(done) { Plotly.newPlot(gd, [{ type: 'pie', diff --git a/test/jasmine/tests/plot_api_test.js b/test/jasmine/tests/plot_api_test.js index 988c7763364..b39b9ce1851 100644 --- a/test/jasmine/tests/plot_api_test.js +++ b/test/jasmine/tests/plot_api_test.js @@ -526,6 +526,30 @@ describe('Test plot api', function() { .then(assertSizeAndThen(543, 432, true, 'final back to autosize')) .then(done, done.fail); }); + + it('passes update data back to plotly_relayout unmodified ' + + 'even if deprecated title-as-string has been used', function(done) { + Plotly.newPlot(gd, [{y: [1, 3, 2]}]) + .then(function() { + gd.on('plotly_relayout', function(eventData) { + expect(eventData).toEqual({ + title: 'Plotly chart', + 'xaxis.title': 'X', + 'yaxis.title': 'Y', + 'polar.radialaxis.title': 'Radial' + }); + done(); + }); + + return Plotly.relayout(gd, { + title: 'Plotly chart', + 'xaxis.title': 'X', + 'yaxis.title': 'Y', + 'polar.radialaxis.title': 'Radial' + }); + }) + .then(done, done.fail); + }); }); describe('Plotly.relayout subroutines switchboard', function() { diff --git a/test/jasmine/tests/titles_test.js b/test/jasmine/tests/titles_test.js index 839cbdd55b3..5ee1dea36bd 100644 --- a/test/jasmine/tests/titles_test.js +++ b/test/jasmine/tests/titles_test.js @@ -52,6 +52,15 @@ describe('Plot title', function() { .then(done, done.fail); }); + it('can still be defined as `layout.title` to ensure backwards-compatibility', function(done) { + Plotly.newPlot(gd, data, {title: 'Plotly line chart'}) + .then(function() { + expectTitle('Plotly line chart'); + expectDefaultCenteredPosition(gd); + }) + .then(done, done.fail); + }); + it('can be updated via `relayout`', function(done) { Plotly.newPlot(gd, data, { title: { text: 'Plotly line chart' } }) .then(expectTitleFn('Plotly line chart')) @@ -619,6 +628,23 @@ describe('Titles can be updated', function() { 'xaxis.title.text': NEW_XTITLE, 'yaxis.title.text': NEW_YTITLE } + }, + { + desc: 'despite passing title only as a string (backwards-compatibility)', + update: { + title: NEW_TITLE, + xaxis: {title: NEW_XTITLE}, + yaxis: {title: NEW_YTITLE} + } + }, + { + desc: 'despite passing title only as a string using string attributes ' + + '(backwards-compatibility)', + update: { + title: NEW_TITLE, + 'xaxis.title': NEW_XTITLE, + 'yaxis.title': NEW_YTITLE + } } ].forEach(function(testCase) { it('via `Plotly.relayout` ' + testCase.desc, function(done) { @@ -869,6 +895,60 @@ describe('Title fonts can be updated', function() { } }); +describe('Titles for multiple axes', function() { + 'use strict'; + + var data = [ + {x: [1, 2, 3], y: [1, 2, 3], xaxis: 'x', yaxis: 'y'}, + {x: [1, 2, 3], y: [3, 2, 1], xaxis: 'x2', yaxis: 'y2'} + ]; + var multiAxesLayout = { + xaxis: { title: 'X-Axis 1' }, + xaxis2: { + title: 'X-Axis 2', + side: 'top' + }, + yaxis: { title: 'Y-Axis 1' }, + yaxis2: { + title: 'Y-Axis 2', + side: 'right' + } + }; + var gd; + + beforeEach(function() { + gd = createGraphDiv(); + }); + + afterEach(destroyGraphDiv); + + it('still supports deprecated title-as-string (backwards-compatibility)', function(done) { + Plotly.newPlot(gd, data, multiAxesLayout) + .then(function() { + expect(xTitleSel(1).text()).toBe('X-Axis 1'); + expect(xTitleSel(2).text()).toBe('X-Axis 2'); + expect(yTitleSel(1).text()).toBe('Y-Axis 1'); + expect(yTitleSel(2).text()).toBe('Y-Axis 2'); + }) + .then(done, done.fail); + }); + + it('can be updated using deprecated title-as-string (backwards-compatibility)', function(done) { + Plotly.newPlot(gd, data, multiAxesLayout) + .then(function() { + return Plotly.relayout(gd, { + 'xaxis2.title': '2nd X-Axis', + 'yaxis2.title': '2nd Y-Axis', + }); + }) + .then(function() { + expect(xTitleSel(2).text()).toBe('2nd X-Axis'); + expect(yTitleSel(2).text()).toBe('2nd Y-Axis'); + }) + .then(done, done.fail); + }); +}); + // TODO: Add in tests for interactions with other automargined elements describe('Title automargining', function() { 'use strict'; From 5a410bb0e8dde1aed898fb8708c03623b94e512b Mon Sep 17 00:00:00 2001 From: Emily Kellison-Linn <4672118+emilykl@users.noreply.github.com> Date: Wed, 16 Oct 2024 19:53:07 -0400 Subject: [PATCH 3/5] update plot-schema --- test/plot-schema.json | 361 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 361 insertions(+) diff --git a/test/plot-schema.json b/test/plot-schema.json index 1fd64ae1281..f88c069b3b8 100644 --- a/test/plot-schema.json +++ b/test/plot-schema.json @@ -596,6 +596,13 @@ }, "layout": { "layoutAttributes": { + "_deprecated": { + "title": { + "description": "It is recommended to use the layout's `title.text` attribute instead.", + "editType": "layoutstyle", + "valType": "string" + } + }, "activeselection": { "editType": "none", "fillcolor": { @@ -1224,6 +1231,13 @@ "valType": "number" }, "colorbar": { + "_deprecated": { + "title": { + "description": "It is recommended to use the color bar's `title.text` attribute instead.", + "editType": "colorbars", + "valType": "string" + } + }, "bgcolor": { "description": "Sets the color of padded area.", "dflt": "rgba(0,0,0,0)", @@ -5632,6 +5646,13 @@ "valType": "number" }, "radialaxis": { + "_deprecated": { + "title": { + "description": "It is recommended to use the layout's `title.text` attribute instead.", + "editType": "ticks", + "valType": "string" + } + }, "angle": { "description": "Sets the angle (in degrees) from which the radial axis is drawn. Note that by default, radial axis line on the theta=0 line corresponds to a line pointing right (like what mathematicians prefer). Defaults to the first `polar.sector` angle.", "editType": "plot", @@ -7062,6 +7083,13 @@ "valType": "any" }, "xaxis": { + "_deprecated": { + "title": { + "description": "It is recommended to use the layout's `title.text` attribute instead.", + "editType": "plot", + "valType": "string" + } + }, "autorange": { "description": "Determines whether or not the range of this axis is computed in relation to the input data. See `rangemode` for more info. If `range` is provided and it has a value for both the lower and upper bound, `autorange` is set to *false*. Using *min* applies autorange only to set the minimum. Using *max* applies autorange only to set the maximum. Using *min reversed* applies autorange only to set the minimum on a reversed axis. Using *max reversed* applies autorange only to set the maximum on a reversed axis. Using *reversed* applies autorange on both ends and reverses the axis direction.", "dflt": true, @@ -7801,6 +7829,13 @@ } }, "yaxis": { + "_deprecated": { + "title": { + "description": "It is recommended to use the layout's `title.text` attribute instead.", + "editType": "plot", + "valType": "string" + } + }, "autorange": { "description": "Determines whether or not the range of this axis is computed in relation to the input data. See `rangemode` for more info. If `range` is provided and it has a value for both the lower and upper bound, `autorange` is set to *false*. Using *min* applies autorange only to set the minimum. Using *max* applies autorange only to set the maximum. Using *min reversed* applies autorange only to set the minimum on a reversed axis. Using *max reversed* applies autorange only to set the maximum on a reversed axis. Using *reversed* applies autorange on both ends and reverses the axis direction.", "dflt": true, @@ -8540,6 +8575,13 @@ } }, "zaxis": { + "_deprecated": { + "title": { + "description": "It is recommended to use the layout's `title.text` attribute instead.", + "editType": "plot", + "valType": "string" + } + }, "autorange": { "description": "Determines whether or not the range of this axis is computed in relation to the input data. See `rangemode` for more info. If `range` is provided and it has a value for both the lower and upper bound, `autorange` is set to *false*. Using *min* applies autorange only to set the minimum. Using *max* applies autorange only to set the maximum. Using *min reversed* applies autorange only to set the minimum on a reversed axis. Using *max reversed* applies autorange only to set the maximum on a reversed axis. Using *reversed* applies autorange on both ends and reverses the axis direction.", "dflt": true, @@ -11085,6 +11127,13 @@ "ternary": { "_isSubplotObj": true, "aaxis": { + "_deprecated": { + "title": { + "description": "It is recommended to use the layout's `title.text` attribute instead.", + "editType": "plot", + "valType": "string" + } + }, "color": { "description": "Sets default for all colors associated with this axis all at once: line, font, tick, and grid colors. Grid color is lightened by blending this with the plot background Individual pieces can override this.", "dflt": "#444", @@ -11598,6 +11647,13 @@ } }, "baxis": { + "_deprecated": { + "title": { + "description": "It is recommended to use the layout's `title.text` attribute instead.", + "editType": "plot", + "valType": "string" + } + }, "color": { "description": "Sets default for all colors associated with this axis all at once: line, font, tick, and grid colors. Grid color is lightened by blending this with the plot background Individual pieces can override this.", "dflt": "#444", @@ -12117,6 +12173,13 @@ "valType": "color" }, "caxis": { + "_deprecated": { + "title": { + "description": "It is recommended to use the layout's `title.text` attribute instead.", + "editType": "plot", + "valType": "string" + } + }, "color": { "description": "Sets default for all colors associated with this axis all at once: line, font, tick, and grid colors. Grid color is lightened by blending this with the plot background Individual pieces can override this.", "dflt": "#444", @@ -13432,6 +13495,11 @@ "description": "Obsolete. Set `tickmode` to *auto* for old `autotick` *true* behavior. Set `tickmode` to *linear* for `autotick` *false*.", "editType": "ticks", "valType": "boolean" + }, + "title": { + "description": "It is recommended to use the layout's `title.text` attribute instead.", + "editType": "ticks", + "valType": "string" } }, "_isSubplotObj": true, @@ -14984,6 +15052,11 @@ "description": "Obsolete. Set `tickmode` to *auto* for old `autotick` *true* behavior. Set `tickmode` to *linear* for `autotick` *false*.", "editType": "ticks", "valType": "boolean" + }, + "title": { + "description": "It is recommended to use the layout's `title.text` attribute instead.", + "editType": "ticks", + "valType": "string" } }, "_isSubplotObj": true, @@ -17056,6 +17129,13 @@ "valType": "subplotid" }, "colorbar": { + "_deprecated": { + "title": { + "description": "It is recommended to use the color bar's `title.text` attribute instead.", + "editType": "colorbars", + "valType": "string" + } + }, "bgcolor": { "description": "Sets the color of padded area.", "dflt": "rgba(0,0,0,0)", @@ -19099,6 +19179,13 @@ "valType": "subplotid" }, "colorbar": { + "_deprecated": { + "title": { + "description": "It is recommended to use the color bar's `title.text` attribute instead.", + "editType": "colorbars", + "valType": "string" + } + }, "bgcolor": { "description": "Sets the color of padded area.", "dflt": "rgba(0,0,0,0)", @@ -22472,6 +22559,13 @@ "valType": "number" }, "aaxis": { + "_deprecated": { + "title": { + "description": "It is recommended to use the axis's `title.text` attribute instead.", + "editType": "calc", + "valType": "string" + } + }, "arraydtick": { "description": "The stride between grid lines along the axis", "dflt": 1, @@ -23143,6 +23237,13 @@ "valType": "number" }, "baxis": { + "_deprecated": { + "title": { + "description": "It is recommended to use the axis's `title.text` attribute instead.", + "editType": "calc", + "valType": "string" + } + }, "arraydtick": { "description": "The stride between grid lines along the axis", "dflt": 1, @@ -24199,6 +24300,13 @@ "valType": "subplotid" }, "colorbar": { + "_deprecated": { + "title": { + "description": "It is recommended to use the color bar's `title.text` attribute instead.", + "editType": "colorbars", + "valType": "string" + } + }, "bgcolor": { "description": "Sets the color of padded area.", "dflt": "rgba(0,0,0,0)", @@ -25496,6 +25604,13 @@ "valType": "subplotid" }, "colorbar": { + "_deprecated": { + "title": { + "description": "It is recommended to use the color bar's `title.text` attribute instead.", + "editType": "colorbars", + "valType": "string" + } + }, "bgcolor": { "description": "Sets the color of padded area.", "dflt": "rgba(0,0,0,0)", @@ -26783,6 +26898,13 @@ "valType": "subplotid" }, "colorbar": { + "_deprecated": { + "title": { + "description": "It is recommended to use the color bar's `title.text` attribute instead.", + "editType": "colorbars", + "valType": "string" + } + }, "bgcolor": { "description": "Sets the color of padded area.", "dflt": "rgba(0,0,0,0)", @@ -28109,6 +28231,13 @@ "valType": "subplotid" }, "colorbar": { + "_deprecated": { + "title": { + "description": "It is recommended to use the color bar's `title.text` attribute instead.", + "editType": "colorbars", + "valType": "string" + } + }, "bgcolor": { "description": "Sets the color of padded area.", "dflt": "rgba(0,0,0,0)", @@ -29454,6 +29583,13 @@ "valType": "subplotid" }, "colorbar": { + "_deprecated": { + "title": { + "description": "It is recommended to use the color bar's `title.text` attribute instead.", + "editType": "colorbars", + "valType": "string" + } + }, "bgcolor": { "description": "Sets the color of padded area.", "dflt": "rgba(0,0,0,0)", @@ -31281,6 +31417,13 @@ "valType": "subplotid" }, "colorbar": { + "_deprecated": { + "title": { + "description": "It is recommended to use the color bar's `title.text` attribute instead.", + "editType": "colorbars", + "valType": "string" + } + }, "bgcolor": { "description": "Sets the color of padded area.", "dflt": "rgba(0,0,0,0)", @@ -32507,6 +32650,13 @@ "valType": "subplotid" }, "colorbar": { + "_deprecated": { + "title": { + "description": "It is recommended to use the color bar's `title.text` attribute instead.", + "editType": "colorbars", + "valType": "string" + } + }, "bgcolor": { "description": "Sets the color of padded area.", "dflt": "rgba(0,0,0,0)", @@ -33732,6 +33882,13 @@ "valType": "subplotid" }, "colorbar": { + "_deprecated": { + "title": { + "description": "It is recommended to use the color bar's `title.text` attribute instead.", + "editType": "colorbars", + "valType": "string" + } + }, "bgcolor": { "description": "Sets the color of padded area.", "dflt": "rgba(0,0,0,0)", @@ -35619,6 +35776,13 @@ "valType": "subplotid" }, "colorbar": { + "_deprecated": { + "title": { + "description": "It is recommended to use the color bar's `title.text` attribute instead.", + "editType": "colorbars", + "valType": "string" + } + }, "bgcolor": { "description": "Sets the color of padded area.", "dflt": "rgba(0,0,0,0)", @@ -38252,6 +38416,13 @@ "valType": "subplotid" }, "colorbar": { + "_deprecated": { + "title": { + "description": "It is recommended to use the color bar's `title.text` attribute instead.", + "editType": "colorbars", + "valType": "string" + } + }, "bgcolor": { "description": "Sets the color of padded area.", "dflt": "rgba(0,0,0,0)", @@ -40604,6 +40775,13 @@ "valType": "subplotid" }, "colorbar": { + "_deprecated": { + "title": { + "description": "It is recommended to use the color bar's `title.text` attribute instead.", + "editType": "colorbars", + "valType": "string" + } + }, "bgcolor": { "description": "Sets the color of padded area.", "dflt": "rgba(0,0,0,0)", @@ -42060,6 +42238,13 @@ "valType": "subplotid" }, "colorbar": { + "_deprecated": { + "title": { + "description": "It is recommended to use the color bar's `title.text` attribute instead.", + "editType": "colorbars", + "valType": "string" + } + }, "bgcolor": { "description": "Sets the color of padded area.", "dflt": "rgba(0,0,0,0)", @@ -43568,6 +43753,13 @@ "valType": "subplotid" }, "colorbar": { + "_deprecated": { + "title": { + "description": "It is recommended to use the color bar's `title.text` attribute instead.", + "editType": "colorbars", + "valType": "string" + } + }, "bgcolor": { "description": "Sets the color of padded area.", "dflt": "rgba(0,0,0,0)", @@ -45939,6 +46131,13 @@ "valType": "subplotid" }, "colorbar": { + "_deprecated": { + "title": { + "description": "It is recommended to use the color bar's `title.text` attribute instead.", + "editType": "colorbars", + "valType": "string" + } + }, "bgcolor": { "description": "Sets the color of padded area.", "dflt": "rgba(0,0,0,0)", @@ -49313,6 +49512,13 @@ "valType": "subplotid" }, "colorbar": { + "_deprecated": { + "title": { + "description": "It is recommended to use the color bar's `title.text` attribute instead.", + "editType": "calc", + "valType": "string" + } + }, "bgcolor": { "description": "Sets the color of padded area.", "dflt": "rgba(0,0,0,0)", @@ -50833,6 +51039,13 @@ "valType": "subplotid" }, "colorbar": { + "_deprecated": { + "title": { + "description": "It is recommended to use the color bar's `title.text` attribute instead.", + "editType": "colorbars", + "valType": "string" + } + }, "bgcolor": { "description": "Sets the color of padded area.", "dflt": "rgba(0,0,0,0)", @@ -53439,6 +53652,13 @@ "valType": "subplotid" }, "colorbar": { + "_deprecated": { + "title": { + "description": "It is recommended to use the color bar's `title.text` attribute instead.", + "editType": "colorbars", + "valType": "string" + } + }, "bgcolor": { "description": "Sets the color of padded area.", "dflt": "rgba(0,0,0,0)", @@ -54732,6 +54952,13 @@ "valType": "subplotid" }, "colorbar": { + "_deprecated": { + "title": { + "description": "It is recommended to use the color bar's `title.text` attribute instead.", + "editType": "colorbars", + "valType": "string" + } + }, "bgcolor": { "description": "Sets the color of padded area.", "dflt": "rgba(0,0,0,0)", @@ -55717,6 +55944,14 @@ "pie": { "animatable": false, "attributes": { + "_deprecated": { + "title": { + "description": "It is recommended to use the pie's `title.text` attribute instead.", + "dflt": "", + "editType": "calc", + "valType": "string" + } + }, "automargin": { "description": "Determines whether outside text labels can push the margins.", "dflt": false, @@ -59455,6 +59690,13 @@ "valType": "subplotid" }, "colorbar": { + "_deprecated": { + "title": { + "description": "It is recommended to use the color bar's `title.text` attribute instead.", + "editType": "colorbars", + "valType": "string" + } + }, "bgcolor": { "description": "Sets the color of padded area.", "dflt": "rgba(0,0,0,0)", @@ -62095,6 +62337,13 @@ "valType": "subplotid" }, "colorbar": { + "_deprecated": { + "title": { + "description": "It is recommended to use the color bar's `title.text` attribute instead.", + "editType": "calc", + "valType": "string" + } + }, "bgcolor": { "description": "Sets the color of padded area.", "dflt": "rgba(0,0,0,0)", @@ -62804,6 +63053,13 @@ "valType": "subplotid" }, "colorbar": { + "_deprecated": { + "title": { + "description": "It is recommended to use the color bar's `title.text` attribute instead.", + "editType": "calc", + "valType": "string" + } + }, "bgcolor": { "description": "Sets the color of padded area.", "dflt": "rgba(0,0,0,0)", @@ -64641,6 +64897,13 @@ "valType": "subplotid" }, "colorbar": { + "_deprecated": { + "title": { + "description": "It is recommended to use the color bar's `title.text` attribute instead.", + "editType": "colorbars", + "valType": "string" + } + }, "bgcolor": { "description": "Sets the color of padded area.", "dflt": "rgba(0,0,0,0)", @@ -66938,6 +67201,13 @@ "valType": "subplotid" }, "colorbar": { + "_deprecated": { + "title": { + "description": "It is recommended to use the color bar's `title.text` attribute instead.", + "editType": "calc", + "valType": "string" + } + }, "bgcolor": { "description": "Sets the color of padded area.", "dflt": "rgba(0,0,0,0)", @@ -69350,6 +69620,13 @@ "valType": "subplotid" }, "colorbar": { + "_deprecated": { + "title": { + "description": "It is recommended to use the color bar's `title.text` attribute instead.", + "editType": "calc", + "valType": "string" + } + }, "bgcolor": { "description": "Sets the color of padded area.", "dflt": "rgba(0,0,0,0)", @@ -71682,6 +71959,13 @@ "valType": "subplotid" }, "colorbar": { + "_deprecated": { + "title": { + "description": "It is recommended to use the color bar's `title.text` attribute instead.", + "editType": "calc", + "valType": "string" + } + }, "bgcolor": { "description": "Sets the color of padded area.", "dflt": "rgba(0,0,0,0)", @@ -73229,6 +73513,13 @@ "valType": "subplotid" }, "colorbar": { + "_deprecated": { + "title": { + "description": "It is recommended to use the color bar's `title.text` attribute instead.", + "editType": "calc", + "valType": "string" + } + }, "bgcolor": { "description": "Sets the color of padded area.", "dflt": "rgba(0,0,0,0)", @@ -74759,6 +75050,13 @@ "valType": "subplotid" }, "colorbar": { + "_deprecated": { + "title": { + "description": "It is recommended to use the color bar's `title.text` attribute instead.", + "editType": "colorbars", + "valType": "string" + } + }, "bgcolor": { "description": "Sets the color of padded area.", "dflt": "rgba(0,0,0,0)", @@ -77029,6 +77327,13 @@ "valType": "subplotid" }, "colorbar": { + "_deprecated": { + "title": { + "description": "It is recommended to use the color bar's `title.text` attribute instead.", + "editType": "calc", + "valType": "string" + } + }, "bgcolor": { "description": "Sets the color of padded area.", "dflt": "rgba(0,0,0,0)", @@ -79243,6 +79548,13 @@ "valType": "subplotid" }, "colorbar": { + "_deprecated": { + "title": { + "description": "It is recommended to use the color bar's `title.text` attribute instead.", + "editType": "colorbars", + "valType": "string" + } + }, "bgcolor": { "description": "Sets the color of padded area.", "dflt": "rgba(0,0,0,0)", @@ -81552,6 +81864,13 @@ "valType": "subplotid" }, "colorbar": { + "_deprecated": { + "title": { + "description": "It is recommended to use the color bar's `title.text` attribute instead.", + "editType": "colorbars", + "valType": "string" + } + }, "bgcolor": { "description": "Sets the color of padded area.", "dflt": "rgba(0,0,0,0)", @@ -83792,6 +84111,13 @@ "valType": "subplotid" }, "colorbar": { + "_deprecated": { + "title": { + "description": "It is recommended to use the color bar's `title.text` attribute instead.", + "editType": "colorbars", + "valType": "string" + } + }, "bgcolor": { "description": "Sets the color of padded area.", "dflt": "rgba(0,0,0,0)", @@ -85323,6 +85649,13 @@ "valType": "subplotid" }, "colorbar": { + "_deprecated": { + "title": { + "description": "It is recommended to use the color bar's `title.text` attribute instead.", + "editType": "colorbars", + "valType": "string" + } + }, "bgcolor": { "description": "Sets the color of padded area.", "dflt": "rgba(0,0,0,0)", @@ -87368,6 +87701,13 @@ "valType": "subplotid" }, "colorbar": { + "_deprecated": { + "title": { + "description": "It is recommended to use the color bar's `title.text` attribute instead.", + "editType": "colorbars", + "valType": "string" + } + }, "bgcolor": { "description": "Sets the color of padded area.", "dflt": "rgba(0,0,0,0)", @@ -88662,6 +89002,13 @@ "valType": "subplotid" }, "colorbar": { + "_deprecated": { + "title": { + "description": "It is recommended to use the color bar's `title.text` attribute instead.", + "editType": "calc", + "valType": "string" + } + }, "bgcolor": { "description": "Sets the color of padded area.", "dflt": "rgba(0,0,0,0)", @@ -91988,6 +92335,13 @@ "valType": "subplotid" }, "colorbar": { + "_deprecated": { + "title": { + "description": "It is recommended to use the color bar's `title.text` attribute instead.", + "editType": "colorbars", + "valType": "string" + } + }, "bgcolor": { "description": "Sets the color of padded area.", "dflt": "rgba(0,0,0,0)", @@ -95036,6 +95390,13 @@ "valType": "subplotid" }, "colorbar": { + "_deprecated": { + "title": { + "description": "It is recommended to use the color bar's `title.text` attribute instead.", + "editType": "calc", + "valType": "string" + } + }, "bgcolor": { "description": "Sets the color of padded area.", "dflt": "rgba(0,0,0,0)", From 3a3646df150e8ece7f09f25883ed37b878fa8b08 Mon Sep 17 00:00:00 2001 From: Emily Kellison-Linn <4672118+emilykl@users.noreply.github.com> Date: Wed, 16 Oct 2024 20:08:00 -0400 Subject: [PATCH 4/5] fix tests --- test/jasmine/tests/funnelarea_test.js | 4 ++-- test/jasmine/tests/pie_test.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/test/jasmine/tests/funnelarea_test.js b/test/jasmine/tests/funnelarea_test.js index 6fa86e18cca..bd753a09b3f 100644 --- a/test/jasmine/tests/funnelarea_test.js +++ b/test/jasmine/tests/funnelarea_test.js @@ -575,13 +575,13 @@ describe('Funnelarea traces', function() { title: 'yo', }]) .then(function() { - _assertTitle('base', 'yo', 'rgb(0, 0, 0)'); + _assertTitle('base', 'yo', 'rgb(68, 68, 68)'); return Plotly.restyle(gd, { title: 'oy', }); }) .then(function() { - _assertTitle('base', 'oy', 'rgb(0, 0, 0)'); + _assertTitle('base', 'oy', 'rgb(68, 68, 68)'); }) .then(done, done.fail); }); diff --git a/test/jasmine/tests/pie_test.js b/test/jasmine/tests/pie_test.js index 7bfdcf286c2..c17157695cd 100644 --- a/test/jasmine/tests/pie_test.js +++ b/test/jasmine/tests/pie_test.js @@ -793,13 +793,13 @@ describe('Pie traces', function() { title: 'yo', }]) .then(function() { - _assertTitle('base', 'yo', 'rgb(0, 0, 0)'); + _assertTitle('base', 'yo', 'rgb(68, 68, 68)'); return Plotly.restyle(gd, { title: 'oy', }); }) .then(function() { - _assertTitle('base', 'oy', 'rgb(0, 0, 0)'); + _assertTitle('base', 'oy', 'rgb(68, 68, 68)'); }) .then(done, done.fail); }); From ebc6b1fb4b06087bfb339c562ad7846486717681 Mon Sep 17 00:00:00 2001 From: Emily Kellison-Linn <4672118+emilykl@users.noreply.github.com> Date: Thu, 17 Oct 2024 10:20:58 -0400 Subject: [PATCH 5/5] typo --- src/traces/carpet/axis_attributes.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/traces/carpet/axis_attributes.js b/src/traces/carpet/axis_attributes.js index 994f5a50082..da8ad2312cd 100644 --- a/src/traces/carpet/axis_attributes.js +++ b/src/traces/carpet/axis_attributes.js @@ -451,7 +451,7 @@ module.exports = { editType: 'calc', description: 'The stride between grid lines along the axis' }, - + editType: 'calc', _deprecated: { title: { @@ -460,6 +460,4 @@ module.exports = { description: 'It is recommended to use the axis\'s `title.text` attribute instead.' } }, - - editType: 'calc', };