plotly / plotly/plotly.js

Colored and Styled Error Bars described incorrectly in docs

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

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

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

説明

This error was reported by Martin Shell, the VP customer success at Taipy.

The error is located in Colored and Styled Error Bars.
In the example, the js code begins as follow:

function linspace(a,b,n) {
  return d3.range(n).map(function(i){return a+i*(b-a)/(n-1);});
}
x_theo = linspace(-4, 4, 100)
sincx = Math.sin(x_theo) / x_theo

(looks like someone translated this FROM python -- ironic as I am translating it TO python).
In any case, in the last line, x_theo is a js array and I think the coder was trying to get an array out, but this code results in sincx being set to NaN. Plotly js basically ignores sincx and the resulting chart is clearly not what is intended. You need to do something like:

sincx = x._theo.map(x=>Math.sin(x)/x)

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

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

はじめの一歩

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

調査の方向性

“Colored and Styled Error Bars”というタイトルのJavaScriptドキュメントセクションを開き、linspaceで始まりsincxの計算で終わる例を確認してください。例が意図したエラーバーチャートを生成するように配列の計算を修正し、レンダリングされた例にNaN値が含まれなくなったことを確認してください。

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

評価

技術スタック
d3, javascript
領域
data-visualization, documentation
issue の種類
ドキュメント
難易度
1/5
見積もり時間
1時間未満
活発さ
停滞
明瞭さ
明確に書かれている
初心者へのやさしさ
55/100

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

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