plotly / plotly/plotly.R

config is not overwritting `ModeBarButtons` slot

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

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

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

説明

I have noticed that after placing a ModeBarButtons configuration, it is not overwritten / updated downstream.

Reproducible example:

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
  # This plotly only has the `toImage` modeBarButton
  plot1 <- plot_ly() %>%
    config(displaylogo = FALSE) %>%
    config(modeBarButtons = list(list("toImage")))
  plot1$x$config$modeBarButtons
#> [[1]]
#> [[1]][[1]]
#> [1] "toImage"
  
  # This plotly also has the `toImage` modeBarButton only
  plot2 <- plot_ly() %>%
    config(displaylogo = FALSE) %>%
    config(modeBarButtons = list(list("toImage"))) %>% 
    config(modeBarButtons = list(list("zoom")))
  plot2$x$config$modeBarButtons
#> [[1]]
#> [[1]][[1]]
#> [1] "toImage"

Created on 2022-11-29 with reprex v2.0.2

This holds true for config(modeBarButtonsToAdd ...)

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

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

はじめの一歩

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

調査の方向性

config() エントリーポイントから始め、plot1$x$config$modeBarButtons と plot2$x$config$modeBarButtons を比較して、issue の 2 つの例を再現します。後から行った modeBarButtons の設定によって以前の値が更新され、modeBarButtonsToAdd でも同じ動作が検証できれば、修正は完了です。

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

評価

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

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

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