plotly / plotly/plotly.js

[BUG]: imperfect type definitions around graph export features

Open Beginner friendly
#8,057 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
JavaScript
Stars
18.3k
Forks
2k
Avg merge
2d 12h
Merged PRs (30d)
28

Description

Description

I found the following imperfect definitions in type definitions Plotly introduced recently (v4.0.0?), around toImage(), downloadImage() and config.toImageButtonOptions. This will hinder using these functions/option for TypeScript users (like me).

  • Lack of full-json export format. A graph can be exported as JSON probably since v1.53.0 (see CHANGELOG.md or #4593) but this feature was not documented until very recently (plotly/graphing-library-docs#471).
  • Lack of imageDataOnly option. This option is also very recently documented here.
  • Some properties being set as required. The properties of the second parameter in toImage() and downloadImage() should be all optional. Currently some are required.

Can I send a PR for these? The PR won't include changes on executable code in JS; it will only modify *.d.ts files and maybe docstring parts in JS files.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Locate the *.d.ts definitions for toImage(), downloadImage(), and config.toImageButtonOptions, then compare them with the documented export features and CHANGELOG.md. Confirm that full-json and imageDataOnly are represented and that the second-parameter properties are optional; the type-definition changes should be covered by the repository's existing checks.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, typescript
Domain
data-visualization
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
72/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.