diff --git a/apple-touch-icon-120x120.png b/apple-touch-icon-120x120.png index c229fd5..22a7439 100644 Binary files a/apple-touch-icon-120x120.png and b/apple-touch-icon-120x120.png differ diff --git a/apple-touch-icon-152x152.png b/apple-touch-icon-152x152.png index c2acf74..967aeda 100644 Binary files a/apple-touch-icon-152x152.png and b/apple-touch-icon-152x152.png differ diff --git a/apple-touch-icon-180x180.png b/apple-touch-icon-180x180.png index a5adbfe..79d16ce 100644 Binary files a/apple-touch-icon-180x180.png and b/apple-touch-icon-180x180.png differ diff --git a/apple-touch-icon-60x60.png b/apple-touch-icon-60x60.png index a93b2f6..9d39a98 100644 Binary files a/apple-touch-icon-60x60.png and b/apple-touch-icon-60x60.png differ diff --git a/apple-touch-icon-76x76.png b/apple-touch-icon-76x76.png index 18b32fb..d2c16b0 100644 Binary files a/apple-touch-icon-76x76.png and b/apple-touch-icon-76x76.png differ diff --git a/apple-touch-icon.png b/apple-touch-icon.png index 8e0bc1d..62438f5 100644 Binary files a/apple-touch-icon.png and b/apple-touch-icon.png differ diff --git a/favicon-16x16.png b/favicon-16x16.png index a264a07..00427a4 100644 Binary files a/favicon-16x16.png and b/favicon-16x16.png differ diff --git a/favicon-32x32.png b/favicon-32x32.png index c851ce9..0af8739 100644 Binary files a/favicon-32x32.png and b/favicon-32x32.png differ diff --git a/index.html b/index.html index 162a8f1..b81b6b0 100644 --- a/index.html +++ b/index.html @@ -101,10 +101,12 @@

Features

Installation

-

You can install the development version of unigd from GitHub with:

+

Install unigd from CRAN:

-# install.packages("remotes")
-remotes::install_github("nx10/unigd")
+install.packages("unigd") +

Or get the latest development version from GitHub:

+
+remotes::install_github("nx10/unigd")

See system requirements for troubleshooting.

