plotly / plotly/plotly.R

Plotly graphs in jupyter notebooks re-render entire page html

Offen
#1,950 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Vorherrschende Sprache
R
Sterne
2.7k
Forks
641
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

When attempting to run the first graph in the getting started documents, after following the steps here, the entire page html is output ontop of the graph like in the screenshot below. This occurs for all other graphs I've tried as well.

library(plotly)
fig <- plot_ly(midwest, x = ~percollege, color = ~state, type = "box")
fig

image


Steps to Reproduce:

  1. pull the jupyter/r-notebook docker image from here with the command docker pull jupyter/r-notebook
    a. This allows you to skip the "add r-kernel" steps because the R kernel is included with the r-notebook. Specifically these two lines can be skipped:
devtools::install_github('IRkernel/IRkernel')
IRkernel::installspec()

Alternatively, start with the jupyter/minimal-notebook and do the steps to add the R kernel.

  1. Run the docker image with docker run -p '8888:8888' -e JUPYTER_ENABLE_LAB=yes jupyter/r-notebook
  2. Open an R console and run install.packages(c('repr', 'IRdisplay', 'pbdZMQ', 'devtools')) from the setup steps
  3. Install pandoc - get to the container bash as root user. First get the container ID with docker ps then use the ID you see there in docker exec -u root -ti <container id> bash. Run apt update then apt install pandoc.
    a. Open the notebook from the link that step 2 output and you can verify pandoc is installed in /usr/bin/pandoc by opening a terminal and navigating to the /usr/bin directory.
  4. Install plotly - either use the R console or the terminal. Personally, I used the terminal and ran conda install r-plotly. I attempted with both the latest version and also with v4.9.2.2. Both showed the issue.
  5. Once that's all setup, open an R-kernel notebook and attempt to create any plotly graph. It will initially load the graph correctly, then a few seconds later, you will see the issue from the screenshot above.

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne mit den verlinkten Getting-started-Anweisungen für R-in-Jupyter und reproduziere das Beispiel in einem jupyter/r-notebook-Docker-Container mit einem R-kernel-Notebook. Vergleiche die anfängliche Darstellung des Graphen mit der späteren im Issue beschriebenen Ausgabe; abgeschlossen ist die Aufgabe, wenn Plotly-Graphen gerendert werden, ohne das gesamte Seiten-HTML an den Graphen anzuhängen.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
docker, jupyter-notebook, r
Bereich
data-visualization
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Muss geklärt werden
Anfängerfreundlichkeit
25/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.