[Bug] Line chart tiny segments skipped, becoming a slope

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

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

評価

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

調査の方向性

src/chart/line/poly.ts の83行目付近にある小さなセグメントの処理から始め、リンクされた CodeSandbox で step:'end' を使用して問題を再現してください。報告されたデータポイントに対して修正を検証し、datapoint2 から datapoint3 へのセグメントが傾斜ではなく垂直に描画されることを確認してください。

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

説明

bug en pending
Version

5.6.0

Link to Minimal Reproduction

https://codesandbox.io/p/sandbox/pdh82y?file=%2Findex.js

Steps to Reproduce
  1. change the time on datapoint1 from 08:59:30 to 08:55:30
  2. change the time on datapoint1 back
  3. repeat
Current Behavior

When we have the following data:

  • datapoint1=[08:59:30, 1]
  • datapoint2=[09:00:00, 1]
  • datapoint3=[09:00:00, 0]

With the following line chart setting:

  • type:'line'
  • step:'end'

The line chart ignores datapoint2 and draws a line from datapoint1 to datapoint3 which becomes a slope.

Expected Behavior

The line chart should draw the line vertically (not as a slope) from datapoint2 to datapoint3 to represent what the data is actually doing.

Environment
- OS: Windows 11
- Browser: Microsoft Edge Version 148.0.3967.54 (Official build) (64-bit)
- Framework:
Any additional comments?

The line of code that appears to be causing this behaviour is "/src/chart/line/poly.ts" at line 83. (The section for "Ignore Tiny Segment.")

            // Ignore tiny segment.
            if ((dx * dx + dy * dy) < 0.5) {
                idx += dir;
                continue;
            }
主要言語
TypeScript
スター
67.7k
フォーク
19.9k
PR マージ指標
30日以内にマージされた PR はありません

環境構築

はじめの一歩

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

apache/echarts のほかの issue

apache/echarts の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

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

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