-
-
Notifications
You must be signed in to change notification settings - Fork 9
Add a new template parameter to ridgeplot() #389
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
6 commits
Select commit
Hold shift + click to select a range
04f93a4
Add a new template parameter to ridgeplot()
tpvasconcelos 990917f
Add changelog entry for the new template parameter
tpvasconcelos c1e9759
Say 'Template instance' instead of 'object' in docstrings, matching P…
tpvasconcelos 31b9e48
Add a section on theming with Plotly templates to the getting started…
tpvasconcelos 9266019
Reuse the basic example in basic_dark to keep them in sync
tpvasconcelos 5bdfdab
Merge branch 'main' into template-param
tpvasconcelos 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
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,18 @@ | ||
| from __future__ import annotations | ||
|
|
||
| from typing import TYPE_CHECKING | ||
|
|
||
| from ridgeplot_examples._basic import main as basic | ||
|
|
||
| if TYPE_CHECKING: | ||
| import plotly.graph_objects as go | ||
|
|
||
|
|
||
| def main() -> go.Figure: | ||
| fig = basic(template="plotly_dark") | ||
| return fig | ||
|
|
||
|
|
||
| if __name__ == "__main__": | ||
| fig = main() | ||
| fig.show() |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| """Plotly figure template utilities.""" | ||
|
|
||
| from __future__ import annotations | ||
|
|
||
| from typing import TYPE_CHECKING, cast | ||
|
|
||
| from _plotly_utils.basevalidators import BaseTemplateValidator | ||
|
|
||
| if TYPE_CHECKING: | ||
| import plotly.graph_objects as go | ||
|
|
||
| from ridgeplot._types import PlotlyTemplate | ||
|
|
||
|
|
||
| def validate_coerce_template(template: PlotlyTemplate | None) -> go.layout.Template | None: | ||
| """Convert mixed template representations into a | ||
| :class:`plotly.graph_objects.layout.Template | ||
| <plotly.graph_objs.layout.Template>` instance. | ||
|
|
||
| ``None`` is passed through as-is, meaning that no template has been | ||
| specified and that Plotly's current default template should be used. | ||
| """ | ||
| if template is None: | ||
| return None | ||
| validator = BaseTemplateValidator( | ||
| plotly_name="template", | ||
| parent_name="layout", | ||
| data_class_str="Template", | ||
| data_docs="", | ||
| ) | ||
| return cast("go.layout.Template", validator.validate_coerce(template)) |
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
Large diffs are not rendered by default.
Oops, something went wrong.
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.
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.