plotly / plotly/plotly.js

disable default selection of button in range selector buttons

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

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

feature P3
主要言語
JavaScript
スター
18.3k
フォーク
2k
平均マージ
2日 12時間
マージ済み PR(30日)
28

説明

Hello all,

Right now, enabling the use of buttons in layout.xaxis.rangeselector makes it such that the button 'all' is always selected by default, no matter where it is positioned in the list of buttons. If the button 'all' is not present, the display is still rendered as if it was selected by default.

May we add a default (boolean) property inside a button to know which should be selected by default when first displaying the graph ? This could help to focus on a key point of the data, while allowing the user to zoom out by clicking the 'all' button or by double-clicking on the graph.
This property would be set to false by default, and if no buttons show a true value for this property, then the usual 'all' display shall be rendered.

Example :
Usual display

var layout = {
xaxis: {
            autorange: true,
            rangeselector: {
                buttons: [
                    {
                        count: 1,
                        label: '1m',
                        step: 'month',
                        stepmode: 'backward'
                    },
                    {
                        count: 6,
                        label: '6m',
                        step: 'month',
                        stepmode: 'backward'
                    },
                    {   
                        step: 'all'
                    }
                ]
            },
            rangeslider: {autorange: true},
            type: 'date'
        }
};

In the second case, when loading the page, we already have the 6 months zoom.
6 months button selected by default

var layout = {
        xaxis: {
            autorange: true,
            rangeselector: {
                buttons: [
                    {
                        count: 1,
                        label: '1m',
                        step: 'month',
                        stepmode: 'backward'
                    },
                    {
                        count: 6,
                        label: '6m',
                        step: 'month',
                        stepmode: 'backward',
                        default: true
                    },
                    {   
                        step: 'all'
                    }
                ]
            },
            rangeslider: {autorange: true},
            type: 'date'
        }
};

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

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

はじめの一歩

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

調査の方向性

issue で説明されている xaxis.rangeselector ボタンの処理から始め、初期選択範囲がどのように決定されるかを追跡します。default: true を持つボタンが初期範囲を制御し、どのボタンにもデフォルトのマークが付いていない場合は既存の「all」の動作がフォールバックとして残るようになれば、作業は完了です。

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

評価

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

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

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