-
-
Notifications
You must be signed in to change notification settings - Fork 842
feat(typing): Adds public altair.typing module
#3515
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
36 commits
Select commit
Hold shift + click to select a range
680b69e
feat(typing): Create `altair.typing`
dangotbanned 785f89c
chore: Add comment on `tooltip` annotation
dangotbanned 5423748
feat(typing): Add reference impl `EncodeKwds` from comment
dangotbanned da64738
feat(typing): Use `OneOrSeq[tps]` instead of `Union[*tps, list]` in `…
dangotbanned 5877b38
build: run `generate-schema-wrapper`
dangotbanned 4fe5f3a
wip: generate `typed_dict_args`
dangotbanned 0014cc8
refactor: Simplify `tools`, remove redundant code
dangotbanned 226038d
refactor: finish removing `altair_classes_prefix`
dangotbanned 77b101a
feat: `_create_encode_signature()` -> `EncodingArtifacts`
dangotbanned 675bc4e
build: run `generate-schema-wrapper`
dangotbanned 51a84a5
feat(typing): Provide a public export for `_EncodeKwds`
dangotbanned 2ef4b0f
Merge branch 'main' into public-typing
dangotbanned 4e0a098
Merge branch 'main' into pr/dangotbanned/3515
binste 2b9ad2c
Add docstring to _EncodeKwds
binste 79f317d
Rewrite EncodeArtifacts dataclass as a function
binste 1eb466d
Fix ruff issue due to old local ruff version
binste 0287eba
Change generate_encoding_artifacts to an iterator
binste bac1f67
docs: run `generate-schema-wrapper` with `indent_level=4`
dangotbanned 3419250
feat(typing): Move `ChartType`, `is_chart_type` to `alt.typing`
dangotbanned 5321b4b
Merge remote-tracking branch 'upstream/main' into public-typing
dangotbanned d16ec34
revert(ruff): Restore original ('RUF001`) line
dangotbanned e903528
Add type aliases for each channel
binste 6662fc9
Format
binste 28de27b
Use Union instead of | for compatibility with Py <3.10
binste b3fbe9c
Add channel type aliases to typing module. Add 'Type hints' section t…
binste 5ba8a8d
chore(ruff): Remove unused `F401` ignore
dangotbanned 49122b1
feat(typing): Move `Optional` export to `typing`
dangotbanned fe22c80
refactor: Move blank line append to `indent_docstring`
dangotbanned d3daf51
docs(typing): Remove empty type list from `EncodeKwds`
dangotbanned 914428a
refactor: Renaming, grouping, reducing repetition
dangotbanned 11c58c3
refactor: More tidying up, annotating, reformat
dangotbanned 067f455
docs: Reference aliases in `generate_encoding_artifacts`
dangotbanned 6fefd12
Use full type hints instead of type alias in signatures for typeddict…
binste 9299a81
Merge remote-tracking branch 'upstream/main' into public-typing
dangotbanned b6f84e4
Rename 'Type hints' to 'Typing'
binste d4313c0
Ruff fix
binste File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,96 @@ | ||
| """Public types to ease integrating with `altair`.""" | ||
|
|
||
| from __future__ import annotations | ||
|
|
||
| __all__ = [ | ||
| "ChannelAngle", | ||
| "ChannelColor", | ||
| "ChannelColumn", | ||
| "ChannelDescription", | ||
| "ChannelDetail", | ||
| "ChannelFacet", | ||
| "ChannelFill", | ||
| "ChannelFillOpacity", | ||
| "ChannelHref", | ||
| "ChannelKey", | ||
| "ChannelLatitude", | ||
| "ChannelLatitude2", | ||
| "ChannelLongitude", | ||
| "ChannelLongitude2", | ||
| "ChannelOpacity", | ||
| "ChannelOrder", | ||
| "ChannelRadius", | ||
| "ChannelRadius2", | ||
| "ChannelRow", | ||
| "ChannelShape", | ||
| "ChannelSize", | ||
| "ChannelStroke", | ||
| "ChannelStrokeDash", | ||
| "ChannelStrokeOpacity", | ||
| "ChannelStrokeWidth", | ||
| "ChannelText", | ||
| "ChannelTheta", | ||
| "ChannelTheta2", | ||
| "ChannelTooltip", | ||
| "ChannelUrl", | ||
| "ChannelX", | ||
| "ChannelX2", | ||
| "ChannelXError", | ||
| "ChannelXError2", | ||
| "ChannelXOffset", | ||
| "ChannelY", | ||
| "ChannelY2", | ||
| "ChannelYError", | ||
| "ChannelYError2", | ||
| "ChannelYOffset", | ||
| "ChartType", | ||
| "EncodeKwds", | ||
| "Optional", | ||
| "is_chart_type", | ||
| ] | ||
|
|
||
| from altair.utils.schemapi import Optional | ||
| from altair.vegalite.v5.api import ChartType, is_chart_type | ||
| from altair.vegalite.v5.schema.channels import ( | ||
| ChannelAngle, | ||
| ChannelColor, | ||
| ChannelColumn, | ||
| ChannelDescription, | ||
| ChannelDetail, | ||
| ChannelFacet, | ||
| ChannelFill, | ||
| ChannelFillOpacity, | ||
| ChannelHref, | ||
| ChannelKey, | ||
| ChannelLatitude, | ||
| ChannelLatitude2, | ||
| ChannelLongitude, | ||
| ChannelLongitude2, | ||
| ChannelOpacity, | ||
| ChannelOrder, | ||
| ChannelRadius, | ||
| ChannelRadius2, | ||
| ChannelRow, | ||
| ChannelShape, | ||
| ChannelSize, | ||
| ChannelStroke, | ||
| ChannelStrokeDash, | ||
| ChannelStrokeOpacity, | ||
| ChannelStrokeWidth, | ||
| ChannelText, | ||
| ChannelTheta, | ||
| ChannelTheta2, | ||
| ChannelTooltip, | ||
| ChannelUrl, | ||
| ChannelX, | ||
| ChannelX2, | ||
| ChannelXError, | ||
| ChannelXError2, | ||
| ChannelXOffset, | ||
| ChannelY, | ||
| ChannelY2, | ||
| ChannelYError, | ||
| ChannelYError2, | ||
| ChannelYOffset, | ||
| EncodeKwds, | ||
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.