diff --git a/pkgdown.yml b/pkgdown.yml index 8a7df31..8538491 100644 --- a/pkgdown.yml +++ b/pkgdown.yml @@ -4,7 +4,7 @@ pkgdown_sha: ~ articles: a00_installation: a00_installation.html b00_guide: b00_guide.html -last_built: 2024-03-23T18:17Z +last_built: 2024-03-23T18:20Z urls: reference: https://nx10.github.io/unigd/reference article: https://nx10.github.io/unigd/articles diff --git a/search.json b/search.json index 200234c..3dc2f6b 100644 --- a/search.json +++ b/search.json @@ -1 +1 @@ -[{"path":"https://nx10.github.io/unigd/articles/a00_installation.html","id":"system-requirements","dir":"Articles","previous_headings":"","what":"System requirements","title":"Installation","text":"libpng X11 required unix like systems (e.g. Linux, macOS). Cairo optional unix like systems enable PNG, PDF, EPS PS renderers. libtiff required unix like systems enable TIFF renderers.","code":""},{"path":"https://nx10.github.io/unigd/articles/a00_installation.html","id":"macos","dir":"Articles","previous_headings":"System requirements","what":"macOS","title":"Installation","text":"libpng missing install via: X11 missing error message include text: Install XQuartz. (see: https://github.com/r-lib/systemfonts/issues/17)","code":"brew install libpng unable to load shared object [...] systemfonts/libs/systemfonts.so [...]"},{"path":"https://nx10.github.io/unigd/articles/a00_installation.html","id":"linux","dir":"Articles","previous_headings":"System requirements","what":"Linux","title":"Installation","text":"source installation Linux, fontconfig freetype2 library required install systemfonts package, dependency unigd.","code":""},{"path":"https://nx10.github.io/unigd/articles/a00_installation.html","id":"debian-ubuntu-etc-","dir":"Articles","previous_headings":"System requirements > Linux","what":"Debian, Ubuntu, etc.","title":"Installation","text":"","code":"apt install libfontconfig1-dev"},{"path":"https://nx10.github.io/unigd/articles/a00_installation.html","id":"fedora-centos-rhel-etc-","dir":"Articles","previous_headings":"System requirements > Linux","what":"Fedora, CentOS, RHEL, etc.","title":"Installation","text":"","code":"dnf install fontconfig-devel"},{"path":"https://nx10.github.io/unigd/articles/b00_guide.html","id":"plot-rendering-in-base-r","dir":"Articles","previous_headings":"","what":"Plot rendering in base R","title":"Plotting with unigd","text":"Rendering plot base R done (1) starting graphics device, (2) calling plot functions subsequently (3) closing device: Note unfortunate constraints: File format (png(), pdf(), svg(), …) Filepath (.e.: file=\"my_plot1.png\") Dimensions (.e.: width=600, height=400) …multiple formats. …multiple dimensions. easy way access plotting data without writing file first. Closing device dev.() must called every time. unigd solves issues employing different graphics device architecture.","code":"temp <- airquality$Temp # Fetch some data png(file=\"my_plot1.png\", width=600, height=400) # (1) Start the 'png' device hist(temp, col=\"darkblue\") # (2) Plot a histogram dev.off() # (3) Close the device"},{"path":"https://nx10.github.io/unigd/articles/b00_guide.html","id":"plot-rendering-with-unigd","dir":"Articles","previous_headings":"","what":"Plot rendering with unigd","title":"Plotting with unigd","text":"Let’s see render can created using unigd: Notice rendering explicit instruction plotting using unigd. way can also render plot multiple formats /dimensions: Starting closing device can cumbersome, especially plotting code aborts error leaves device open. reason unigd comes set functions called ugd_*_inline: Plotting way keeps create close device manually. Depending personal preference may also considered ‘readable’ code. can obtain full list included renderers ugd_renderers(). (’s growing every unigd update!) next section illustrate access render data directly without create file.","code":"library(unigd) temp <- airquality$Temp # Fetch some data ugd() # (1) Start the 'ugd' device hist(temp, col=\"darkblue\") # (2) Plot a histogram ugd_save(file=\"my_plot1.png\", width=600, height=400) # Render 600*400 PNG file dev.off() # (3) Close the device # ... hist(temp, col=\"darkblue\") ugd_save(file=\"my_plot1.png\", width=600, height=400) # Render 600*400 PNG file ugd_save(file=\"my_plot2.pdf\", width=300, height=300) # Render 300*300 PDF file # ... library(unigd) temp <- airquality$Temp # Fetch some data ugd_save_inline({ hist(temp, col=\"darkblue\") }, file=\"my_plot1.png\", width=600, height=400)"},{"path":"https://nx10.github.io/unigd/articles/b00_guide.html","id":"in-memory-render-access","dir":"Articles","previous_headings":"","what":"In-memory render access","title":"Plotting with unigd","text":"applications, might want access rendered data directly. Example use-cases might report generation, web services interactive applications. can likely think workarounds issue, unigd feature certainly lower code complexity increase performance. Rendering -memory done simply calling ugd_render(...) instead ugd_save(...): course also inline function :","code":"temp <- airquality$Temp ugd() hist(temp, col=\"darkblue\") my_svg <- ugd_render(as=\"svg\") dev.off() cat(my_svg) # Print the SVG as a string temp <- airquality$Temp my_svg <- ugd_render_inline({ hist(temp, col=\"darkblue\") }, as=\"svg\") cat(my_svg) # Print the SVG as a string"},{"path":"https://nx10.github.io/unigd/articles/b00_guide.html","id":"more-unigd-features","dir":"Articles","previous_headings":"","what":"More unigd features","title":"Plotting with unigd","text":"unigd offers number features go beyond base R graphics devices.","code":""},{"path":"https://nx10.github.io/unigd/articles/b00_guide.html","id":"zoom","dir":"Articles","previous_headings":"More unigd features","what":"Zoom","title":"Plotting with unigd","text":"rendering function unigd offer zoom parameter. parameter can used increase (decrease) size objects inside plot (independently plot dimensions). example zoom=2 increase size objects 200%, zoom=0.5 decrease 50%.","code":"my_svg_1_0 <- ugd_render_inline({ hist(temp, col=\"darkblue\", main = \"Zoom 1.0\") }, as=\"png-base64\", width=300, height=300, zoom=1.0) my_svg_1_5 <- ugd_render_inline({ hist(temp, col=\"darkblue\", main = \"Zoom 1.5\") }, as=\"png-base64\", width=300, height=300, zoom=1.5) my_svg_0_5 <- ugd_render_inline({ hist(temp, col=\"darkblue\", main = \"Zoom 0.5\") }, as=\"png-base64\", width=300, height=300, zoom=0.5) # (Output directly in this RMarkdown document) knitr::raw_html(paste0(sprintf(\"\", c(my_svg_1_0, my_svg_1_5, my_svg_0_5))))"},{"path":"https://nx10.github.io/unigd/articles/b00_guide.html","id":"paging-by-index","dir":"Articles","previous_headings":"More unigd features","what":"Paging (by index)","title":"Plotting with unigd","text":"page parameter lets select plot history rendered. default set 0 use last created plot. Set number ≥ 1 select plot ’s index (oldest first). Use numbers ≤ 0 select plots newest-first: Note plots can deleted history way: Instead keeping track plot index, might change plots added removed, static plot IDs can obtained.","code":"ugd() for (i in 1:10) { plot(1, main=paste0(\"Plot #\", i)) } ugd_save(file=\"plot.png\", page = 3) # Plot #3 ugd_save(file=\"plot.png\") # Plot #10 ugd_save(file=\"plot.png\", page = -1) # Plot #9 dev.off() # ... ugd_remove() # Remove last ugd_remove(page = -1) # Remove second-to-last ugd_clear() # Remove all # ..."},{"path":"https://nx10.github.io/unigd/articles/b00_guide.html","id":"plot-ids","dir":"Articles","previous_headings":"More unigd features","what":"Plot IDs","title":"Plotting with unigd","text":"want render plot later point without keep track index, can obtain ID point ’s creation. following example extensively demonstrates can used: Note typical use-case much simpler, just getting last ID plot calling ugd_id() subsequently.","code":"ugd() plot(rnorm(50)) # A first_plot_id <- ugd_id() # Get last ID (A at this point) hist(rnorm(50)) # B plot(sin((1:100)/3)) # C other_id <- ugd_id(-1) # Get the second-to-last ID (B at this point) hist(runif(100)) # D ugd_remove(3) # Remove 3rd plot (C) first_again <- ugd_id(1) # Get the first ID (A) ugd_save(file=\"plot_1.png\", page = first_plot_id) ugd_save(file=\"plot_2.png\", page = other_id) ugd_save(file=\"plot_3.png\", page = first_again) dev.off()"},{"path":"https://nx10.github.io/unigd/articles/b00_guide.html","id":"special-renderers","dir":"Articles","previous_headings":"More unigd features","what":"(Special) renderers","title":"Plotting with unigd","text":"unigd also ships number ‘special’ renderers. guide go much detail topic noteworthy mentions: text elements inside plot Linebreak separated plain text format used e.g. ‘search’ plots Meta information plot Guaranteed render time O(1) regardless number objects Includes complexity (number draw calls clipping planes) JSON format Contains information unigd one plot JSON format","code":""},{"path":"https://nx10.github.io/unigd/articles/b00_guide.html","id":"performance-considerations","dir":"Articles","previous_headings":"","what":"Performance considerations","title":"Plotting with unigd","text":"unigd aims provide best performance case, considerations can make optimizing graphics rendering. point mentioned user applications readability prioritized performance , unless graphics rendering bottlenecking R script, can likely ignore section good conscience. optimizing rendering code, fundamental understand cases unigd needs call R graphics engine let plot re-drawn: Rendering done drawing. last drawn dimensions plot cached. can derive simple rules : Rendering plot different formats: Fast. Rendering plot different dimensions: Slow(er). means ordering rendering calls result faster execution: , unigd gives choice specifying render dimension plotting, can hint device creation time achieve best performance: dimensions omitted calling rendering functions, last known dimensions used rendering guaranteed fast: use ugd_*_inline functions also guaranteed fast. Note width height also interact zoom parameter. (.e.: Cached width = width / zoom).","code":"# SLOWER: ugd_save(file=\"my_plot1.png\", width=600, height=400) ugd_save(file=\"my_plot2.pdf\", width=300, height=300) # re-draw 1 ugd_save(file=\"my_plot3.pdf\", width=600, height=400) # re-draw 2 # FASTER: ugd_save(file=\"my_plot1.png\", width=600, height=400) ugd_save(file=\"my_plot3.pdf\", width=600, height=400) ugd_save(file=\"my_plot2.pdf\", width=300, height=300) # re-draw 1 # SLOWER: ugd() # default dimensions: 720 * 576 # ... ugd_save(file=\"my_plot1.png\", width=300, height=300) # re-draw # FASTER: ugd(width=300, height=300) # ... ugd_save(file=\"my_plot1.png\", width=300, height=300) ugd_save(file=\"my_plot1.png\")"},{"path":"https://nx10.github.io/unigd/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Florian Rupprecht. Author, maintainer. Kun Ren. Contributor. Tatsuya Shima. Contributor. Jeroen Ooms. Contributor. Hadley Wickham. Copyright holder. Author included svglite code Lionel Henry. Copyright holder. Author included svglite code Thomas Lin Pedersen. Copyright holder. Author creator included svglite code T Jake Luciani. Copyright holder. Author included svglite code Matthieu Decorde. Copyright holder. Author included svglite code Vaudor Lise. Copyright holder. Author included svglite code Tony Plate. Copyright holder. Contributor included svglite code David Gohel. Copyright holder. Contributor included svglite code Yixuan Qiu. Copyright holder. Contributor included svglite code Håkon Malmedal. Copyright holder. Contributor included svglite code RStudio. Copyright holder. Copyright holder included svglite code Brett Robinson. Copyright holder. Author included belle library Google. Copyright holder. Copyright holder included material design icons Victor Zverovich. Copyright holder. Author included fmt library Andrzej Krzemienski. Copyright holder. Author included std::experimental::optional library","code":""},{"path":"https://nx10.github.io/unigd/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Rupprecht F (2024). unigd: Universal Graphics Device. R package version 0.1.1, https://nx10.github.io/unigd/, https://github.com/nx10/unigd.","code":"@Manual{, title = {unigd: Universal Graphics Device}, author = {Florian Rupprecht}, year = {2024}, note = {R package version 0.1.1, https://nx10.github.io/unigd/}, url = {https://github.com/nx10/unigd}, }"},{"path":"https://nx10.github.io/unigd/index.html","id":"unigd-","dir":"","previous_headings":"","what":"Universal Graphics Device","title":"Universal Graphics Device","text":"unified R graphics backend. Render R graphics fast easy many common file formats. package provides thread-safe interface power interactive graphics clients httpgd.","code":""},{"path":"https://nx10.github.io/unigd/index.html","id":"features","dir":"","previous_headings":"","what":"Features","title":"Universal Graphics Device","text":"Fast plotting Plot resizing history Render various image formats (SVG, PNG, PDF, EPS, …) -memory access rendered graphics Platform independent Stateless thread-safe C client API package developers","code":""},{"path":"https://nx10.github.io/unigd/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"Universal Graphics Device","text":"can install development version unigd GitHub : See system requirements troubleshooting.","code":"# install.packages(\"remotes\") remotes::install_github(\"nx10/unigd\")"},{"path":"https://nx10.github.io/unigd/index.html","id":"getting-started","dir":"","previous_headings":"","what":"Getting started","title":"Universal Graphics Device","text":"See guide details.","code":""},{"path":"https://nx10.github.io/unigd/index.html","id":"contributions-welcome","dir":"","previous_headings":"","what":"Contributions welcome!","title":"Universal Graphics Device","text":"unigd mostly written C++, contributions tests (R) documentation also always welcome!","code":""},{"path":"https://nx10.github.io/unigd/index.html","id":"about--license","dir":"","previous_headings":"","what":"About & License","title":"Universal Graphics Device","text":"Depends cpp11 systemfonts. Much font handling SVG rendering code modified code excellent svglite package. project licensed GPL v2.0. includes parts svglite (GPL ≥ 2) fmt (MIT). Full copies license agreements used components included ./inst/licenses.","code":""},{"path":"https://nx10.github.io/unigd/reference/ugd.html","id":null,"dir":"Reference","previous_headings":"","what":"A unified R graphics backend. — ugd","title":"A unified R graphics backend. — ugd","text":"function initializes unigd graphics device.","code":""},{"path":"https://nx10.github.io/unigd/reference/ugd.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"A unified R graphics backend. — ugd","text":"","code":"ugd( width = getOption(\"unigd.width\", 720), height = getOption(\"unigd.height\", 576), bg = getOption(\"unigd.bg\", \"white\"), pointsize = getOption(\"unigd.pointsize\", 12), system_fonts = getOption(\"unigd.system_fonts\", list()), user_fonts = getOption(\"unigd.user_fonts\", list()), reset_par = getOption(\"unigd.reset_par\", FALSE) )"},{"path":"https://nx10.github.io/unigd/reference/ugd.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"A unified R graphics backend. — ugd","text":"width Graphics device width (pixels). height Graphics device height (pixels). bg Background color. pointsize Graphics device point size. system_fonts Named list font names aliased fonts installed system. unspecified, R default families sans, serif, mono symbol aliased family returned systemfonts::font_info(). user_fonts Named list fonts aliased font files provided user rather fonts properly installed system. aliases can fonts fontquiver package, strings containing path font file, list containing name file elements name indicating font alias SVG output file path font file. reset_par set TRUE, global graphics parameters saved device start reset every time ugd_clear() called (see graphics::par()).","code":""},{"path":"https://nx10.github.io/unigd/reference/ugd.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"A unified R graphics backend. — ugd","text":"return value, called initialize graphics device.","code":""},{"path":"https://nx10.github.io/unigd/reference/ugd.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"A unified R graphics backend. — ugd","text":"font settings descriptions adopted excellent 'svglite' package.","code":""},{"path":"https://nx10.github.io/unigd/reference/ugd.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"A unified R graphics backend. — ugd","text":"","code":"ugd() # Initialize graphics device # Plot something x <- seq(0, 3 * pi, by = 0.1) plot(x, sin(x), type = \"l\") # Render plot as SVG ugd_render(width = 600, height = 400, as = \"svg\") #> [1] \"\\n\\n \", c(my_svg_1_0, my_svg_1_5, my_svg_0_5))))"},{"path":"https://nx10.github.io/unigd/articles/b00_guide.html","id":"paging-by-index","dir":"Articles","previous_headings":"More unigd features","what":"Paging (by index)","title":"Plotting with unigd","text":"page parameter lets select plot history rendered. default set 0 use last created plot. Set number ≥ 1 select plot ’s index (oldest first). Use numbers ≤ 0 select plots newest-first: Note plots can deleted history way: Instead keeping track plot index, might change plots added removed, static plot IDs can obtained.","code":"ugd() for (i in 1:10) { plot(1, main=paste0(\"Plot #\", i)) } ugd_save(file=\"plot.png\", page = 3) # Plot #3 ugd_save(file=\"plot.png\") # Plot #10 ugd_save(file=\"plot.png\", page = -1) # Plot #9 dev.off() # ... ugd_remove() # Remove last ugd_remove(page = -1) # Remove second-to-last ugd_clear() # Remove all # ..."},{"path":"https://nx10.github.io/unigd/articles/b00_guide.html","id":"plot-ids","dir":"Articles","previous_headings":"More unigd features","what":"Plot IDs","title":"Plotting with unigd","text":"want render plot later point without keep track index, can obtain ID point ’s creation. following example extensively demonstrates can used: Note typical use-case much simpler, just getting last ID plot calling ugd_id() subsequently.","code":"ugd() plot(rnorm(50)) # A first_plot_id <- ugd_id() # Get last ID (A at this point) hist(rnorm(50)) # B plot(sin((1:100)/3)) # C other_id <- ugd_id(-1) # Get the second-to-last ID (B at this point) hist(runif(100)) # D ugd_remove(3) # Remove 3rd plot (C) first_again <- ugd_id(1) # Get the first ID (A) ugd_save(file=\"plot_1.png\", page = first_plot_id) ugd_save(file=\"plot_2.png\", page = other_id) ugd_save(file=\"plot_3.png\", page = first_again) dev.off()"},{"path":"https://nx10.github.io/unigd/articles/b00_guide.html","id":"special-renderers","dir":"Articles","previous_headings":"More unigd features","what":"(Special) renderers","title":"Plotting with unigd","text":"unigd also ships number ‘special’ renderers. guide go much detail topic noteworthy mentions: text elements inside plot Linebreak separated plain text format used e.g. ‘search’ plots Meta information plot Guaranteed render time O(1) regardless number objects Includes complexity (number draw calls clipping planes) JSON format Contains information unigd one plot JSON format","code":""},{"path":"https://nx10.github.io/unigd/articles/b00_guide.html","id":"performance-considerations","dir":"Articles","previous_headings":"","what":"Performance considerations","title":"Plotting with unigd","text":"unigd aims provide best performance case, considerations can make optimizing graphics rendering. point mentioned user applications readability prioritized performance , unless graphics rendering bottlenecking R script, can likely ignore section good conscience. optimizing rendering code, fundamental understand cases unigd needs call R graphics engine let plot re-drawn: Rendering done drawing. last drawn dimensions plot cached. can derive simple rules : Rendering plot different formats: Fast. Rendering plot different dimensions: Slow(er). means ordering rendering calls result faster execution: , unigd gives choice specifying render dimension plotting, can hint device creation time achieve best performance: dimensions omitted calling rendering functions, last known dimensions used rendering guaranteed fast: use ugd_*_inline functions also guaranteed fast. Note width height also interact zoom parameter. (.e.: Cached width = width / zoom).","code":"# SLOWER: ugd_save(file=\"my_plot1.png\", width=600, height=400) ugd_save(file=\"my_plot2.pdf\", width=300, height=300) # re-draw 1 ugd_save(file=\"my_plot3.pdf\", width=600, height=400) # re-draw 2 # FASTER: ugd_save(file=\"my_plot1.png\", width=600, height=400) ugd_save(file=\"my_plot3.pdf\", width=600, height=400) ugd_save(file=\"my_plot2.pdf\", width=300, height=300) # re-draw 1 # SLOWER: ugd() # default dimensions: 720 * 576 # ... ugd_save(file=\"my_plot1.png\", width=300, height=300) # re-draw # FASTER: ugd(width=300, height=300) # ... ugd_save(file=\"my_plot1.png\", width=300, height=300) ugd_save(file=\"my_plot1.png\")"},{"path":"https://nx10.github.io/unigd/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Florian Rupprecht. Author, maintainer. Kun Ren. Contributor. Tatsuya Shima. Contributor. Jeroen Ooms. Contributor. Hadley Wickham. Copyright holder. Author included svglite code Lionel Henry. Copyright holder. Author included svglite code Thomas Lin Pedersen. Copyright holder. Author creator included svglite code T Jake Luciani. Copyright holder. Author included svglite code Matthieu Decorde. Copyright holder. Author included svglite code Vaudor Lise. Copyright holder. Author included svglite code Tony Plate. Copyright holder. Contributor included svglite code David Gohel. Copyright holder. Contributor included svglite code Yixuan Qiu. Copyright holder. Contributor included svglite code Håkon Malmedal. Copyright holder. Contributor included svglite code RStudio. Copyright holder. Copyright holder included svglite code Brett Robinson. Copyright holder. Author included belle library Google. Copyright holder. Copyright holder included material design icons Victor Zverovich. Copyright holder. Author included fmt library Andrzej Krzemienski. Copyright holder. Author included std::experimental::optional library","code":""},{"path":"https://nx10.github.io/unigd/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Rupprecht F (2024). unigd: Universal Graphics Device. R package version 0.1.1, https://nx10.github.io/unigd/, https://github.com/nx10/unigd.","code":"@Manual{, title = {unigd: Universal Graphics Device}, author = {Florian Rupprecht}, year = {2024}, note = {R package version 0.1.1, https://nx10.github.io/unigd/}, url = {https://github.com/nx10/unigd}, }"},{"path":"https://nx10.github.io/unigd/index.html","id":"unigd-","dir":"","previous_headings":"","what":"Universal Graphics Device","title":"Universal Graphics Device","text":"unified R graphics backend. Render R graphics fast easy many common file formats. package provides thread-safe interface power interactive graphics clients httpgd.","code":""},{"path":"https://nx10.github.io/unigd/index.html","id":"features","dir":"","previous_headings":"","what":"Features","title":"Universal Graphics Device","text":"Fast plotting Plot resizing history Render various image formats (SVG, PNG, PDF, EPS, …) -memory access rendered graphics Platform independent Stateless thread-safe C client API package developers","code":""},{"path":"https://nx10.github.io/unigd/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"Universal Graphics Device","text":"Install unigd CRAN: get latest development version GitHub: See system requirements troubleshooting.","code":"install.packages(\"unigd\") remotes::install_github(\"nx10/unigd\")"},{"path":"https://nx10.github.io/unigd/index.html","id":"getting-started","dir":"","previous_headings":"","what":"Getting started","title":"Universal Graphics Device","text":"See guide details.","code":""},{"path":"https://nx10.github.io/unigd/index.html","id":"contributions-welcome","dir":"","previous_headings":"","what":"Contributions welcome!","title":"Universal Graphics Device","text":"unigd mostly written C++, contributions tests (R) documentation also always welcome!","code":""},{"path":"https://nx10.github.io/unigd/index.html","id":"about--license","dir":"","previous_headings":"","what":"About & License","title":"Universal Graphics Device","text":"Depends cpp11 systemfonts. Much font handling SVG rendering code modified code excellent svglite package. project licensed GPL v2.0. includes parts svglite (GPL ≥ 2) fmt (MIT). Full copies license agreements used components included ./inst/licenses.","code":""},{"path":"https://nx10.github.io/unigd/reference/ugd.html","id":null,"dir":"Reference","previous_headings":"","what":"A unified R graphics backend. — ugd","title":"A unified R graphics backend. — ugd","text":"function initializes unigd graphics device.","code":""},{"path":"https://nx10.github.io/unigd/reference/ugd.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"A unified R graphics backend. — ugd","text":"","code":"ugd( width = getOption(\"unigd.width\", 720), height = getOption(\"unigd.height\", 576), bg = getOption(\"unigd.bg\", \"white\"), pointsize = getOption(\"unigd.pointsize\", 12), system_fonts = getOption(\"unigd.system_fonts\", list()), user_fonts = getOption(\"unigd.user_fonts\", list()), reset_par = getOption(\"unigd.reset_par\", FALSE) )"},{"path":"https://nx10.github.io/unigd/reference/ugd.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"A unified R graphics backend. — ugd","text":"width Graphics device width (pixels). height Graphics device height (pixels). bg Background color. pointsize Graphics device point size. system_fonts Named list font names aliased fonts installed system. unspecified, R default families sans, serif, mono symbol aliased family returned systemfonts::font_info(). user_fonts Named list fonts aliased font files provided user rather fonts properly installed system. aliases can fonts fontquiver package, strings containing path font file, list containing name file elements name indicating font alias SVG output file path font file. reset_par set TRUE, global graphics parameters saved device start reset every time ugd_clear() called (see graphics::par()).","code":""},{"path":"https://nx10.github.io/unigd/reference/ugd.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"A unified R graphics backend. — ugd","text":"return value, called initialize graphics device.","code":""},{"path":"https://nx10.github.io/unigd/reference/ugd.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"A unified R graphics backend. — ugd","text":"font settings descriptions adopted excellent 'svglite' package.","code":""},{"path":"https://nx10.github.io/unigd/reference/ugd.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"A unified R graphics backend. — ugd","text":"","code":"ugd() # Initialize graphics device # Plot something x <- seq(0, 3 * pi, by = 0.1) plot(x, sin(x), type = \"l\") # Render plot as SVG ugd_render(width = 600, height = 400, as = \"svg\") #> [1] \"\\n\\n