1% Generated by roxygen2: do not edit by hand
2% Please edit documentation in R/plot.R
3\name{gexf_js_config}
4\alias{gexf_js_config}
5\alias{plot.gexf}
6\title{Visualizing GEXF graph files using gexf-js}
7\usage{
8gexf_js_config(
9  dir,
10  graphFile = "network.gexf",
11  showEdges = TRUE,
12  useLens = FALSE,
13  zoomLevel = 0,
14  curvedEdges = TRUE,
15  edgeWidthFactor = 1,
16  minEdgeWidth = 1,
17  maxEdgeWidth = 2,
18  textDisplayThreshold = 9,
19  nodeSizeFactor = 1,
20  replaceUrls = TRUE,
21  showEdgeWeight = TRUE,
22  showEdgeLabel = TRUE,
23  sortNodeAttributes = TRUE,
24  showId = TRUE,
25  showEdgeArrow = TRUE,
26  language = FALSE
27)
28
29\method{plot}{gexf}(
30  x,
31  y = NULL,
32  graphFile = "network.gexf",
33  dir = tempdir(),
34  overwrite = TRUE,
35  httd.args = list(),
36  copy.only = FALSE,
37  ...
38)
39}
40\arguments{
41\item{dir}{Directory where the files will be copied (tempdir() by default).}
42
43\item{graphFile}{Name of the gexf file.}
44
45\item{showEdges}{Logical scalar. Default state of the "show edges" button (nullable).}
46
47\item{useLens}{Logical scalar. Default state of the "use lens" button (nullable).}
48
49\item{zoomLevel}{Numeric scalar. Default zoom level. At zoom = 0, the graph
50should fill a 800x700px zone}
51
52\item{curvedEdges}{Logical scalar. False for curved edges, true for straight
53edges this setting can't be changed from the User Interface.}
54
55\item{edgeWidthFactor}{Numeric scalar. Change this parameter for wider or
56narrower edges this setting can't be changed from the User Interface.}
57
58\item{minEdgeWidth}{Numeric scalar.}
59
60\item{maxEdgeWidth}{Numeric scalar.}
61
62\item{textDisplayThreshold}{Numeric scalar.}
63
64\item{nodeSizeFactor}{Numeric scalar. Change this parameter for smaller or
65larger nodes this setting can't be changed from the User Interface.}
66
67\item{replaceUrls}{Logical scalar. Enable the replacement of Urls by
68Hyperlinks this setting can't be changed from the User Interface.}
69
70\item{showEdgeWeight}{Logical scalar. Show the weight of edges in the list
71this setting can't be changed from the User Interface.}
72
73\item{showEdgeLabel}{Logical scalar.}
74
75\item{sortNodeAttributes}{Logical scalar. Alphabetically sort node attributes.}
76
77\item{showId}{Logical scalar. Show the id of the node in the list
78this setting can't be changed from the User Interface.}
79
80\item{showEdgeArrow}{Logical scalar. Show the edge arrows when the edge is
81directed this setting can't be changed from the User Interface.}
82
83\item{language}{Either \code{FALSE}, or a character scalar with any of the
84supported languages.}
85
86\item{x}{An object of class \code{gexf}.}
87
88\item{y}{Ignored.}
89
90\item{overwrite}{Logical scalar. When \code{TRUE}, the default, the function
91will overwrite all files copied from the template on the destination directory
92as specified by \code{dir}.}
93
94\item{httd.args}{Further arguments to be passed to \link[servr:httd]{servr::httd}
95from the \CRANpkg{servr} package.}
96
97\item{copy.only}{Logical scalar. When FALSE, the default, the function
98will make a call to \code{servr::httd}.}
99
100\item{...}{Further arguments passed to \code{gexf_js_config}}
101}
102\description{
103Using the gexf-js, a JavaScript GEXF viewer, this function allows you to
104visualize your GEXF on the browser. The function essentially copies a template
105website, the GEXF file, and sets up a configuration file. By default, the
106function then starts a webserver using the \code{servr} R package.
107}
108\details{
109Currently, the only languages supported are:
110\Sexpr{paste(names(rgexf:::gexf_js_languages), " (", rgexf:::gexf_js_languages, ")", sep="", collapse=", ")}.
111
112An important thing for the user to consider is the fact that the function
113only works if there are \code{viz} attributes, this is, color, size, and position.
114If the \link{gexf} object's XML document does not have viz attributes, users can
115use the following hack:\preformatted{# Turn the object ot igraph and go back
116x <- igraph.to.gexf(gexf.to.igraph(x))
117
118# And you are ready to plot!
119plot(x)
120}
121
122More details on this in the \link{igraph.to.gexf} function.
123
124The files are copied directly from
125\Sexpr{system.file("gexf-js", package="rgexf")}. And the
126parameters are set up by modifying the following template file:
127
128\Sexpr{system.file("gexf-js/config.js.template", package="rgexf")}
129
130The server is lunched if and only if \code{interactive() == TRUE}.
131}
132\examples{
133if (interactive()) {
134
135path <- system.file("gexf-graphs/lesmiserables.gexf", package="rgexf")
136graph <- read.gexf(path)
137plot(graph)
138
139}
140
141}
142\references{
143gexf-js project website https://github.com/raphv/gexf-js.
144}
145