plotly / plotly/plotly.R

`add_annotations` incompatible with multicategory axis

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

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

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

説明

I've been attempting to plot horizontal arrows using add_annotations in a plotly object with a multicategory y-axis. Instead of positioning annotations along the y-axis, they are all positioned at the origin.

(Because the same behavior occurs with other types of annotation, I have included some text in the reprex as well.)

library(tibble)
library(plotly)
#> Loading required package: ggplot2
#> 
#> Attaching package: 'plotly'
#> The following object is masked from 'package:ggplot2':
#> 
#>     last_plot
#> The following object is masked from 'package:stats':
#> 
#>     filter
#> The following object is masked from 'package:graphics':
#> 
#>     layout

tribble(
  ~cat1, ~cat2, ~start, ~end,
  "a", "f", 1, 2,
  "a", "g", 2, 3,
  "a", "h", 3, 0,
  "b", "f", 0, 3
  ) %>% 
  plot_ly(y = ~list(cat1, cat2)) %>% 
  add_markers(x = ~start) %>% 
  add_markers(x = ~end) %>% 
  add_annotations(text = ":(",
                  showarrow = TRUE,
                  xref = "x", axref = "x",
                  yref = "y", ayref = "y",
                  x = ~start,
                  ax = ~end,
                  y = ~list(cat1, cat2),
                  ay = ~list(cat1, cat2))

plot

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

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

はじめの一歩

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

調査の方向性

提供された R reprex とエントリーポイント add_annotations から始め、annotations と markers で multicategory y-axis の値がどのように処理されるかを追跡します。例を使って原点の位置決めを再現し、list(cat1, cat2) を使用する annotations が multicategory axis に沿って配置され、他の annotation types にリグレッションが生じないことを確認します。

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

評価

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

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

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