Plotting `f64::NAN` drops nearby points and disconnects line

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

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

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
rust

調査の方向性

まず、main への Cargo.toml パッチを適用したリンク先の最小例を実行し、次に PlotPoints、Plot、Line を使った eframe::update スニペットから再現します。f64::NAN を処理するプロット処理の経路を調査し、NaN の点とその隣接する線に対する意図された動作を明確にしてください。この issue では現在、完了時の状態がどのようになるべきかは定義されていません。

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

説明

bug

Describe the bug

Adding NaN values to a PlotPoints disconnects the line plot, and drops nearby points (not sure of the exact behavior of which points are dropped).

I didn't find any description of what the expected behaviour is when you attempt to plot NaN.

To Reproduce
Steps to reproduce the behavior:

  1. Clone the minimal example: https://github.com/CramBL/egui-nan-example
  2. cargo run

Or create an eframe project and copy this into eframe::update

egui::CentralPanel::default().show(ctx, |ui| {
    let values = [1.0, 2.0, 3.0, f64::NAN, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0];

    let points: PlotPoints = values
        .iter()
        .enumerate()
        .map(|(i, &y)| [i as f64, y])
        .collect();

    Plot::new("line_plot").show(ui, |plot_ui| {
        plot_ui.line(Line::new("series", points));
    });
});

Expected behavior

Not sure, maybe to drop the NaN point and still connect the other lines?

Screenshots

Image
主要言語
Rust
スター
494
フォーク
110
PR マージ指標
30日以内にマージされた PR はありません

環境構築

はじめの一歩

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

emilk/egui_plot のほかの issue

emilk/egui_plot の issue をすべて見る

似ている issue

Rust の issue をもっと見る

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

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