Skip to content
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

Add docs on displaying Altair charts in Streamlit apps #2762

Closed
wants to merge 1 commit into from

Conversation

snehankekre
Copy link

@snehankekre snehankekre commented Dec 19, 2022

Adds a new "Streamlit apps" section under Displaying Altair Charts -> Working in non-Notebook Environments.

Streamlit is a popular non-Notebook environment for Python web apps. It has a st.altair_chart command to display Altair charts within Streamlit apps.

With Streamlit's growing popularity among data enthusiasts as a UI layer on top of Python, and it's popularity among Altair users, I think it makes a good addition to the Altair docs. Full disclosure: I'm the maintainer of the Streamlit docs.

A similar case can be made about Gradio (another open-source Python library to build web apps), Dash, etc, but those can come as follow-up, tool-specific PRs like this one.

@joelostblom
Copy link
Contributor

For reference, there is some discussion of this in #2415. We likely don't want to add code examples of all the dashboarding libraries to the Altair docs since that would mean making all those packages dependencies of building the docs (or if we just include the code but don't execute, we would still need to keep it up to date and I am not sure that adds anything over what is already in the docs of the dashboarding library).

I do think it would be very helpful to mention which dashboarding packages work well with Altair and link to Altair examples in the dashboarding libraries documentation. That's what I suggested in the other PR where I also included a link to a short example I made comparing the most common ones https://stackoverflow.com/a/67428170/2166823. Thoughts on this approach?

@snehankekre
Copy link
Author

Thanks for that context, @joelostblom!

We likely don't want to add code examples of all the dashboarding libraries to the Altair docs since that would mean making all those packages dependencies of building the docs...

This PR only includes the code and doesn't execute, so Altair doesn't have to include streamlit in its dependencies.

(or if we just include the code but don't execute, we would still need to keep it up to date and I am not sure that adds anything over what is already in the docs of the dashboarding library).

I resonate with the issue of keeping the code up to date. I'd like to note though that Streamlit does not make breaking API changes, especially after our 1.0.0 milestone in 2021. The code snippet from this PR works regardless of the version of Streamlit used. As such, there would be no reason to update the code snippet.

The value I see this PR adding is in letting Altair users know that Streamlit is one such non-notebook environment where one can display Altair charts. Just as VSCode is included on the page out of all other IDEs, I assumed Streamlit could similarly be included.

I do think it would be very helpful to mention which dashboarding packages work well with Altair and link to Altair examples in the dashboarding libraries documentation.

That said, mentioning which dashboarding packages work well with Altair and linking to Altair examples in the dashboarding libraries documentation as part of #2415 would be a great common ground! That approach seems very reasonable. Streamlit could be in a section similar to Altair in R_.

Do you recommend I close this PR in favor of #2415, and submit a commit to that PR?

@joelostblom
Copy link
Contributor

I think we can keep this PR open for now and I will either close it when implementing the other one, but it is a good reminder to not forget to include the dashboard section there. I think we will probably just add them as a section, but maybe we will decide actually including an example and then I can merge this or ping you. Thanks again for contributing!

@binste
Copy link
Contributor

binste commented Dec 23, 2023

Closing this in favour of #3299

@binste binste closed this Dec 23, 2023
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.

3 participants