plotly / plotly/plotly.js

Using opacityscale with surface results in ordering by addition order, not depth

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

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

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

説明

Hi all, been using plotly with R for a while now and really loving it - thanks for assembling such a phenomenal program! I'd like to report a bug found while plotting multiple surface objects, which causes them to layer in the order they're added rather than the "depth" at which they should really render in the figure. See this codepen for code and examples, which are also rendered below as screenshots.

I previously posted in ropensci/plotly, but have since learned enough Javascript to assemble the codepen and the issue persists, making me think it's not an R problem. There's also no discussion of the new "opacityscale" feature there and a lively discussion here, making me hopeful that more people will have some idea how I might fix this if it isn't a bug.

This is great:

image

This is less great (same figure rotated to look from below):

image

It seems that the surface that renders always on "top" is the one that's added last in the data array. If we alter the above code a little bit to render the top layer surface before the middle one, we get some more interesting results:

Plotly.newPlot('graphDivReorderOpac', [data_z1, data_z3, data_z2]); rather than Plotly.newPlot('graphDivReorderOpac', [data_z1, data_z2, data_z3]);

image

image

Apologies for the repetitive code in the codepen - I really did learn just enough JS to make this one and will be hiding behind R wrappers in the future.

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

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

はじめの一歩

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

調査の方向性

リンクされたCodePenとopacityscaleのサーフェス例から始め、2つのトレース順序と、上および下から見たときの結果のレンダリングを比較します。深度順序を担うサーフェスレンダリングの経路を追跡します。重なり合うサーフェスがデータ配列の順序ではなく深度に基づいてレンダリングされ、動作しているopacityscaleなしの例が維持されれば完了です。

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

評価

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

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

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