can.interact: Identify if a plot can be interactive

Description Usage Arguments Details Value Methods (by class) Author(s)

View source: R/exportHTML.R

Description

Several iNZightPlots graphs have been enabled with custom interaction, while others make use of the automatic output of 'plotly'. This function returns 'TRUE' if the provided plot has interaction (as determined by iNZight), and 'FALSE' otherwise.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
can.interact(x)

## Default S3 method:
can.interact(x)

## S3 method for class 'inzplotoutput'
can.interact(x)

## S3 method for class 'ggplot'
can.interact(x)

Arguments

x

a plot object returned from a plotting function

Details

Not that, while most 'ggplot2' graphs can be passed to 'plotly', and even though we are using plot.ly directly for some of our ggplot2 graphs, we still only return 'TRUE' if the graph was created by one of the packages in the iNZight collection.

Value

Logical to identify if there is an interactive version

Methods (by class)

Author(s)

Tom Elliott, Yu Han Soh


iNZightVIT/iNZightPlots documentation built on July 17, 2019, 1:33 p.m.