Skip to content
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

3D markers not shown in RStudio #1055

Closed
bcdunbar opened this issue Jun 22, 2017 · 5 comments
Closed

3D markers not shown in RStudio #1055

bcdunbar opened this issue Jun 22, 2017 · 5 comments

Comments

@bcdunbar
Copy link

from community discussion https://community.plot.ly/t/no-markers-on-3d-plots/4125/5

Unique to RStudio Viewer on Windows. External browsers (IE, Edge) work as expected.

p <- plot_ly(x = 1:10, y = 10:1, z = 1:10, type = 'scatter3d', mode = 'markers')

Error:

TypeError: undefined is not a constructor (evaluating 'ArrayBuffer.isView(t)')   
@cpsievert
Copy link
Collaborator

@bcdunbar can you replicate this issue on your system? If so, can you show me the list of <script>s in the <head>?

(you can inspect element in the viewer pane of RStudio to do so)

@bcdunbar
Copy link
Author

Yeah I can replicate it RStudio viewer on Windows. Microsoft Edge and IE work fine.

2017-06-26 1

@cpsievert
Copy link
Collaborator

@bcdunbar does this fix the problem?

library(plotly)
library(htmlwidgets)

p <- plot_ly(x =1:10, y = 10:1, z = 1:10, type = 'scatter3d', mode = 'markers')
saveWidget(p, "index.html", selfcontained = FALSE)

# move <script plotly.js> from <head> to <body>
html <- readLines("index.html")
idx <- grep("plotly-latest", html)
plotlyjs <- html[[idx]]
html[[idx]] <- ""
bod <- grep("<body", html)
new_html <- c(html[seq(1, bod)], plotlyjs, html[seq(bod+1, length(html))])
writeLines(new_html, "index.html")

# should open in viewer
servr::httd()

@bcdunbar
Copy link
Author

@cpsievert it doesn't. Still no markers visible in the viewer and produces the same error in the console.

@cpsievert
Copy link
Collaborator

Should be fixed via 90a5a0a

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants