df: data.frame containing the names of the interactors and the link strengths. bipartite package data need to be passed through Matrix2DF or Array2DF first.
filename: character string to name the .js and .css files. Do not include a file extension
colouroption: Either 'monochrome', 'brewer' or 'manual'
HighlightLab: Name of interactor to highlight
HighlightCol: Highlight colour
monoChromeCol: If using monochrome option, what colour to use
ColourBy: Which set of interactors to colour by. 1= primary, 2= secondary
BrewerPalette: RColorBrewer palette
NamedColourVector: Named vector of colours for manual colour assignment
MainFigSize: Size of figure, used here to calculate facet spacing.
SortPrimary: Vector detailing order to arrange primary level. Default is alphabetical
SortSecondary: Vector detailing order to arrange secondary level. Default is alphabetical
mp: Numeric vector c(rows, columns)
MinWidth: Numeric. Minimum size to shrink unselected interactors to.
Pad: Numeric. Gap between species.
IndivFigSize: Size of each facet, specifically the interactions.
BarSize: Thickness of bars representing interactors
Orientation: Either 'horizontal' or 'vertical' orientation.
EdgeMode: Set to 'straight' to avoid curly lines.
AxisLabels: c('Primary','Secondary') to overide column names of dataframe
FigureLabel: Character vector, to allow overide of use of df column names
BoxLabPos: c(x_p,x_s) To adjust position of species labels. Default is based on maximum length of labels.
IncludePerc: Boolean. whether or not to show percentage links
PercentageDecimals: Number of decimal places to display percentages to. Useful if rare species are rounded to 0.
PercPos: c(x_p,x_s) To adjust position of percentages. Default is based on maximum length of labels.
CSS_Output_Supress: Boolean. Set to TRUE if you have changed the CSS file manually and don't want it over written
PRINT: Boolean. Output generated JavaScript to screen?
Returns
As a side effect, saves visjs.js (vis plotting library), filename.js and filename.css to the working directory.
Examples
## Simple Data Settestdata <- data.frame(higher = c("bee1","bee1","bee1","bee2","bee1","bee3"),lower = c("plant1","plant2","plant1","plant2","plant3","plant4"), Meadow=c(5,9,1,2,3,7))BP_JS_Writer(testdata,PRINT=TRUE)## tidy up (to keep CRAN happy, not needed in real life use)file.remove('vizjs.js')file.remove('JSBP.js')file.remove('JSBP.css')