% Generated by roxygen2 (4.1.0): do not edit by hand
% Please edit documentation in R/grViz.R
\name{grViz}
\alias{grViz}
\title{R + viz.js}
\usage{
grViz(diagram = "", engine = "dot", options = NULL, width = NULL,
  height = NULL)
}
\arguments{
\item{diagram}{\href{http://graphviz.org}{graphviz} spec
for a diagram as either text, filename string, or file connection}

\item{engine}{string for the Graphviz layout engine; can be
"dot" (default), "neato", "circo", or "twopi". For more information
see \href{viz.js Usage}{https://github.com/mdaines/viz.js#usage}.}

\item{options}{parameters supplied to the htmlwidgets framework.}

\item{width}{an optional parameter for specifying the width of the resulting graphic
in pixels.}

\item{height}{an optional parameter for specifying the height of the resulting graphic
in pixels.}
}
\value{
An object of class \code{htmlwidget} that will
intelligently print itself into HTML in a variety of contexts
including the R console, within R Markdown documents,
and within Shiny output bindings.
}
\description{
Make diagrams in R using \href{https://github.com/mdaines/viz.js}{viz.js}
with infrastructure provided by \href{http://www.htmlwidgets.org/}{htmlwidgets}.
}
\examples{
\dontrun{
# a very simple example
grViz( "digraph {A;}")

# slightly more involved
#  using example from http://www.graphviz.org/pdf/dotguide.pdf
#    "Drawing graphs with dot"
#    Emden R. Gansner and Eleftherios Koutsofios and Stephen North
#    January 5, 2015
grViz('
digraph G {
      size = "4,4";
      main [shape=box]; /* this is a comment */
      main -> parse [weight=8];
      parse -> execute;
      main -> init [style=dotted];
      main -> cleanup;
      execute -> { make_string; printf}
      init -> make_string;
      edge [color=red]; // so is this
      main -> printf;
      node [shape=box,style=filled,color=".7 .3 1.0"];
      execute -> compare;
}
')

}
}

