plotly / plotly/plotly.js

why Plotly.react() is as slow as Plotly.newPlot()? updating single trace of many

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

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

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

説明

Hi, I am trying to redraw only single trace in a plot of many traces (biophysical data). I tried to follow instructions in react-plotly and plotlyjs documentation:
https://plotly.com/javascript/plotlyjs-function-reference/#plotlyreact
Plot is updated but I don't see any performance improvement if I change only single element of data or all data elements:
Here is MWE in codepen
Briefly, I generated sample data 100 traces of 10000 points and changing only first trace with:

  data[0].x =  [...Array(10).keys()].map( c=> c/10) //change only first trace
  data[0].y =  [...Array(10).keys()].map( c=> Math.random())
  Plotly.react('myDiv', data, layout);

Drawing plot containing single trace takes just a split of second, but if I had already drawn many traces and I want to redraw only single trace, it takes same time as to redraw all traces (few seconds).
Am I doing something wrong?

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

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

はじめの一歩

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

調査の方向性

リンクされたCodePen MWEから始め、100トレース、10,000ポイントの指定されたデータを使ってPlotly.react()とPlotly.newPlot()を比較してください。リンクされたPlotly.reactのドキュメントを読み、リポジトリ内の更新パスを追跡してください。このissueではソースファイルもテストも指定されていません。完了の条件は、同程度の計測時間になる原因を特定し、想定される最適化またはドキュメント変更を定義することです。

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

評価

技術スタック
javascript
領域
data-visualization, frontend, performance
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
25/100

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

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