plotly / plotly/plotly.js

Scattergl doesn't fill to zero y (`tozeroy`) properly

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

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

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

説明

scatter works fine, but scattergl fills in a wrong way.

a simple demo:

<html>
<head>
    <meta charset="utf-8"/>
    <script src="https://cdn.plot.ly/plotly-2.6.3.min.js"></script>
    <title>plotly tozeroy bug</title>
</head>
<body>
<div>
    <div id="823f03ed-bb11-463b-94a1-dc14225efe68" class="plotly-graph-div" style="height:100%; width:100%;"></div>
    <script type="text/javascript">

        // prepare data
        const x = [];
        const y = [];
        for (let i = -20; i < 20; i += 0.01) {
            x.push(i);
            y.push(Math.sin(i));
        }

        // plot to div
        Plotly.newPlot("823f03ed-bb11-463b-94a1-dc14225efe68",
            [
                {
                    "type": "scatter",
                    "x": x,
                    "y": y,
                    "xaxis": "x",
                    "yaxis": "y",
                    "fill": "tozeroy"
                },
                {
                    "type": "scattergl",
                    "x": x,
                    "y": y,
                    "xaxis": "x2",
                    "yaxis": "y2",
                    "fill": "tozeroy"
                }
            ],
            {
                "xaxis": {"anchor": "y", "domain": [0.0, 1.0]},
                "yaxis": {"anchor": "x", "domain": [0.575, 1.0]},
                "xaxis2": {"anchor": "y2", "domain": [0.0, 1.0]},
                "yaxis2": {"anchor": "x2", "domain": [0.0, 0.425]},
                "title": {"text": "Scatter vs. Scattergl, fill tozeroy"}
            }
        );
    </script>
</div>
</body>
</html>

output:
scatter-tozeroy-bug

related: https://github.com/plotly/plotly.py/issues/2971

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

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

はじめの一歩

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

調査の方向性

Plotly 2.6.3 CDN を使用して埋め込み HTML の再現例を実行し、fill: "tozeroy" を使った scatter トレースと scattergl トレースを比較します。scattergl の背後にある WebGL レンダリングパスを調査します。提供された正弦波データについて、塗りつぶされた領域が y=0 まで到達し、通常の scatter の結果と一致すれば完了です。

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

評価

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

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

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