plotly / plotly/plotly.js

Duplicate Keys on X-Axis with Date Format and formatTick

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

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

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

説明

When plotting a chart using Plotly with a small dataset and specifying the x-axis type as date, along with a custom formatTick function, the x-axis displays duplicate keys. This issue creates a confusing and cluttered appearance, as shown in the example provided below.

Steps to Reproduce:

Create a chart with the x-axis type set to date.
Use a small dataset with date values.
Specify a custom formatTick function for the x-axis.
Example:

You can see the issue in the following CodePen example:
CodePen Example

Expected Behavior:

The x-axis should display unique date values without any duplicates, even for small datasets, ensuring a clean and accurate representation of the data.

Actual Behavior:

The x-axis shows duplicate date values, leading to a misleading visualization.

Environment:

Plotly.js version: plotly.js-dist-min@2.32.0
Browser: chrome
Operating System: windows

This issue significantly impacts the readability of charts, especially when dealing with smaller datasets where clear and distinct x-axis labels are crucial.

Additional information:
by specifying type as category or explicitly specilfying tickvals and ticktext doesn't suit well for large dataset.
Screenshot

Screenshot 2024-07-02 210025

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

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

はじめの一歩

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

調査の方向性

まず、リンクされている CodePen の例を Plotly.js 2.32.0 で実行し、カスタム formatTick 関数の有無による date-axis のラベルを比較します。ラベルの重複の原因となっている date-axis の tick 生成とフォーマット処理を追跡します。小規模な日付データセットで、category axes や明示的な tickvals と ticktext を必要とせずに、x-axis に一意で読みやすいラベルが表示されれば完了です。

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

評価

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

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

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