This book describes interactive data visualization using the R package plotly. It focuses on tools and techniques that data analysts should find useful for asking follow-up questions from their data using interactive web graphics. A basic understanding of R is assumed.
Introduction
Why interactive web graphics from R?
What you will learn
What you won't learn (much of)
Web technologies
djs
ggplot
Graphical data analysis
Data visualization best practices
Prerequisites
Run code examples
Getting help and learning more
Acknowledgements
Colophon
I Creating views
Overview
Intro to plot_ly()
Intro to plotlyjs
Intro to ggplotly()
Scattered foundations
Markers
Alpha blending
Colors
Symbols
Stroke and span
Size
Dotplots & error bars
Lines
Linetypes
Segments
Density plots
Parallel Coordinates
Polygons
Ribbons
Maps
Integrated maps
Overview
Choropleths
Custom maps
Simple features (sf)
Cartograms
Bars & histograms
Multiple numeric distributions
Multiple discrete distributions
Boxplots
D frequencies
Rectangular binning in plotlyjs
Rectangular binning in R
Categorical axes
D charts
Markers
Paths
Lines
Axes
Surfaces
II Publishing views
Introduction
Saving and embedding HTML
Exporting static images
With code
From a browser
Sizing exports
Editing views for publishing
III Combining multiple views
Arranging views
Arranging plotly objects
Recursive subplots
Other approaches & applications
Arranging htmlwidgets
Flexdashboard
Bootstrap grid layout
CSS flexbox
Arranging many views
Animating views
Animation API
Animation support
IV Linking multiple views
Introduction
Client-side linking
Graphical queries
Highlight versus filter events
Linking animated views
Examples
Querying facetted charts
Statistical queries
Statistical queries with ggplotly()
Geo-spatial queries
Linking with other htmlwidgets
Generalized pairs plots
vi Contents
Querying diagnostic plots
Limitations
Server-side linking with shiny
Embedding plotly in shiny
Your first shiny app
Hiding and redrawing on resize
Leveraging plotly input events
Dragging events
D events
Edit events
Relayout vs restyle events
Scoping events
Event priority
Handling discrete axes
Accumulating and managing event data
Improving performance
Partial plotly updates
Partial update examples
Advanced applications
Drill-down
Cross-filter
A draggable brush
Discussion
V Event handling in JavaScript
Introduction
Working with JSON
Assignment, subsetting, and iteration
Mapping R to JSON
Adding custom event handlers
Supplying custom data
Leveraging web technologies from R
Web infrastructure
Modern JS & React
VI Various special topics
Is plotly free & secure?
Improving performance
Controlling tooltips
plot_ly() tooltips
ggplotly() tooltips
Styling
Control the modebar
Remove the entire modebar
Remove the plotly logo
Remove modebar buttons by name
Add custom modebar buttons
Control image downloads
Working with colors
Working with symbols and glyphs
Embedding images
Language support
LaTeX rendering
MathJax caveats
The data-plot-pipeline
Improving ggplotly()
Modifying layout
Modifying data
Leveraging statistical output
Translating custom ggplot geoms