-
Notifications
You must be signed in to change notification settings - Fork 633
Solved the LaTeX2exp error. Closes #2027 #2030
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 12 commits
453b10e
823c516
ee146c5
71df890
e559130
ea35806
99cd9da
e27621c
d915b9c
37a4ae6
6fb00c9
8c765f1
6d29bad
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,12 +51,12 @@ write_plotly_svg <- function(p, file) { | |
|
||
# strip out non-deterministic fullLayout.uid | ||
# TODO: if and when plotly provides an API to pre-specify, use it! | ||
svg_txt <- readLines(file, warn = FALSE) | ||
svg_txt <- readLines(basename(file), warn = FALSE) | ||
strextract <- function(str, pattern) regmatches(str, regexpr(pattern, str)) | ||
def <- strextract(svg_txt, 'defs id=\\"defs-[[:alnum:]]+\\"') | ||
uid <- sub("defs-", "", strextract(def, "defs-[[:alnum:]]+")) | ||
svg_txt <- gsub(uid, "", svg_txt, fixed = TRUE) | ||
writeLines(svg_txt, file) | ||
writeLines(svg_txt, basename(file)) | ||
Comment on lines
+54
to
+59
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What's the purpose of this change? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I had issues when using |
||
} | ||
|
||
# copied from vdiffr | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
library(latex2exp) | ||
|
||
test_that("latex2exp expressions render correctly", { | ||
p <- qplot(1, "A")+ | ||
ylab(TeX("$\\frac{2hc^2}{\\lambda^\\beta}$"))+ | ||
xlab(TeX("$\\alpha$")) | ||
|
||
expect_doppelganger(config(ggplotly(p), mathjax="cdn"), "latex2exp-rendering") | ||
}) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
test_that("add_area() works", { | ||
data(wind) | ||
p <- plot_ly(wind, r = ~r, theta = ~t) %>% | ||
add_area(color = ~nms) %>% | ||
layout( | ||
polar = list( | ||
radialaxis = list(ticksuffix = "%"), | ||
angularaxis = list(rotation = 90) | ||
) | ||
) | ||
expect_doppelganger_built(p, "add-area") | ||
}) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please rebase these changes off of |
Uh oh!
There was an error while loading. Please reload this page.