Giter VIP home page Giter VIP logo

rstudioapi's Introduction

rstudioapi

CRAN status Codecov test coverage R-CMD-check

The rstudioapi package is designed to make it easy to conditionally access the RStudio API from CRAN packages, avoiding any potential problems with R CMD check. This package contains a handful of useful wrapper functions to access the API. To see the functions that are currently available in the API, run help(package = "rstudioapi")

Installation

You can install the released version of rstudioapi from CRAN with:

install.packages("rstudioapi")

And the development version from GitHub with:

# install.packages("devtools")
devtools::install_github("rstudio/rstudioapi")

Example

The rstudioapi package is designed to never be attached to your search path. Always prefix function calls with rstudioapi::.

# Returns T/F
rstudioapi::isAvailable()
# Returns error if not available
rstudioapi::verifyAvailable()

# Optional argument allows you to specify version requirement
rstudioapi::isAvailable("0.99")
rstudioapi::verifyAvailable("0.99")

# Call an rstudio function
rstudioapi::callFun("viewer", "http://localhost:8080")

# This will raise an error if rstudio is not running, or the function
# is not found. To run a different function if it's not available,
# use exists
if (rstudioapi::hasFun("viewer")) {
  rstudioapi::callFun("viewer", "http://localhost:8080")
} else {
  browseURL("http://localhost:8080")
}

# You can use find to get the function. Throws an error if the function
# does not exist.
rstudioapi::findFun("viewer")

# You can also check version in exists and find
rstudioapi::findFun("viewer", 0.99)
rstudioapi::hasFun("viewer", 0.99)

rstudioapi's People

Contributors

andrie avatar ashesitr avatar atheriel avatar gtritchie avatar hadley avatar javierluraschi avatar jennybc avatar jgutman avatar jjallaire avatar jmcphers avatar kevinushey avatar mariasemple avatar melissa-barca avatar mutterer avatar olivroy avatar randyzwitch avatar romainfrancois avatar salim-b avatar shrektan avatar trestletech avatar yihui avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rstudioapi's Issues

Add functions for getting/setting Shiny viewer

It would be useful to have functions to get and set the Shiny viewer setting -- that is, the setting that controls whether a Shiny app opens in the viewer pane, a viewer window, or an external browser. This would be useful for rstudio/shinytest#117.

Currently this can be done with .rs.readUiPref("shiny_viewer_type") and .rs.writeUiPref.

selectFile filter problem on Mac

selectFile() or selectFile(filter = "*") seems to work fine on Mac. However, when the filter is set to *.R or *.csv no file dialog is opened and NULL is returned right away. Using the current preview version of Rstudio

rstudioapi::selectFile(filter = "*.csv")
NULL

navigateToFile without moving the cursor when the file is already opened in different tab

Hi,

Is there a convenient way how to open/(switch to) a file with cursor at its last position programmatically? I have tried rstudioapi::navigateToFile but it always requires the parameters "line" and "column".

Simple use case can be switching back and forth between a code file, and a test file, or R Notebook file. Now it always resets the position, which is a bit annoying.

Thank you!

rstudioapi::getSourceEditorContext failing when executed from addin or console

RStudio: 1.0.136
rstudioapi 0.6 available on CRAN ( published on 2016-06-27 )

How to reproduce:

  1. Open some files in RStudio.
  2. Run 'rstudioapi::getSourceEditorContext()' in the console
  3. The error is displayed:

Error: 'x' should be a list of {range, text} pairs
i.e. as if there was no files opened in the editor at all.

Expected: return descriptor of currently viewed file in the editor.

The same error happens when 'rstudioapi::getSourceEditorContext()' is invoked from RStudio addin.

This issue appears to be fixed at revision bc145dd so this ticket is raised for future reference.

request installation of package(s) of particular version

It might be nice for addins that require particular version(s) of some packages to ensure that they're installed, or request that the user install them with the regular IDE dialogs (for packages available on CRAN). Something like:

rstudioapi::requirePackages(dplyr = "0.7.0", <...>)

sendToConsole sends command twice when used in gadget

The following gadget pastes an assignment twice. This happens with any code I put inside

library(miniUI)
myApp <- function(){
  ui <- miniPage(
    gadgetTitleBar("Test"),
    miniContentPanel(
        selectInput("value","Select a value",
                    choices = letters[1:3])
    )
  )
  
  server <- function(input, output, session){
    observeEvent(input$done, {
      text <- paste0("x <- ", input$value)
      rstudioapi::sendToConsole(text)
      stopApp()
    })
  }
  
  viewer <- dialogViewer("a text",300, 200)
  runGadget(ui, server, viewer = viewer)
}

