plotly / plotly/plotly.js

Plot does not appear in some cases if rangebreaks overlap

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

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

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

説明

I've created a Codepen for the issue: https://codepen.io/mofojed/pen/ZEgPJPN
In this case, the data spans a week, and range breaks are specified for a full holiday on Thursday, Nov 23, 2023 (Thanksgiving), and a half day on Friday, Nov 24, 2023. These specifications overlaps with other patterns for business days.
The chart does not appear. It looks like the rangebreaks that Plotly.js locates for the plot is:
Image
Where some of those overlap. It looks like that isn't taken into account when calculating the breaks length, so when there's overlap it will not generate a valid break length: https://github.com/plotly/plotly.js/blob/29ca37b4ba3ee28a3ffe3d48eab97a080d602af3/src/plots/cartesian/autorange.js#L199
I think it would make sense to check for overlapping here. I'll see if it's possible to adjust holidays to not overlap with any existing business periods as well...

#5783 is similar

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

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

はじめの一歩

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

調査の方向性

リンクされているCodePenの再現から始め、src/plots/cartesian/autorange.jsの199行目付近にあるrangebreakの処理を調査してください。同様のissue #5783と動作を比較し、holidayとbusiness-dayのrangebreakが重なった場合でも、無効なbreak lengthを生成せずにチャートがレンダリングされることを確認してください。

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

評価

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

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

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