Skip to content

recordGraphics redux#394

Merged
grantmcdermott merged 6 commits intomainfrom
recordgraphics-retry
May 14, 2025
Merged

recordGraphics redux#394
grantmcdermott merged 6 commits intomainfrom
recordgraphics-retry

Conversation

@grantmcdermott
Copy link
Owner

Fixes #388

I won't share just how many dead-ends I ended going down to resolve this. But I think I've cracked it now.

tl;dr For reasons that I don't fully understand, we can't wrap the whole draw_legend() function in recordGraphics() without messing up source calls (which is what #388 was ultimately about.) At the same time, simply wrapping the final legend/gradient_legend calls didn't work either for the Positron case (per #377). However, it turns out that the compromise solution is to wrap the fake legend construction (which we need for calculating the plot offset for outside legend placement), the offset calculation, and the final legend plotting call together... but only these steps.

I operationalised this by creating a new internal recordGraphics(tinylegend(...), ...) function.

@grantmcdermott grantmcdermott merged commit 6b597c2 into main May 14, 2025
3 checks passed
@grantmcdermott grantmcdermott deleted the recordgraphics-retry branch May 14, 2025 23:07
@zeileis
Copy link
Collaborator

zeileis commented May 15, 2025

Wow!! 🎉 Thanks for all your work and for finally resolving this...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Not all doc examples are being displayed on the website

2 participants