myApp()

create, modify and destroy pane

In an addin, I'd like to create a pane in RStudio, populate it with custom content (e.g., HTML or a Shiny app), modify the content on request, and destroy the panel on request.

insertText() and popped out window

Hi,

I'm trying to use insertText() with a popped out window.

Let's say I have a source pane with context id 3B337525 and a popped out source window with id 2DD041B0. When I run rstudioapi::insertText(text = "test", id = "2DD041B0") in the popped out source window, test is inserted into the document. When I run the same code in the source pane or the console it appears that nothing happens. Conversely, when I run rstudioapi::insertText(text = "test", id = "3B337525") in the console or source pane text is inserted into the pane document, but if I run the same code in the popped out window, again, nothing seems to happen.

My use case is an addin that cannot insert text in a popped out window but in source panes. I'm trying this with the current development snapshot from this repository. What am I doing wrong?

> devtools::session_info()
Session info ---------------------------------------------------------------------------------------------------
 setting  value                       
 version  R version 3.4.1 (2017-06-30)
 system   x86_64, linux-gnu           
 ui       RStudio (1.0.153)           
 language de_DE                       
 collate  de_DE.UTF-8                 
 tz       Europe/Berlin               
 date     2017-08-23                  

Packages -------------------------------------------------------------------------------------------------------
 package    * version    date       source              
 assertthat   0.2.0      2017-04-11 cran (@0.2.0)       
 base       * 3.4.1      2017-07-08 local               
 citr       * 0.2.0.9047 2017-08-23 local (crsh/citr@NA)
 compiler     3.4.1      2017-07-08 local               
 datasets   * 3.4.1      2017-07-08 local               
 devtools     1.13.2     2017-06-02 CRAN (R 3.4.0)      
 digest       0.6.12     2017-01-27 CRAN (R 3.4.0)      
 graphics   * 3.4.1      2017-07-08 local               
 grDevices  * 3.4.1      2017-07-08 local               
 htmltools    0.3.6      2017-04-28 cran (@0.3.6)       
 httpuv       1.3.5      2017-07-04 cran (@1.3.5)       
 memoise      1.1.0      2017-04-21 CRAN (R 3.4.0)      
 methods    * 3.4.1      2017-07-08 local               
 mime         0.5        2016-07-07 CRAN (R 3.4.0)      
 miniUI       0.1.1      2016-01-15 cran (@0.1.1)       
 R6           2.2.2      2017-06-17 CRAN (R 3.4.0)      
 Rcpp         0.12.12    2017-07-15 cran (@0.12.12)     
 shiny        1.0.4      2017-08-14 cran (@1.0.4)       
 stats      * 3.4.1      2017-07-08 local               
 tools        3.4.1      2017-07-08 local               
 utils      * 3.4.1      2017-07-08 local               
 withr        1.0.2      2016-06-20 CRAN (R 3.4.0)      
 xtable       1.8-2      2016-02-05 CRAN (R 3.4.0)  

Encoding issue: `getActiveDocumentContext()` does not read international symbols correctly

I created a new R script in R Studio and wrote lines:

context <- rstudioapi::getActiveDocumentContext(); "ž\\ą"
context

Then I selected all the text with a mouse and pressed shortcut keys Ctrl + Enter to run the code. The result:

> context <- rstudioapi::getActiveDocumentContext(); "ž\\ą"
[1] "ž\\ą"

> context
Document Context: 
- id:        '8B5C059B'
- path:      ''
- contents:  <2 rows>
Document Selection:
- [1, 1] -- [2, 8]: 'context <- rstudioapi::getActiveDocumentContext(); "ž\\\\ą"\ncontext <...>'

In the first line of R output/results international symbols are displayed correctly: "ž\\ą", but in the object context they are distorted: "ž\\\\Ä…". Why getActiveDocumentContext() does not read international symbols correctly? And what can be done to read the symbols with rstudioapi correctly?

I use Windows 10, "Lithuanian" locale and the currently newest versions of R Studio and rstudioapi:

Session info -------------------------------------------
 setting  value                       
 version  R version 3.3.1 (2016-06-21)
 system   x86_64, mingw32             
 ui       RStudio (0.99.1263)         
 language (EN)                        
 collate  Lithuanian_Lithuania.1257   
 tz       Europe/Helsinki             
 date     2016-07-21                  

