-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create html and rds treeviews by default #18
Conversation
The initial version of this added a WDYT @jr-nicola |
I'd lean towards having a single |
Thanks. I'll sort that out. |
a687316
to
8ddf13b
Compare
|
||
filepaths | ||
} | ||
|
||
describe("save_trees", { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These tests have been constructed so that they look virtually identical. They could reasonably be rewritten as a single testthat block parameterised by the different arguments to save_trees
using {patrick}. Adding the extra dependency seemed over the top to reduce 4 simple tests to 1, though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Happy to have a little duplication to avoid extra dependencies
@jr-nicola I've changed a dependency. The package now requires {htmlwidgets} >= 1.6.0.
These originated from the discovery and use of different versions of pandoc in {htmlwidgets} and {rmarkdown}. In brief, htmlwidgets was discovering the 'system' pandoc (2.9* on my machine) and creating the appropriate arguments for that version of pandoc but then sending those arguments to an 'RStudio'-embedded pandoc (2.19* on my machine; this is the one that rmarkdown uses when inside RStudio) for which they are invalid. As of htmlwidgets 1.6.0, the method for discovering/using pandoc is aligned between htmlwidgets and rmarkdown. Pinning against htmlwidgets >= 1.6.0 should prevent these clashes, and removed the errors and warnings on my machine. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Fix: #14
Adds a
output_format
parameter for bothtreeview()
andsave_trees()
that allows the user to specify whether they would like to have the interactive ggtree objects saved in .rds files (as ggtree objects) or in .html files (as htmlwidgets).By default the argument for
output_format
isc("rds", "html")
, in which case it creates both .rds and .html versions of the interactive plots (as requested by Erik in meeting 2023-01-12).The
sina_output_format
parameter that was previously included in thetreeview()
signature has been removed. Now the newoutput_format
parameter determines the output format for the interactive versions of both sina plots and tree plots.Tests have been added to ensure that the correct output files are created when
save_trees()
is called: a noninteractive plot is always made, and an interactive html and/or interactive rds plot is made based on user arguments tosave_trees()