{"id":25376492,"url":"https://github.com/streamlit/streamlit-bokeh","last_synced_at":"2025-10-30T07:31:23.008Z","repository":{"id":277458118,"uuid":"886943261","full_name":"streamlit/streamlit-bokeh","owner":"streamlit","description":"A custom component designed to follow the bokeh chart component","archived":false,"fork":false,"pushed_at":"2025-02-14T02:02:28.000Z","size":14041,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-02-14T03:19:02.105Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/streamlit.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-11-11T22:21:56.000Z","updated_at":"2025-02-12T22:19:19.000Z","dependencies_parsed_at":"2025-02-14T03:29:24.849Z","dependency_job_id":null,"html_url":"https://github.com/streamlit/streamlit-bokeh","commit_stats":null,"previous_names":["streamlit/streamlit-bokeh"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/streamlit%2Fstreamlit-bokeh","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/streamlit%2Fstreamlit-bokeh/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/streamlit%2Fstreamlit-bokeh/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/streamlit%2Fstreamlit-bokeh/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/streamlit","download_url":"https://codeload.github.com/streamlit/streamlit-bokeh/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238945663,"owners_count":19556699,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-02-15T04:28:04.735Z","updated_at":"2025-10-30T07:31:16.982Z","avatar_url":"https://github.com/streamlit.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# streamlit-bokeh\n\nA lightweight Python package that seamlessly integrates **Bokeh** plots into **Streamlit** apps, allowing for interactive, customizable, and responsive visualizations with minimal effort.\n\n## Filing Issues\n\nPlease file [bug reports](https://github.com/streamlit/streamlit/issues/new?template=bug_report.yml) and [enhancement requests](https://github.com/streamlit/streamlit/issues/new?template=feature_request.yml) through our main Streamlit repo.\n\n## 🚀 Features\n\n- Effortlessly embed Bokeh figures in Streamlit apps.\n- Responsive layout support with `use_container_width`.\n- Customizable themes (`streamlit` (which supports both light and dark mode) or [Bokeh Themes](https://docs.bokeh.org/en/latest/docs/reference/themes.html))\n\n---\n\n## 📦 Installation\n\n```bash\npip install streamlit-bokeh\n```\n\nEnsure you have **Streamlit** and **Bokeh** installed as well:\n\n```bash\npip install streamlit bokeh\n```\n\n---\n\n## 💡 Usage\n\nHere's how to integrate a simple Bokeh line plot into your Streamlit app:\n\n```python\nfrom bokeh.plotting import figure\nfrom streamlit_bokeh import streamlit_bokeh\n\n# Data\nx = [1, 2, 3, 4, 5]\ny = [6, 7, 2, 4, 5]\n\n# Create Bokeh figure\nYOUR_BOKEH_FIGURE = figure(title=\"Simple Line Example\",\n                           x_axis_label=\"x\",\n                           y_axis_label=\"y\")\nYOUR_BOKEH_FIGURE.line(x, y, legend_label=\"Trend\", line_width=2)\n\n# Render in Streamlit\nstreamlit_bokeh(YOUR_BOKEH_FIGURE, use_container_width=True, theme=\"streamlit\", key=\"my_unique_key\")\n```\n\n---\n\n## ⚙️ API Reference\n\n### `streamlit_bokeh(figure, use_container_width=False, theme='streamlit', key=None)`\n\n#### Parameters:\n\n- **`figure`** (_bokeh.plotting.figure_): The Bokeh figure object to display.\n- **`use_container_width`** (_bool_, optional): Whether to override the figure's native width with the width of the parent container. This is `True` by default.\n- **`theme`** (_str_, optional): The theme for the plot. This can be one of the following strings:\n  - `\"streamlit\"` (default): Matches Streamlit's current theme.\n  - A Bokeh theme name including:\n    - `\"caliber\"`\n    - `\"light_minimal\"`\n    - `\"dark_minimal\"`\n    - `\"contrast\"`\n- **`key`** (_str_, optional but recommended): An optional string to give this element a stable identity. If this is `None` (default), this element's identity will be determined based on the values of the other parameters.\n\n---\n\n## 🖼️ Example\n\n```bash\nstreamlit run app.py\n```\n\nWhere `app.py` contains:\n\n```python\nimport streamlit as st\nfrom bokeh.plotting import figure\nfrom streamlit_bokeh import streamlit_bokeh\n\n# Sample Data\nx = [1, 2, 3, 4, 5]\ny = [2, 4, 8, 16, 32]\n\n# Create Plot\np = figure(title=\"Exponential Growth\", x_axis_label=\"x\", y_axis_label=\"y\")\np.line(x, y, legend_label=\"Growth\", line_width=3, color=\"green\")\n\n# Display in Streamlit\nstreamlit_bokeh(p, use_container_width=True, key=\"plot1\")\n```\n\n---\n\n## 📚 Versioning\n\nWe designed the versioning scheme for this custom component to mirror the Bokeh version with the exception of the patch number. We reserve that so we can make bug fixes and new (mostly compatible) features.\n\nFor example, `3.6.x` will mirror a version of Bokeh that's `3.6.y`.\n\n---\n\n## 📝 Contributing\n\nFeel free to file issues in [our Streamlit Repository](https://github.com/streamlit/streamlit/issues/new/choose).\n\nContributions are welcome 🚀, however, please inform us before building a feature.\n\n---\n\n## 📄 License\n\nThis project is licensed under the [Apache 2.0](LICENSE).\n\n---\n\n## 🙋 FAQ\n\n**Q:** Can I embed multiple Bokeh plots on the same page?\n\n- **A:** Yes! Just make sure each plot has a unique `key`.\n\n**Q:** Does it support Bokeh widgets?\n\n- **A:** Currently, `streamlit-bokeh` focuses on plots. For widget interactivity, consider combining with native Streamlit widgets.\n\n**Q:** How do I adjust the plot size?\n\n- **A:** Use `use_container_width=True` for responsive sizing, or manually set `plot_width` and `plot_height` in your Bokeh figure.\n\n---\n\nHappy Streamlit-ing! 🎉\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstreamlit%2Fstreamlit-bokeh","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstreamlit%2Fstreamlit-bokeh","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstreamlit%2Fstreamlit-bokeh/lists"}