Packages ------------------------------------------------
 package    * version date       source                             
 base64enc    0.1-3   2015-07-28 CRAN (R 3.2.3)                     
 ctv          0.8-1   2015-01-10 CRAN (R 3.3.0)                     
 devtools     1.12.0  2016-06-24 CRAN (R 3.3.1)                     
 digest       0.6.9   2016-01-08 CRAN (R 3.2.3)                     
 evaluate     0.9     2016-04-29 CRAN (R 3.2.5)                     
 IRdisplay    0.3     2015-04-27 local                              
 IRkernel     0.5     2015-10-05 local                              
 jsonlite     1.0     2016-07-01 CRAN (R 3.3.1)                     
 magrittr     1.5     2014-11-22 CRAN (R 3.3.0)                     
 memoise      1.0.0   2016-01-29 CRAN (R 3.2.3)                     
 repr         0.7     2016-05-13 CRAN (R 3.3.0)                     
 rsconnect    0.4.3   2016-05-02 CRAN (R 3.2.5)                     
 rstudioapi * 0.6     2016-07-20 Github (rstudio/rstudioapi@55d3200)
 rzmq         0.7.7   2015-04-18 local                              
 stringi      1.1.1   2016-05-27 CRAN (R 3.3.0)                     
 stringr      1.0.0   2015-04-30 CRAN (R 3.2.3)                     
 uuid         0.1-2   2015-07-28 CRAN (R 3.2.3)                     
 withr        1.0.2   2016-06-20 CRAN (R 3.3.1)  

Encoding problem with `rstudioapi::getActiveDocumentContext()`

In R Studio editor I selected the following lines of code (pay attention to international symbols):

"ą ž ū ų š č"
context <- rstudioapi::getActiveDocumentContext();

and pressed "Run" button to run the code. When I printed context$selection, the result was:

Document Selection:
- [6, 1] -- [8, 18]: '"Ä… ž Å« ų Å Ĩ"\ncontext <- rstudioapi::getActiveDocumentContext();\ncontext$selection <...>'

I expected "ą ž ū ų š č" instedad of `"Ä… ž Å« ų Å Ĩ".

Is it possible to make rstudioapi::getActiveDocumentContext() to read international symbols correctly?

Session info ----------------------------------------------------------------------------------------------------------
 setting  value                       
 version  R version 3.3.1 (2016-06-21)
 system   x86_64, mingw32             
 ui       RStudio (1.0.34)            
 language (EN)                        
 collate  Lithuanian_Lithuania.1257   
 tz       Europe/Helsinki             
 date     2016-10-05                  

Packages --------------------------------------------------------------------------------------------------------------
 package    * version date       source                             
 curl         2.1     2016-09-22 CRAN (R 3.3.1)                     
 devtools     1.12.0  2016-06-24 CRAN (R 3.3.1)                     
 digest       0.6.10  2016-08-02 CRAN (R 3.3.1)                     
 git2r        0.15.0  2016-05-11 CRAN (R 3.3.0)                     
 httr         1.2.1   2016-07-03 CRAN (R 3.3.1)                     
 magrittr   * 1.5     2014-11-22 CRAN (R 3.3.0)                     
 memoise      1.0.0   2016-01-29 CRAN (R 3.2.3)                     
 R6           2.1.3   2016-08-19 CRAN (R 3.3.1)                     
 rstudioapi * 0.6     2016-07-20 Github (rstudio/rstudioapi@55d3200)
 spAddins     0.1.5   2016-07-12 local                              
 withr        1.0.2   2016-06-20 CRAN (R 3.3.1)        

Blank Password

Currently, askForPassword() returns NULL when both the cancel button is pressed and when an empty password ("") is entered. Any chance the blank password could be changed to return "" ?

It may also be handy to have an option to disallow blank passwords (see wrathematics/getPass#6). This can be emulated on our end with something like (assuming blank passwords return "")

pass <- ""
while (pass == "")
  pass <- rstudioapi::askForPassword("")

but it's a little clumsy, since the password box drops out and reappears each time.

rstudioapi::getActiveProject() in a shiny gadget

When called from a shiny gadget rstudioapi::getActiveProject() give the project directory of the gadget. It would useful to determine the project directory of the current project where the gadget was called. E.g., lets say the gadget is called gitgadget and the current project is in c:\myprojects\project-a. rstudioapi::getActiveProject() will return something like c:\myprojects\gitgadget rather than c:\myprojects\project-a when you open the gadget while working on project-a

Encoding in dialog boxes

I ran into problems using Swedish letters in the dialog boxes such as the showPrompt(). The letters (e.g. å ä ö Å Ä Ö) are replaced by the unicode U+FFFD replacement character. I have tried changing locale to US, converting the text to UTF-8 etc. but have had no success.

Access file and directory selection dialogs

Compared to file.choose() these would allow you to:

  • Set the starting directory

  • Select directories, rather than files

  • Optionally, operate like a save dialog where you can enter a file name

Helpers to interact with document selection

The selection API is multiple-selection aware, but we should make it easier to access the 'primary' selection since 99.9% of the time that's going to be what users want. E.g. something like:

context <- rstudioapi::getActiveDocumentContext()
selection <- primarySelection(context) ## equivalent to 'context$selection[[1]]'

Access R command history rstudioapi::cmd_history(n = 25)

I'm not fully down with how history works in R but it seems like Rstudio registers a handler that causes a GUI pane to open when history() is called. So if I want to access the command history from R as a character vector, there's no way to do this.

Could the api provide this facility?

selectDirectory selects files, not directories

Very happy to see the new selectFile and selectDirectory functions! However, I just tried out the selectDirectory on Mac and Windows and cannot get it to return a directory path. When I press the select button the file browser steps into the directory rather than returning the path. If I then select a file and press select I get the path to the file so it seems selectDirectory is doing selectFile instead.

Using Rstudio preview 1.1.359

feature request: project_file()

Triggered by the addition of devtools::package_file() (r-lib/devtools#985), which builds paths relative to a package's top-level directory.

It would be extremely useful to have something analogous for Projects that aren't an R package: project_file(), which would build paths relative to the Project's home directory.

Access file-save dialog

This may be the same as #27

In my case, I would like access to a file-save dialog for a shiny-gadget addin.

Save all open documents

So (e.g.) devtools functions can trigger the save even when not called with the keyboard shortcut.

Provide interface to list and set themes

You can currently get the theme info with rstudioapi::getThemeInfo(), but there is currently no interface to list the available themes or to set a new theme programatically.

You can use the non-API calls .rs.writeUiPref("theme", "Solarized Light") to set a new theme if you know the name and .rs.writeUiPref("flat_theme", "Classic"), .rs.writeUiPref("flat_theme", "default"), .rs.writeUiPref("flat_theme", "alternate")` to write the global theme.

