[BUG]: incorrect `downloadImage` type definition
まだ誰も着手していません。
評価
- 難易度
- 1/5
- 見積もり時間
- 1時間未満
- 初心者へのやさしさ
- 85/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- javascript, typescript
調査の方向性
この issue は、TypeScript 定義内の downloadImage の型定義を指しています。ソースファイル src/snapshot/download.js を確認し、opts がどのように処理されているか(nullish 値を許可する)を確認してください。次に、TypeScript 定義を更新して、toImage の動作と一致するように opts パラメータをオプションにします。簡単な TypeScript コンパイルで変更をテストして確認してください。
索引モデルが issue の本文から書いたものです。
説明
Description
I'm happy to see type definitions about image export features were improved in recent PR #8066. Let me point out a minor type problem that (I think) remains after the PR.
The second parameter opts in downloadImage() function is required but I think it should be optional. That in toImage() is optional.
export function downloadImage(root: RootOrData, opts: DownloadImgopts): Promise<string>;
Because of this, a TS compiler complains about Plotly.downloadImage('graphDiv'), while it works as JS code. It seems the source code (src/snapshot/download.js) allows opts to be nullish.
There is a workaround such as calling Plotly.downloadImage('graphDiv', {}), and so this problem is not serious. I would be happy if it were fixed in future.
- 主要言語
- JavaScript
- スター
- 18.3k
- フォーク
- 2k
- 平均マージ
- 2日 10時間
- マージ済み PR(30日)
- 30
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
plotly/plotly.js のほかの issue
-
chore P3 plotly-internal size: 3 task
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
-
chore P1 plotly-internal size: 1 task
難易度 1/5 1時間未満 初心者へのやさしさ 82/100
-
chore P3 plotly-internal size: 1 task
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
-
bug infrastructure P2
難易度 1/5 1時間未満 初心者へのやさしさ 65/100
plotly/plotly.js の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
mksglu/context-mode#1200 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
neondatabase/website#5944 ·
-
module: core
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
bigbluebutton/bigbluebutton#25849 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
jaegertracing/jaeger-ui#4506 ·