Skip to contents

This function tries to find the path to a drawio executable, assuming a default installation, in a well-known location, depending on the OS.

Usage

drawio.default.path()

drawio.default.path.linux()

drawio.default.path.darwin()

drawio.default.path.windows()

Functions

  • drawio.default.path.linux: Find default path on Linux

  • drawio.default.path.darwin: Find default path on Darwin (Mac OS X)

  • drawio.default.path.windows: Find default path on Windows

Overriding the default path

This function is only used to return the default path, if no specific path is given by the user. If, on your machine, drawio is not available at the default path, or if the OS could not be successfully identified, please specify your custom location by using the engine.path option.

This option can be set in two manners. Either locally, for a single chunk, by setting it in the code chunk header:

{drawio mylabel, engine.path = "/path/to/drawio"}

Or globally, for all chunks, at the beginning of the RMardown document. Note that, in this case, you should specify a list of engines (in case you use other engines, such as Python or Ruby):

knitr::opts_chunks$set(engine.path = list(
  drawio = "/path/to/drawio",
  # Set here your other engines (if necessary)
  python = "/path/to/python",
))

Linux

On Linux, the executable is first searched in the directories specified in the PATH environment variable, through the Sys.which function.

If the executable cannot be found in the PATH, we search in a few well-known (common) locations:

  • /bin ;

  • /usr/bin ;

  • /opt/drawio.

MacOS

On Mac OS X (Darwin), the executable is first searched in the directories specified in the PATH environment variable, through the Sys.which function.

If the executable cannot be found in the PATH, we search in a few well-known (common) locations:

  • /Applications ;

  • ~/Applications ;

  • ~/bin ;

  • /bin ;

  • /usr/bin ;

  • /usr/local/bin ;

  • /opt/drawio.

Windows

On Windows, the executable is first searched in the directories specified in the PATH environment variable, through the Sys.which function.