plotly / plotly/plotly.js

strange jumps when zooming on real time chart

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

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

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

説明

Hi,

is there a way to fix this?
not sure if it's related to react-plotly or plotly.js
The chart jumps back and forth in a confusing way while scrolling forward.
The faster I scroll the more extreme it jumps back.
When using the toolbar, it behaves normal.

https://user-images.githubusercontent.com/45887282/110695326-a32a1180-81e1-11eb-8481-6e54cc9a2719.mp4


    useEffect(() => {

        setInterval(()=>{

            $_state(($:any) => {

                console.log($)

                const _x = $.data[0].x
                const _y = $.data[0].y

                const _ymin = _y[_y.length-1] - gaussianRand()/100
                const _ypls = _y[_y.length-1] + gaussianRand()/100

                return {...$, data: [
                    {
                        ...$.data[0],
                        x: [..._x, _x[_x.length-1]+0.1],
                        y: [..._y, ~~(Math.random()*2) ? _ymin : _ypls],
                    }
                ]}

            })

        }, 100)
        
    },[])


    return (
        <Plot 
            className={jss.root} 
            data={_state.data}
            layout={_state.layout}
            config={_state.config}
            onInitialized={figure => $_state(figure)}
            onUpdate={figure => $_state(figure)}
        />
      );

    const [_state, $_state] = useState({
        data:[
        {
            type: 'scattergl',
            mode: 'markers',
            marker: {
                color : 'rgba(255, 255, 255, 0)',
                line: {
                    width: 1,
                    color: ['rgba(255, 255, 255, 0.5)', 'rgba(255, 255, 0, 1)']
                }
            },
            x: [0],
            y: [0],
        }]
    , layout: {
        title: '-',

        font: {
            family:'IBM Plex Mono',
            size:10,
        },
        margin: {
            l: 50,
            r: 50,
            b: 50,
            t: 50,
            pad: 4
          },
        plot_bgcolor: 'rgba(255,255,255,0)',
        paper_bgcolor: 'rgba(255,255,255,0)',
        yaxis: {
            tickcolor: 'rgba(255,255,255,0.1)',
            tickwidth: 1,
            
            gridcolor: 'rgba(255,255,255,0.1)',
            gridwidth: 1,
            
            zerolinecolor: 'rgba(255,255,255,0.1)',
            zerolinewidth: 1,
          },
          xaxis: {
            tickcolor: 'rgba(255,255,255,0.1)',
            tickwidth: 1,

            zerolinecolor: 'rgba(255,255,255,0.1)',
            zerolinewidth: 1,

            gridcolor: 'rgba(255,255,255,0.1)',
            gridwidth: 1,
          
          },
    }, frames: [], config: {
        scrollZoom:true,
        
    }})

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

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

はじめの一歩

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

調査の方向性

Plotly の scattergl チャート、すばやく追加される x/y データ、scrollZoom の有効化を使用する、提供された React の例から始めます。ホイールによるスクロールとツールバーの動作を比較し、リンクされた録画を使って後方へのジャンプを再現してください;リアルタイムデータが追加されている間も前方スクロールが安定したままなら完了です。

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

評価

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

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

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