Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

[BUG]: incorrect `downloadImage` type definition

オープン 初心者向け
#8,072 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

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

評価

難易度
1/5
見積もり時間
1時間未満
初心者へのやさしさ
85/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
javascript, typescript
領域
documentation

調査の方向性

この issue は、TypeScript 定義内の downloadImage の型定義を指しています。ソースファイル src/snapshot/download.js を確認し、opts がどのように処理されているか(nullish 値を許可する)を確認してください。次に、TypeScript 定義を更新して、toImage の動作と一致するように opts パラメータをオプションにします。簡単な TypeScript コンパイルで変更をテストして確認してください。

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

説明

bug
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

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

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

はじめの一歩

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

plotly/plotly.js のほかの issue

plotly/plotly.js の issue をすべて見る

似ている issue

JavaScript の issue をもっと見る

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

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