From dd4826b95cfd1b39a41bd4b87404efd91372bbdf Mon Sep 17 00:00:00 2001 From: Bennett Payoyo Date: Fri, 25 Sep 2026 18:48:06 +0800 Subject: [PATCH 1/3] fix(types): make downloadImage opts optional Runtime downloadImage treats a missing opts as {}. toImage already marks opts optional; align downloadImage. Fixes #8072 --- draftlogs/XXXX_fix.md | 1 + src/types/core/api.d.ts | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 draftlogs/XXXX_fix.md diff --git a/draftlogs/XXXX_fix.md b/draftlogs/XXXX_fix.md new file mode 100644 index 00000000000..7ee1d214d72 --- /dev/null +++ b/draftlogs/XXXX_fix.md @@ -0,0 +1 @@ + - Make `opts` optional on `Plotly.downloadImage` so the type matches the runtime and `toImage` [[#XXXX](https://github.com/plotly/plotly.js/pull/XXXX)] diff --git a/src/types/core/api.d.ts b/src/types/core/api.d.ts index 4f9f73d2ffb..b0694bff5ba 100644 --- a/src/types/core/api.d.ts +++ b/src/types/core/api.d.ts @@ -284,7 +284,7 @@ export function prependTraces( /** Render the plot to a data URI or SVG string. */ export function toImage(root: RootOrData, opts?: ToImgopts): Promise; /** Render the plot and trigger a browser download. */ -export function downloadImage(root: RootOrData, opts: DownloadImgopts): Promise; +export function downloadImage(root: RootOrData, opts?: DownloadImgopts): Promise; /** * Reconcile the plot's current state with the supplied figure. Comparable From a8ff51297dde7c3bc86ef246d4e9a1683cd029e3 Mon Sep 17 00:00:00 2001 From: Bennett Payoyo Date: Fri, 25 Sep 2026 18:48:36 +0800 Subject: [PATCH 2/3] chore: renumber draftlog for #8080 --- draftlogs/8080_fix.md | 1 + draftlogs/XXXX_fix.md | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) create mode 100644 draftlogs/8080_fix.md delete mode 100644 draftlogs/XXXX_fix.md diff --git a/draftlogs/8080_fix.md b/draftlogs/8080_fix.md new file mode 100644 index 00000000000..76954a1d6f2 --- /dev/null +++ b/draftlogs/8080_fix.md @@ -0,0 +1 @@ + - Make `opts` optional on `Plotly.downloadImage` so the type matches the runtime and `toImage` [[#8080](https://github.com/plotly/plotly.js/pull/8080)] diff --git a/draftlogs/XXXX_fix.md b/draftlogs/XXXX_fix.md deleted file mode 100644 index 7ee1d214d72..00000000000 --- a/draftlogs/XXXX_fix.md +++ /dev/null @@ -1 +0,0 @@ - - Make `opts` optional on `Plotly.downloadImage` so the type matches the runtime and `toImage` [[#XXXX](https://github.com/plotly/plotly.js/pull/XXXX)] From df7de8baa34378bc33b7f6d57cc0f4bdf24be944 Mon Sep 17 00:00:00 2001 From: Bennett Payoyo Date: Sat, 26 Sep 2026 04:31:21 +0000 Subject: [PATCH 3/3] chore: remove draftlog per review Co-authored-by: Bennett Payoyo --- draftlogs/8080_fix.md | 1 - 1 file changed, 1 deletion(-) delete mode 100644 draftlogs/8080_fix.md diff --git a/draftlogs/8080_fix.md b/draftlogs/8080_fix.md deleted file mode 100644 index 76954a1d6f2..00000000000 --- a/draftlogs/8080_fix.md +++ /dev/null @@ -1 +0,0 @@ - - Make `opts` optional on `Plotly.downloadImage` so the type matches the runtime and `toImage` [[#8080](https://github.com/plotly/plotly.js/pull/8080)]