| innsight_plotly {innsight} | R Documentation |
S4 class for plotly-based plots
Description
The S4 class innsight_plotly visualizes the results of the methods
provided from the package innsight using plotly.
In addition, it allows easier analysis of the results and modification of
the visualization by basic generic functions. The individual slots are for
internal use only and should not be modified.
Details
This S4 class is a simple extension of a plotly object that enables a more detailed analysis of the results and a way to visualize the results of models with multiple input layers (e.g., images and tabular data).
The overall plot is created in the following order:
The corresponding shapes and annotations of the slots
annotationsandshapesare added to each plot inplots. This also adds the strips at the top for the output node (or input layer) and, if necessary, on the right side for the data point.Subsequently, all individual plots are combined into one plot with the help of the function plotly::subplot.
Lastly, the global elements from the
layoutslot are added and if there are multiple input layers (multiplot = TRUE), another output strip is added for the columns.
An example structure of the plot with multiple input layers is shown below:
| Output 1: Node 1 | Output 1: Node 3 | | Input 1 | Input 2 | Input 1 | Input 2 | |---------------------------------------------------------|------------- | | | | | | plots[1,1] | plots[1,2] | plots[1,3] | plots[1,4] | data point 1 | | | | | |---------------------------------------------------------|------------- | | | | | | plots[2,1] | plots[2,2] | plots[2,3] | plots[2,4] | data point 2 | | | | |
Additionally, some generic functions are implemented to visualize individual aspects of the overall plot or to examine them in more detail. All available generic functions are listed below:
Slots
plotsThe individual plotly objects arranged as a matrix (see details for more information).
shapesA list of two lists with the names
shapes_stripsandshapes_other. The listshapes_stripscontains the shapes for the strips and may not be manipulated. The other listshapes_othercontains a matrix of the same size asplotsand each entry contains the shapes of the corresponding plot.annotationsA list of two lists with the names
annotations_stripsandannotations_other. The listannotations_stripscontains the annotations for the strips and may not be manipulated. The other listannotations_othercontains a matrix of the same size asplotsand each entry contains the annotations of the corresponding plot.multiplotA logical value indicating whether there are multiple input layers and therefore correspondingly individual ggplot2 objects instead of one single object.
layoutThis list contains all global layout options, e.g. update buttons, sliders, margins etc. (see plotly::layout for more details).
col_dimsA list to assign a label to the columns for the output strips.