Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Refactor title and subtitle selection in drawMainTitle function to us…
…e context-specific selection from the graph div (gd).
  • Loading branch information
davibarbosa2 committed Aug 15, 2025
commit 727f913bfc861187c436f59c31f9a17bb12fca6f
6 changes: 3 additions & 3 deletions src/plot_api/subroutines.js
Original file line number Diff line number Diff line change
Expand Up @@ -428,8 +428,8 @@ exports.drawMainTitle = function(gd) {
});

if(title.text && title.automargin) {
var titleObj = d3.selectAll('.gtitle');
var titleHeight = Drawing.bBox(d3.selectAll('.g-gtitle').node()).height;
var titleObj = d3.select(gd).selectAll('.gtitle');
var titleHeight = Drawing.bBox(d3.select(gd).selectAll('.g-gtitle').node()).height;
var pushMargin = needsMarginPush(gd, title, titleHeight);
if(pushMargin > 0) {
applyTitleAutoMargin(gd, y, pushMargin, titleHeight);
Expand All @@ -455,7 +455,7 @@ exports.drawMainTitle = function(gd) {
}

// If there is a subtitle
var subtitleObj = d3.selectAll('.gtitle-subtitle');
var subtitleObj = d3.select(gd).selectAll('.gtitle-subtitle');
if(subtitleObj.node()) {
// Get bottom edge of title bounding box
var titleBB = titleObj.node().getBBox();
Expand Down