But it would be nice to have an API endpoint to set these and also an API function which would give you a data.frame of the available themes and if they are light or dark.

(Re-)launch a Project?

Could rstudioapi offer a function that launches an RStudio session in a Project? I.e. you provide path to an .Rproj file and it's as if you did File > Open Project ....

You could use this after devtools::create(), for example. Or to relaunch the current project after adding important infrastructure that changes the IDE (e.g., add package infrastructure or make it a git repo or create a Makefile).

I tried navigateToFile() but that just opens .Rproj for editing.

detect RStudio via "Knit HTML"?

I'm using rstudioapi::getVersion() in an .Rmd.

It seems this only works if I render via rmarkdown::render() from R Console (in RStudio, obviously). I keep forgetting this and re-discovering that RStudio cannot be detected if I render via "Knit HTML". If rstudioapi::getVersion() appears in an R chunk, I merely get an error. But if it appears as inline R code, it actually prevents rendering.

Should or could RStudio be detected via "Knit HTML"?

Need rstudioapi::deleteRange()

Using modifyRange() you can blank out a line by setting the text in range to "". Unfortunately there is no way to delete lines. For addins that use the API to transform user's code this will likely mean they end up creating blank lines the user has to clean up manually.

See the gif in the readme at https://github.com/MilesMcBain/packup for an example of where the ability to delete lines would improve the user experience.

getSourceEditorContext not found in RStudio

I'm trying to use getSourceEditorContext() and getConsoleEditorContext() but both functions throw errors like this.

> rstudioapi::getSourceEditorContext()
Error: Function getSourceEditorContext not found in RStudio

getActiveDocumentContext() works as expected. Am I missing something?

> devtools::session_info()
Session info ---------------------------------------------------------------------------------------------------------------------
 setting  value                       
 version  R version 3.3.1 (2016-06-21)
 system   x86_64, linux-gnu           
 ui       RStudio (0.99.903)          
 language de_DE                       
 collate  de_DE.UTF-8                 
 tz       <NA>                        
 date     2016-09-07                  

Packages -------------------------------------------------------------------------------------------------------------------------
 package    * version date       source                             
 devtools     1.11.1  2016-04-21 CRAN (R 3.3.0)                     
 digest       0.6.10  2016-08-02 CRAN (R 3.3.1)                     
 memoise      1.0.0   2016-01-29 CRAN (R 3.3.0)                     
 rsconnect    0.4.3   2016-05-02 CRAN (R 3.3.0)                     
 rstudioapi   0.6     2016-09-07 Github (rstudio/rstudioapi@55d3200)
 withr        1.0.1   2016-02-04 CRAN (R 3.3.0)     

