plotly / plotly/plotly.js

Scatter 3D dragmode turntable loses the camera.eye on JavaScript reload

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

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

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

説明

Scatter 3D dragmode "orbit" and "turntable" moves camera.eye but it is not reflected to layout.schene.camera.eye of the frame. It will be saved just after mouse click event or wheel, through relayoutCallback > scene.saveLayout .
https://github.com/plotly/plotly.js/blob/35fb5b918e3dbdc3cc6e3b9735c8003008376020/src/plots/gl3d/scene.js#L240

If replot, react, animate and so on, happens during mouse move and mouse up, replot uses layout.schene.camera.eye saved BEFORE and overwrite.

It can reploduced in https://halueda.github.io/wavy-orbitals/ .
Its color is chaneged once a second and you can only rotate 3d-axis if mouse move is in 1 second, during color change.

To solve this, there seems two ways.

  1. every mouse move event do scene.saveLayout. It may cause performance impact.
  2. replot function do scene.saveLayout if the plot is 3d.

Perhaps more genral way should be used. For example, mouse moving event set into something like pending events and replot-api executes all pending events prior to real replot. As well as, scene.saveLayout clears the pending event.

This issue can be related to:
#5500
#5005
#5560

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

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

はじめの一歩

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

調査の方向性

src/plots/gl3d/scene.js の 240 行目付近から始め、色の更新によって replot が発生している間に、リンク先の wavy-orbitals の例でカメラ状態が失われる問題を再現します。relayoutCallback、scene.saveLayout、replot の経路を追跡します。マウス操作中の replot、react、またはアニメーションによって、orbit または turntable カメラの camera.eye の変更が現在のビューを上書きせずに維持されれば完了です。

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

評価

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

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

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