From 595deefee356dbcdc25b1b0f61152041c4165078 Mon Sep 17 00:00:00 2001 From: Ya-Fan Chen <20377719+Lexachoc@users.noreply.github.com> Date: Thu, 7 Aug 2025 17:35:02 +0200 Subject: [PATCH 1/4] fix: title text cannot be edited (regression since v3.0.0) --- src/components/colorbar/draw.js | 2 +- src/components/rangeslider/draw.js | 2 +- src/plots/polar/polar.js | 2 +- src/plots/ternary/ternary.js | 6 +++--- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/components/colorbar/draw.js b/src/components/colorbar/draw.js index 794ff699918..fdd6c3674a0 100644 --- a/src/components/colorbar/draw.js +++ b/src/components/colorbar/draw.js @@ -326,7 +326,7 @@ function drawColorBar(g, opts, gd) { function drawTitle(titleClass, titleOpts) { var dfltTitleOpts = { propContainer: ax, - propName: opts._propPrefix + 'title', + propName: opts._propPrefix + 'title.text', traceIndex: opts._traceIndex, _meta: opts._meta, placeholder: fullLayout._dfltTitle.colorbar, diff --git a/src/components/rangeslider/draw.js b/src/components/rangeslider/draw.js index 3f9049070e8..e86fc714c60 100644 --- a/src/components/rangeslider/draw.js +++ b/src/components/rangeslider/draw.js @@ -212,7 +212,7 @@ module.exports = function(gd) { if(axisOpts.side === 'bottom') { Titles.draw(gd, axisOpts._id + 'title', { propContainer: axisOpts, - propName: axisOpts._name + '.title', + propName: axisOpts._name + '.title.text', placeholder: fullLayout._dfltTitle.x, attributes: { x: axisOpts._offset + axisOpts._length / 2, diff --git a/src/plots/polar/polar.js b/src/plots/polar/polar.js index da7da52c1b6..89cb495f7b1 100644 --- a/src/plots/polar/polar.js +++ b/src/plots/polar/polar.js @@ -560,7 +560,7 @@ proto.updateRadialAxisTitle = function(fullLayout, polarLayout, _angle) { var cx = _this.cx; var cy = _this.cy; var radialLayout = _this.getRadial(polarLayout); - var titleClass = _this.id + 'title'; + var titleClass = _this.id + 'title.text'; var pad = 0; diff --git a/src/plots/ternary/ternary.js b/src/plots/ternary/ternary.js index 06a457d6d3e..9a6fbdd3d00 100644 --- a/src/plots/ternary/ternary.js +++ b/src/plots/ternary/ternary.js @@ -375,7 +375,7 @@ proto.drawAxes = function(doTitles) { layers['a-title'] = Titles.draw(gd, 'a' + titlesuffix, { propContainer: aaxis, - propName: _this.id + '.aaxis.title', + propName: _this.id + '.aaxis.title.text', placeholder: _(gd, 'Click to enter Component A title'), attributes: { x: _this.x0 + _this.w / 2, @@ -385,7 +385,7 @@ proto.drawAxes = function(doTitles) { }); layers['b-title'] = Titles.draw(gd, 'b' + titlesuffix, { propContainer: baxis, - propName: _this.id + '.baxis.title', + propName: _this.id + '.baxis.title.text', placeholder: _(gd, 'Click to enter Component B title'), attributes: { x: _this.x0 - bpad, @@ -395,7 +395,7 @@ proto.drawAxes = function(doTitles) { }); layers['c-title'] = Titles.draw(gd, 'c' + titlesuffix, { propContainer: caxis, - propName: _this.id + '.caxis.title', + propName: _this.id + '.caxis.title.text', placeholder: _(gd, 'Click to enter Component C title'), attributes: { x: _this.x0 + _this.w + bpad, From b14a6355c6074620d178996a6654cd44aaf316c8 Mon Sep 17 00:00:00 2001 From: Ya-Fan Chen <20377719+Lexachoc@users.noreply.github.com> Date: Thu, 7 Aug 2025 17:53:43 +0200 Subject: [PATCH 2/4] Create 7513_fix.md --- draftlogs/7513_fix.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 draftlogs/7513_fix.md diff --git a/draftlogs/7513_fix.md b/draftlogs/7513_fix.md new file mode 100644 index 00000000000..acb188240f8 --- /dev/null +++ b/draftlogs/7513_fix.md @@ -0,0 +1 @@ +Fix editable `title.text` for `ternary`, `polar`, `colorbar`, and `rangeslider` (regression introduced in 3.0.0) [[#7513](https://github.com/plotly/plotly.js/pull/7513)] From 85df07677ee845fd42962e60ad291ec6440c7323 Mon Sep 17 00:00:00 2001 From: Ya-Fan Chen <20377719+Lexachoc@users.noreply.github.com> Date: Thu, 7 Aug 2025 18:33:49 +0200 Subject: [PATCH 3/4] Update polar.js Thanks to the jasmine test, I realized that I changed the wrong line. --- src/plots/polar/polar.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plots/polar/polar.js b/src/plots/polar/polar.js index 89cb495f7b1..7871cf7e81b 100644 --- a/src/plots/polar/polar.js +++ b/src/plots/polar/polar.js @@ -560,7 +560,7 @@ proto.updateRadialAxisTitle = function(fullLayout, polarLayout, _angle) { var cx = _this.cx; var cy = _this.cy; var radialLayout = _this.getRadial(polarLayout); - var titleClass = _this.id + 'title.text'; + var titleClass = _this.id + 'title'; var pad = 0; @@ -589,7 +589,7 @@ proto.updateRadialAxisTitle = function(fullLayout, polarLayout, _angle) { _this.layers['radial-axis-title'] = Titles.draw(gd, titleClass, { propContainer: radialLayout, - propName: _this.id + '.radialaxis.title', + propName: _this.id + '.radialaxis.title.text', placeholder: _(gd, 'Click to enter radial axis title'), attributes: { x: x, From 59be21075edfd9f61c5a7c96a97d49a71e0b8a4f Mon Sep 17 00:00:00 2001 From: Ya-Fan Chen <20377719+Lexachoc@users.noreply.github.com> Date: Thu, 7 Aug 2025 19:23:39 +0200 Subject: [PATCH 4/4] Update delay time in transition_test.js --- test/jasmine/tests/transition_test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/jasmine/tests/transition_test.js b/test/jasmine/tests/transition_test.js index 2a429b66441..b14e6613c25 100644 --- a/test/jasmine/tests/transition_test.js +++ b/test/jasmine/tests/transition_test.js @@ -648,7 +648,7 @@ describe('Plotly.react transitions:', function() { layout.xaxis.range = [-1, 1]; return Plotly.react(gd, data, layout); }) - .then(delay(50)) + .then(delay(100)) .then(function() { assertSpies('both trace and layout transitions', [ [Plots, 'transitionFromReact', 1],