plotly / plotly/plotly.js

change auto conversion of text to number on x axis (current is misleading)

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

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

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

説明

I found this somewhat related issue (it's about dates).

When I pass the following data with 5 rows. I get a visualization with 2 bars.

{
  "data": [
    {
      "alignmentgroup": "True",
      "hovertemplate": "Line Code=%{x}<br>Score=%{y}<extra></extra>",
      "legendgroup": "",
      "marker": {
        "color": "#eb7a2e",
        "pattern": {
          "shape": ""
        }
      },
      "name": "",
      "offsetgroup": "",
      "orientation": "v",
      "showlegend": false,
      "textposition": "auto",
      "x": [
        "1710",
        "700",
        "N1700",
        "N1710",
        "N700"
      ],
      "xaxis": "x",
      "y": [
        -77.308,
        8.893,
        -24.069,
        -60.96,
        -9.385
      ],
      "yaxis": "y",
      "type": "bar"
    }
  ],
  "layout": {
    "barmode": "relative",
    "legend": {
      "tracegroupgap": 0
    },
    "title": {
      "text": "Scores per Line"
    },
    "xaxis": {
      "anchor": "y",
      "domain": [
        0,
        1
      ],
      "title": {
        "text": "Line Code"
      }
    },
    "yaxis": {
      "anchor": "x",
      "domain": [
        0,
        1
      ],
      "rangemode": "tozero",
      "title": {
        "text": "Score"
      }
    },
    "template": {
      "layout": {
        "colorway": [
          "#eb7a2e",
          "#f7b62a",
          "#1fa5de",
          "#57bebe",
          "#7f7977",
          "#b1a898",
          "#5e4a86",
          "#8e80b9",
          "#4a4c51",
          "#8a8b94"
        ],
        "font": {
          "color": "#212121",
          "family": "Inter, sans-serif",
          "size": 12
        },
        "hovermode": "closest",
        "margin": {
          "b": 70,
          "l": 70,
          "r": 70,
          "t": 80
        },
        "paper_bgcolor": "#FFFFFF",
        "plot_bgcolor": "#FFFFFF",
        "title": {
          "font": {
            "size": 18
          },
          "x": 0.02,
          "xanchor": "left",
          "y": 0.93
        },
        "xaxis": {
          "automargin": true,
          "gridcolor": "#f2f2f2",
          "linecolor": "#d9d9d9",
          "showgrid": false,
          "zeroline": true,
          "zerolinecolor": "#d9d9d9"
        },
        "yaxis": {
          "automargin": true,
          "gridcolor": "#f2f2f2",
          "linecolor": "#d9d9d9",
          "showgrid": true,
          "zeroline": true,
          "zerolinecolor": "#d9d9d9"
        },
        "yaxis2": {
          "showgrid": false
        }
      }
    }
  }
}

grafik

I understand that I can pass an option for the category, but I would rather:

  • have it fail, because it can't display all data
  • not do the conversion by default

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

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

はじめの一歩

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

調査の方向性

まず、提供された bar-chart の例を再現し、数値に見える strings と数値ではない strings が混在している場合に x-axis の型がどのように推論されるかを確認してください。5 つの異なる x 値が自動的なテキストから数値への変換によって暗黙的に統合されず、明確に失敗するか、明示的な category オプションを必要とせずにデータが保持されれば、完了とします。

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

評価

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

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

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