Distinct behaviour of filter_spec in the absence/presence of select_spec

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

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

評価

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

調査の方向性

row_facet の例を再現し、teal.transform にある data_extract_spec、select_spec、filter_spec のエントリポイントを追跡します。select_spec が存在する場合と存在しない場合の動作を比較し、その後、select_spec の選択を解除しても、期待される動作で説明されているとおり filter_spec がファセット化を制御し続けることを確認します。

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

説明

core discussion

There is a distinct behaviour of filter_spec in the absence or presence of select_spec which is described in the following two scenarios:

  1. Scenario 1: select_spec and filter_spec are both defined for a variable.
    In case select_spec is deselected, filter_spec becomes obsolete and whatever you change does not have influence. In the example below, filter_spec does not influence facetting.

  2. Scenario 2: filter_spec is only defined defined for a variable.
    In this case, filter_spec takes the role of select_spec and in the example below facetting is controlled by filter_spec.

The example below reproduces the 2 scenarios on row_facet variable. To reproduce scenario 2, use the example below. To reproduce scenario 1, uncomment select of row_facet.

library(random.cdisc.data)
devtools::load_all("../teal/")
devtools::load_all("../teal.devel/")
devtools::load_all("../teal.modules.general/")

ADSL <- radsl(cached = TRUE)
ADSL$RACE[1:3] <- NA

dynamic_filter <- filter_spec(
  vars = choices_selected(variable_choices(ADSL), "COUNTRY"),
  multiple = TRUE
)

app <- init(
  data = cdisc_data(
    cdisc_dataset("ADSL", ADSL, code = "ADSL <- radsl(cached = TRUE)
                  ADSL$RACE[1:3] <- NA"),
    check = FALSE
  ),
  modules = root_modules(
    tm_g_scatterplot(
      label = "Scatterplot Choices",
      x = data_extract_spec(
        dataname = "ADSL",
        select = select_spec(
          label = "Select variable:",
          choices = variable_choices(ADSL, c("AGE", "BMRKR1", "BMRKR2")),
          selected = "AGE",
          multiple = FALSE,
          fixed = FALSE
        )
      ),
      y = data_extract_spec(
        dataname = "ADSL",
        select = select_spec(
          label = "Select variable:",
          choices = variable_choices(ADSL, c("AGE", "BMRKR1", "BMRKR2")),
          selected = "BMRKR1",
          multiple = FALSE,
          fixed = FALSE
        )
      ),
      color_by = data_extract_spec(
        dataname = "ADSL",
        select = select_spec(
          choices = variable_choices(ADSL),
          selected = "REGION1",
          multiple = TRUE
        )
      ),
      row_facet = data_extract_spec(
        dataname = "ADSL",
        # select = select_spec(
        #       choices = variable_choices(ADSL),
        #       selected = "SEX",
        #       multiple = FALSE
        #     ),
        filter = list(
          dynamic_filter
        )
      )
    )
  )
)
shinyApp(app$ui, app$server)

The expected behaviour would be to have like scenario 2 where filter_spec takes the role of select_spec when it is deselected or not defined.

Provenance:

Creator: mhallal1
主要言語
R
スター
2
フォーク
5
PR マージ指標
30日以内にマージされた PR はありません

環境構築

はじめの一歩

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

pharmaverse/teal.transform のほかの issue

pharmaverse/teal.transform の issue をすべて見る

似ている issue

R の issue をもっと見る

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

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