add optional user field to askForPassword()

It would be really convenient to be able to prompt for both username and password in a single dialog instead of using showPrompt() followed by askForPassword().

Perhaps:

askForPassword(prompt, visiblePrompt=NULL, default=NULL)

where a plain text field is displayed only if !is.null(visiblePrompt) and can optionally be prefilled with default as in showPrompt().

Another approach would be to add a separate function like:

askForUserPassword(userPrompt, passwordPrompt, default=NULL)

which would provide for a more natural ordering to the arguments.

Add my own tags to gotoFunctionDefinition

Currently RStudio parses my R, C and C++ source code enough to populate the "Go to file/function" menu item using something like ctags. (It seems to be implemented in a couple of methods called "gotoFunctionDefinition" in the RStudio sources.) I don't think there's a way to add my own tags file or equivalent (e.g. for Javascript function definitions). This would be nice as an rstudioapi addition (but I guess it has to be in RStudio first...).

Expose password dialog

It would be very useful to expose a standard password dialog that lets the user enter text in a password dialog box and then the result is returned to code.

Can viewer() adopt a canonical notion of the path to R session temporary directory?

I find it fiddly to produce a file path that rstudioapi::viewer() recognizes as living in the R session temporary directory. Could it just demand the path in canonical form? Or do its assessment after conversion to canonical form?

Here's an example that boils down to whether path is prefixed with /private or not (OS X Yosemite).

## riff on the official example
dir <- tempfile()
dir.create(dir)

file.copy(from = system.file("examples/knitr-spin.Rmd", package = "knitr"),
          to = file.path(dir, "foo.Rmd"))
#> [1] TRUE

html_file_manual <- file.path(dir, "foo.html")
html_file_auto <- rmarkdown::render(file.path(dir, "foo.Rmd"),
                                    output_file = html_file_manual,
                                    quiet = TRUE)

## inspect the paths
html_file_manual
#> [1] "/var/folders/5c/rwqfdv6s30n3kvfnvxdk19cw0000gn/T//RtmprOtW4M/file109de5d9d70ff/foo.html"
html_file_auto
#> [1] "/private/var/folders/5c/rwqfdv6s30n3kvfnvxdk19cw0000gn/T/RtmprOtW4M/file109de5a6a2805/foo.html"
normalizePath(html_file_manual)
#> [1] "/private/var/folders/5c/rwqfdv6s30n3kvfnvxdk19cw0000gn/T/RtmprOtW4M/file109de5a6a2805/foo.html"

## YES this opens in RStudio viewer
rstudioapi::viewer(html_file_manual)

## NO this does not -- I get kicked into my default browser
rstudioapi::viewer(html_file_auto)

selectFile with path = NULL defaults to home directory, not project directory

selectFile(path = rstudioapi::getActiveProject()) goes to the project directory but selectFile(path = NULL) and selectFile() both go to the users home directory on both Mac and Windows.

Not sure it this intended behavior or a typo in the documentation perhaps.

From ?selectFile

path | The initial working directory, from which the file dialog should begin browsing. When NULL, defaults to the current RStudio project directory.

Close an open document

So you can open a file, prompt the user to do something, then close it when they're done

Progress bar

It would be useful if we could access an RStudio progress bar with the same API as txtProgressBar

Embeded iframe in rstudio viewer

I'm working on plotly's R package and thought it'd be neat to embed plotly graphs in the rstudio viewer via an <iframe>, but the content doesn't seem to load in the viewer:

tmp <- tempfile(fileext = ".html")
curl::curl_download("https://gist.githubusercontent.com/cpsievert/f244be845a5cd13eb4e4/raw/9c1633978da3a22ec95dcf7e3af797607bf77a82/index.html", tmp)
rstudioapi::viewer(tmp)

However, it loads for me on Chrome/Firefox:

browseURL(tmp)

cc @mkcor @chriddyp

Bump dev version

Could you please bump the dev version to make it easier to track API changes in other packages under development?

Spell-check?

Is there a way to call the RStudio spell-check on an RMarkdown document using rstudioapi? If not, can I request this feature? Thanks!

Detect when user focus is on console

Is there a way to determine, within an Addin function, when the user's cursor is in the console?

When run from the console, rstudioapi::getActiveDocumentContext()$id returns "#console". But when the same function is called from within an Addin function in a package, it will course return the id of the active open document.

Such detection would be useful in conjunction the proposed sendToConsole helper.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.