@@ -91,6 +91,12 @@ rangeslider <- function(p, start = NULL, end = NULL, ...) {
91
91
# ' @param collaborate include the collaborate mode bar button (unique to the R pkg)?
92
92
# ' @param cloud include the send data to cloud button?
93
93
# ' @param locale locale to use. See [here](https://github.com/plotly/plotly.js/tree/master/dist#to-include-localization) for more info.
94
+ # ' @param mathjax whether or not to add [MathJax rendering support](https://github.com/plotly/plotly.js/tree/master/dist#to-support-mathjax).
95
+ # ' Note that plotly uses SVG-based mathjax rendering which won't play nicely with
96
+ # ' HTML-based rendering (e.g., rmarkdown documents). In this case, you may want to
97
+ # ' consider `<iframe>`-ing your plotly graph(s) into the larger document.
98
+ # ' Currently mathjax is loaded externally (meaning an internet
99
+ # ' connection is needed to view the graph). Future versions may not have this requirement.
94
100
# ' @author Carson Sievert
95
101
# ' @export
96
102
# ' @examples
@@ -103,16 +109,18 @@ rangeslider <- function(p, start = NULL, end = NULL, ...) {
103
109
# ' # remove the plotly logo and collaborate button from modebar
104
110
# ' config(p, displaylogo = FALSE, collaborate = FALSE)
105
111
# '
112
+ # ' # enable mathjax
113
+ # ' # see more examples at https://plot.ly/r/LaTeX/
114
+ # ' plot_ly(x = c(1, 2, 3, 4), y = c(1, 4, 9, 16)) %>%
115
+ # ' layout(title = "$\\text{Some mathjax: }\\alpha+\\beta x$") %>%
116
+ # ' config(mathjax = TRUE)
117
+ # '
106
118
# ' # japanese
107
119
# ' config(p, locale = "ja")
108
120
# ' # german
109
121
# ' config(p, locale = "de")
110
- # ' # swiss-german
111
- # ' config(p, locale = "de-CH")
112
122
# ' # spanish
113
123
# ' config(p, locale = "es")
114
- # ' # french
115
- # ' config(p, locale = "fr")
116
124
# ' # chinese
117
125
# ' config(p, locale = "zh-CN")
118
126
# '
@@ -129,7 +137,7 @@ config <- function(p, ..., collaborate = TRUE, cloud = FALSE, locale = NULL, mat
129
137
130
138
if (! identical(mathjax , FALSE )) {
131
139
p $ dependencies <- c(
132
- list (mathjax_dependency ()),
140
+ list (mathjax_cdn ()),
133
141
p $ dependencies
134
142
)
135
143
}
0 commit comments