Skip to content

plotly + FlexDashboard + Firefox = huge memory consumption #721

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

Closed
alistaire47 opened this issue Sep 19, 2016 · 5 comments
Closed

plotly + FlexDashboard + Firefox = huge memory consumption #721

alistaire47 opened this issue Sep 19, 2016 · 5 comments

Comments

@alistaire47
Copy link

I ran into a bug today in which any plotly plot in a FlexDashboard viewed in Firefox (locally or remotely) consumes a huge amount of memory—about 2Gb on my machine, regardless of complexity. The same webpage has no noticeable impact on the memory consumption of Chrome or Safari.

An example of a page that will cause the issue for me:


---
title: "Untitled"
output: 
  flexdashboard::flex_dashboard:
    orientation: columns
    vertical_layout: fill

---

```{r setup, include=FALSE}
library(flexdashboard)
```

### Chart A

```{r}
library(plotly)

plot_ly(mtcars, x = ~hp, y = ~mpg)
```

This is with the development version of plotly (4.4.4) updated yesterday from GitHub.

@cpsievert
Copy link
Collaborator

By adding self_contained: false to the YAML header, the issue seems to go away.

This must have something to do with the way rmarkdown/pandoc uses data URIs to produce a standalone HTML file...

This isn't something I'll have the bandwidth to fix in the coming months, but hopefully someone from the plotly.js crew can help out, since I'm pretty sure any patch we do provide should be native to plotly.js (cc @etpinard @monfera @timelyportfolio)

PS. I'm pretty sure this is related to #483

@alistaire47
Copy link
Author

Hmm, self_contained: false works for my example here, but causes pandoc to hang when building my real site, for reasons I have yet to debug.

And apologies for the semi-dupe; I swear I searched before I posted, but not very well, apparently.

@ManuelZ
Copy link

ManuelZ commented Feb 4, 2017

Hi, how do I set that YAML header? where? because you are right, when opening in Firefox an exported Plotly graph (or rpubs uploaded), it uses a plotly base64 encoded library. But when clicking in "Show in new window" (see attached screen), it references a plotly .js library (see second attached figure). And in the former case it consumes huge amounts of memory, while in the second case it works just fine.

First
Second

@cpsievert
Copy link
Collaborator

note to self: hoping plotly/plotly.js#1525 fixes this

@cpsievert
Copy link
Collaborator

This appears to be fixed.

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

3 participants