Skip to content

Add type stubs for plotly.express#5507

Closed
mosh3eb wants to merge 2 commits intoplotly:mainfrom
mosh3eb:feature/plotly-express-type-stubs
Closed

Add type stubs for plotly.express#5507
mosh3eb wants to merge 2 commits intoplotly:mainfrom
mosh3eb:feature/plotly-express-type-stubs

Conversation

@mosh3eb
Copy link

@mosh3eb mosh3eb commented Feb 14, 2026

Created .pyi stub file with type annotations for the most commonly used plotly.express functions. This enables proper IDE autocomplete and static type checking with mypy/pyright.

Covered functions include scatter, line, bar, histogram, box, violin, area, pie, and 3D/geographic variants. All parameters are properly typed with sensible unions and literals for better developer experience.

Addresses #1103

Code PR

  • I have read through the contributing notes and understand the structure of the package. In particular, if my PR modifies code of plotly.graph_objects, my modifications concern the code generator and not the generated files.
  • I have added tests or modified existing tests.
  • For a new feature, I have added documentation examples (please see the doc checklist as well).
  • I have added a CHANGELOG entry if changing anything substantial.
  • For a new feature or a change in behavior, I have updated the relevant docstrings in the code.

Created comprehensive .pyi stub file with type annotations for the
most commonly used plotly.express functions. This enables proper IDE
autocomplete and static type checking with mypy/pyright.

Covered functions include scatter, line, bar, histogram, box, violin,
area, pie, and 3D/geographic variants. All parameters are properly
typed with sensible unions and literals for better developer experience.

Addresses plotly#1103
- Remove unused numpy import
- Apply ruff formatting to stub file and test script
@camdecoster
Copy link
Contributor

Thanks for the PR! We'd prefer to add type information inline rather than using a .pyi file. If you're interested in providing the types in that way, take a look here. For now, I'm going to close this PR but feel free to open another one following the suggestions at that link.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments