Skip to content

Fix knit_print.g2 registration and script deduplication in knitr#33

Merged
yihui merged 2 commits intomainfrom
copilot/fix-g2-rendering-in-r-markdown
Apr 7, 2026
Merged

Fix knit_print.g2 registration and script deduplication in knitr#33
yihui merged 2 commits intomainfrom
copilot/fix-g2-rendering-in-r-markdown

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 7, 2026

  • Fix root cause: knit_print.g2 was forwarding ... to chart_html(), but knitr passes options = list(...) in ... which chart_html() doesn't accept → removed ... forwarding
  • Factor out repeated registerS3method call into a register_knit_print() helper (DRY)
  • Add tests: cdn_scripts(), knit_print.g2() returns knit_asis, knitr chunk options don't cause error, knitr dispatch works
  • Update .github/copilot-instructions.md: added DRY rule (Replace hard-coded iris column vectors with names() calls #13 in R Code Style) and "every change must have tests" rule ([WIP] Create gglite package wrapping AntV G2 library #1 in Testing Conventions)
  • R CMD check passes (Status: OK)

…ts, update instructions

Agent-Logs-Url: https://github.com/yihui/gglite/sessions/8bd47e0c-bcd7-4cf5-b9f2-b904b495b51a

Co-authored-by: yihui <163582+yihui@users.noreply.github.com>
Copilot finished work on behalf of yihui April 7, 2026 03:28
@yihui yihui marked this pull request as ready for review April 7, 2026 03:32
@yihui yihui merged commit deb11e6 into main Apr 7, 2026
8 checks passed
@yihui yihui deleted the copilot/fix-g2-rendering-in-r-markdown branch April 7, 2026 03:33
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.

2 participants