plotly / plotly/plotly.R

Write Image as PDF with Box saying "Loading [MathJax]/extensions/MathMenu.js"

オープン
#2,243 コメント 4 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

主要言語
R
スター
2.7k
フォーク
641
PR マージ指標
30日以内にマージされた PR はありません

説明

Hello,

library(plotly)

n <- 1e3
x <- rnorm(n)
y <- 2*x + rnorm(n, sd = 5)

fig <- plot_ly(x = x, y = y, alpha  = 0.01,type = "scatter")

save_image(fig,"test.pdf")
browseURL("test.pdf")

image
When I run the above code, I get the box saying Loading [MathJax]/extensions/MathMenu.js,I see the Solution in plotly.py issues 3469:

import plotly.io as pio   
pio.kaleido.scope.mathjax = None

How should I solve it in R?

My sessionInfo is:

> sessionInfo()
R version 4.2.0 (2022-04-22)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 20.04.4 LTS

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3
LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/liblapack.so.3

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C               LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
 [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8    LC_PAPER=en_US.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C             LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
 [1] plotly_4.10.0        webshot2_0.1.0       RefManageR_1.4.0     knitcitations_1.0.12 shinyWidgets_0.7.5  
 [6] ggplot2_3.4.0        maftools_2.12.0      shinyjqui_0.4.1      shinyFeedback_0.4.0  bslib_0.4.2         
[11] htmltools_0.5.4      shiny_1.7.4         

loaded via a namespace (and not attached):
 [1] httr_1.4.3         sass_0.4.4         tidyr_1.2.0        jsonlite_1.8.4     viridisLite_0.4.0  splines_4.2.0     
 [7] here_1.0.1         assertthat_0.2.1   yaml_2.3.5         pillar_1.7.0       backports_1.4.1    lattice_0.20-45   
[13] glue_1.6.2         reticulate_1.25    digest_0.6.31      RColorBrewer_1.1-3 promises_1.2.0.1   colorspace_2.0-3  
[19] websocket_1.4.1    httpuv_1.6.7       Matrix_1.5-1       plyr_1.8.7         pkgconfig_2.0.3    bibtex_0.5.1      
[25] purrr_1.0.1        xtable_1.8-4       scales_1.2.0       processx_3.7.0     fontawesome_0.4.0  later_1.3.0       
[31] tibble_3.1.7       generics_0.1.2     ellipsis_0.3.2     cachem_1.0.6       withr_2.5.0        lazyeval_0.2.2    
[37] cli_3.5.0          survival_3.3-1     magrittr_2.0.3     crayon_1.5.2       mime_0.12          ps_1.7.0          
[43] fansi_1.0.3        xml2_1.3.3         tools_4.2.0        data.table_1.14.2  lifecycle_1.0.3    stringr_1.5.0     
[49] munsell_0.5.0      compiler_4.2.0     jquerylib_0.1.4    chromote_0.1.1     rlang_1.0.6        grid_4.2.0        
[55] rstudioapi_0.13    rappdirs_0.3.3     htmlwidgets_1.6.1  crosstalk_1.2.0    DNAcopy_1.70.0     gtable_0.3.0      
[61] DBI_1.1.2          R6_2.5.1           lubridate_1.8.0    dplyr_1.0.9        fastmap_1.1.0      utf8_1.2.2        
[67] rprojroot_2.0.3    stringi_1.7.8      Rcpp_1.0.9         vctrs_0.5.2        png_0.1-7          tidyselect_1.2.0

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

まず、報告された Ubuntu 環境で plotly 4.10.0 を使って save_image(fig, "test.pdf") の例を再現し、次に R のエクスポート経路を plotly.py の issue 3469 と比較します。webshot2 と chromote が MathJax の読み込みページをどのように処理するかを調べます。PDF のエクスポートが読み込みボックスなしで完了し、その動作が適切なリグレッションチェックでカバーされれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
javascript, r
領域
data-visualization
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。