plotly / plotly/plotly.R

orca error

Đang mở
#1,863 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Ngôn ngữ chính
R
Star
2.7k
Fork
641
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

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,

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Hướng nghiên cứu

Bắt đầu trong orca.R quanh các dòng 201-210 và tái hiện ví dụ orca() được báo cáo với đầu ra được ghi trong tài liệu của processx::run("orca", "-h"). Kiểm tra cách correct_orca() xác thực lệnh và cách orca_available() sử dụng kết quả đó. Hoàn tất khi một tệp thực thi Orca đã cài đặt được nhận diện ngay cả khi đầu ra trợ giúp của nó được bản địa hóa, trong khi Orca không khả dụng vẫn tạo ra lỗi dự kiến.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
r
Lĩnh vực
data-visualization
Loại issue
Lỗi
Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Đặc tả rõ ràng
Mức phù hợp với người mới
50/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.