-
Notifications
You must be signed in to change notification settings - Fork 4k
Plotly Customization #5681
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
willhuang1997
merged 26 commits into
streamlit:develop
from
willhuang1997:fix/plotly_customization_theme
Nov 16, 2022
Merged
Plotly Customization #5681
willhuang1997
merged 26 commits into
streamlit:develop
from
willhuang1997:fix/plotly_customization_theme
Nov 16, 2022
Conversation
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
willhuang1997
commented
Nov 10, 2022
… because distplots dont work with streamlit theme
Collaborator
lukasmasuch
reviewed
Nov 16, 2022
lukasmasuch
reviewed
Nov 16, 2022
lukasmasuch
reviewed
Nov 16, 2022
lukasmasuch
reviewed
Nov 16, 2022
lukasmasuch
reviewed
Nov 16, 2022
lukasmasuch
reviewed
Nov 16, 2022
lukasmasuch
reviewed
Nov 16, 2022
lukasmasuch
reviewed
Nov 16, 2022
lukasmasuch
reviewed
Nov 16, 2022
lukasmasuch
reviewed
Nov 16, 2022
lukasmasuch
reviewed
Nov 16, 2022
lukasmasuch
reviewed
Nov 16, 2022
lukasmasuch
reviewed
Nov 16, 2022
lukasmasuch
reviewed
Nov 16, 2022
lukasmasuch
reviewed
Nov 16, 2022
lukasmasuch
reviewed
Nov 16, 2022
lukasmasuch
reviewed
Nov 16, 2022
lukasmasuch
reviewed
Nov 16, 2022
lukasmasuch
reviewed
Nov 16, 2022
lukasmasuch
approved these changes
Nov 16, 2022
Collaborator
lukasmasuch
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall LGTM 👍 I added a couple of comments, but mostly small aspects :)
tconkling
added a commit
to tconkling/streamlit
that referenced
this pull request
Nov 18, 2022
* develop: (25 commits) Fix CORS acronym in docstring (streamlit#5727) Add integration tests for Snowpark (streamlit#5543) Release/1.15.0 (streamlit#5720) Add audit_frontend_dependencies script to CODEOWNERS (streamlit#5708) Add label_visibility option for st.checkbox (streamlit#5705) Display existing column names in st.map exception and make st.map work with capital letters (streamlit#5679) Plotly Customization (streamlit#5681) Turn off theme for now (streamlit#5701) Add all vendored code to `make notices` (streamlit#5704) Audit frontend licenses (streamlit#5664) Surround labels in quotes (streamlit#5703) Add info about voting on features (streamlit#5660) Update issue labeling scheme to adopt new standards (streamlit#5702) Cached media (audio+video) replay (streamlit#5695) Fix docstring line wrap (streamlit#5698) Use specialized assertion functions (streamlit#5680) Release 1.14.1 (streamlit#5693) Image replay in cached functions (streamlit#5675) Add docstrings for `experimental_allow_widgets` (streamlit#5670) Remove `st.write` from `CachedStFunctionWarning` (streamlit#5669) ...
kmcgrady
pushed a commit
that referenced
this pull request
Nov 30, 2022
Right now, the current implementation of st.plotly_chart(...,theme="streamlit") doesn't allow overriding properties within a graph; it will always applies streamlit theme to that graph. As a result, it's not very usable for a developer who wants to override the colors or other such specific things but also get Streamlit's layout changes. As a result, this PR is for that. This is mainly refactoring and allowing theme="streamlit" to be the default. We are using Plotly's inbuilt theme object and then passing that to the frontend because we want to swap the colors when the settings are swapped from light to dark and the backend has no knowledge of that. Demo app: https://streamlit-feature-demos-plotlystreamlitstreamlit-app-jjumlv.streamlit.app
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.

📚 Context
Right now, the current implementation of st.plotly_chart(...,theme="streamlit") doesn't allow overriding properties within a graph; it will always applies streamlit theme to that graph. As a result, it's not very usable for a developer who wants to override the colors or other such specific things but also get Streamlit's layout changes. As a result, this PR is for that.
This is mainly refactoring and allowing theme="streamlit" to be the default. We are using Plotly's inbuilt theme object and then passing that to the frontend because we want to swap the colors when the settings are swapped from light to dark and the backend has no knowledge of that.
Demo app: https://streamlit-feature-demos-plotlystreamlitstreamlit-app-jjumlv.streamlit.app
Please describe the project or issue background here
What kind of change does this PR introduce?
🧠 Description of Changes
Remove Most of the overriding frontend code
Add in Plotly's built in theme
Add in some hard coded temporary colors on the backend
Add frontend code to replace those hard coded temporary colors
Add bullet points summarizing your changes here
Revised:

Insert screenshot of your updated UI/code here
Current:

Insert screenshot of existing UI/code here
🧪 Testing Done
🌐 References
Does this depend on other work, documents, or tickets?
Contribution License Agreement
By submitting this pull request you agree that all contributions to this project are made under the Apache 2.0 license.