plotly / plotly/plotly.R

orca error

未关闭
#1,863 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

主要语言
R
星标
2.7k
派生
641
PR 合并指标
30 天内没有已合并 PR

描述

Hi Carson Sievert,

An error occur when I want to export graph using orca.

# help orca example
p <- plot_ly(z = ~volcano) %>% add_surface()
orca(p, "surface-plot.svg")

I obtain these R output

Erreur : The orca command-line utility is required for this functionality.
Please follow the installation instructions here -- https://github.com/plotly/orca#installation

which come from your orca_available() function

orca_available <- function() {
  if (Sys.which("orca") == "" || !correct_orca()) {
    stop(
      "The orca command-line utility is required for this functionality.\n\n",
      "Please follow the installation instructions here -- https://github.com/plotly/orca#installation",
      call. = FALSE
    )
  }
  
  TRUE
}

but, as shown below, orca is available on my computer

$ orca
Plotly's image-exporting utilities

  Usage: orca [--version] [--help] <command> [<args>]

  Available commands:
  - graph [or plotly-graph, plotly_graph]
    Generates an image of plotly graph from inputted plotly.js JSON attributes.
    For more info, run `orca graph --help`.
  - serve [or server]
    Boots up a server with one route per available export component
    For more info, run `orca serve --help`.

The bug come from correct_orca() (orca.R, lines 201-210), with As shown below, processx::run() don't export the first line "Plotly's image-exporting utilities" of stdout which is use by grepl to return TRUE.

# orca.R lines 207-210
correct_orca <- function() {
  orca_help <- processx::run("orca", "-h")
  grepl("plotly", orca_help[["stdout"]], ignore.case = TRUE)
}

# processx line
> processx::run("orca", "-h")
$status
[1] 0

$stdout
[1] "Utilisation : orca [-h] [-v] [-r] [-s] [-l] [-e OPTION] [-d OPTION] [-p NOM]\n                   [-u RÉPERTOIRE] [--debug-file FICHIER] [--debug]\n\nParamètres facultatifs:\n  -h, --help                    Montrer ce message d’aide et quitter\n  -v, --version                 3.36.2\n  -r, --replace                 Remplace une instance actuellement lancée de\n                                ce lecteur d’écran\n  -s, --setup                   Définit les préférences utilisateur (mode\n                                graphique)\n  -l, --list-apps               Affiche les applications lancées connues\n  -e OPTION, --enable OPTION    Force l’utilisation de l’option\n  -d OPTION, --disable OPTION   Empêche l’utilisation de l’option\n  -p NOM, --profile NOM         Charge le profil\n  -u RÉPERTOIRE, --user-prefs RÉPERTOIRE\n                                Utilise un répertoire alternatif pour les\n                                préférences des utilisateurs\n  --debug-file FICHIER          Envoie la sortie de débogage dans le fichier\n                                indiqué\n  --debug                       Envoie la sortie de débogage dans debug-AAAA-\n                                MM-JJ-HH:MM:SS.out\n\nRapportez les bogues à orca-list@gnome.org.\n"

$stderr
[1] ""

$timeout
[1] FALSE

Maybe you can remove correct_orca() function to prevent this bug, and because you test orca availability with Sys.which("orca") on orca_available()

Sincerely,

Aurélien BRIONNE,

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

从 orca.R 第 201-210 行附近开始,使用文档中 processx::run("orca", "-h") 的输出重现报告中的 orca() 示例。检查 correct_orca() 如何验证命令,以及 orca_available() 如何使用该结果。完成的标准是:即使已安装的 Orca 的帮助输出经过本地化,也能识别它;而不可用的 Orca 仍会产生预期的错误。

由索引模型根据 Issue 内容生成。

评估

技术栈
r
领域
data-visualization
Issue 类型
缺陷
难度
2/5
预计耗时
1-3 小时
活跃度
停滞
描述清晰度
描述清楚
新手友好度
50/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。