Refactor title and subtitle selection in drawMainTitle function to use scoped selector#7522
Conversation
…e context-specific selection from the graph div (gd).
emilykl
left a comment
There was a problem hiding this comment.
See one comment regarding the test; otherwise looks great. Thanks very much for the fix @davibarbosa2 . 🎉
…ter and update tests to utilize the new functionality.
|
I'm seeing a CI failure 😢 the tests are passing on my machine. Any chance you could restart the build for me? |
|
@davibarbosa2 @emilykl Please see my comment #7513 (comment) on how to fix the CI issue as a workaround in the GitHub workflow. I see that your jasmine error report shows the line plotly.js/test/jasmine/tests/transition_test.js Lines 646 to 652 in e8434c8 |
camdecoster
left a comment
There was a problem hiding this comment.
Looks good. Thanks for the contribution!
emilykl
left a comment
There was a problem hiding this comment.
Looks good, thanks @davibarbosa2 ! 🚀
@camdecoster @gvwilson We'll have to keep an eye on those flaky Jasmine tests... I wonder why we are running into issues with the delay time recently
This pull request refactors the
drawMainTitlefunction to improve how main titles and subtitles are selected.Previously, the function used a global
d3.selectAllto select the.gtitleand.gtitle-subtitleelements. This could lead to incorrect selections if multiple plots were present on the same page.The changes in this PR modify the selection to be context-specific by using
d3.select(gd).selectAll, ensuring that the title and subtitle elements are selected only from within the current graph div (gd). This prevents styling and layout conflicts between different plots.Closes #7521