• Что бы вступить в ряды "Принятый кодер" Вам нужно:
    Написать 10 полезных сообщений или тем и Получить 10 симпатий.
    Для того кто не хочет терять время,может пожертвовать средства для поддержки сервеса, и вступить в ряды VIP на месяц, дополнительная информация в лс.

  • Пользаватели которые будут спамить, уходят в бан без предупреждения. Спам сообщения определяется администрацией и модератором.

  • Гость, Что бы Вы хотели увидеть на нашем Форуме? Изложить свои идеи и пожелания по улучшению форума Вы можете поделиться с нами здесь. ----> Перейдите сюда
  • Все пользователи не прошедшие проверку электронной почты будут заблокированы. Все вопросы с разблокировкой обращайтесь по адресу электронной почте : info@guardianelinks.com . Не пришло сообщение о проверке или о сбросе также сообщите нам.

Building Interactive Dashboards with Streamlit, Dash, and Bokeh: From Code to Cloud

Sascha Оффлайн

Sascha

Заместитель Администратора
Команда форума
Администратор
Регистрация
9 Май 2015
Сообщения
1,480
Баллы
155


Data visualization plays a central role in computer science and data-driven decision making. While libraries like Matplotlib and Seaborn are often the first tools learned, more interactive frameworks exist to build dashboards and reports for real-world applications. Among them, Streamlit, Dash, and Bokeh stand out because they allow developers to turn Python code into full web applications without requiring advanced web development skills.

1. Streamlit


Streamlit is one of the simplest ways to build interactive dashboards. It allows developers to use pure Python code and automatically creates a responsive web interface. You can add widgets (sliders, checkboxes, text inputs) with minimal syntax, making it an ideal tool for rapid prototyping.

2. Dash


Dash, developed by Plotly, is more powerful and customizable. It combines Flask (for backend), React.js (for frontend), and Plotly (for charts). Dash applications are more structured and allow you to build enterprise-level dashboards with callbacks and layouts.

3. Bokeh


Bokeh is a library designed for creating interactive and scalable visualizations in the browser. Unlike Streamlit or Dash, Bokeh focuses mainly on visualizations, but it can also serve as a backend for dashboards.

Example: Building and Deploying a Dashboard with Streamlit


Below is a small example using Streamlit to visualize a dataset of random values. We’ll then deploy it to Streamlit Cloud (free tier for students).

Code (app.py)


import streamlit as st
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt

# Title
st.title("📊 Interactive Data Dashboard Example")

# Sidebar options
st.sidebar.header("Controls")
n_points = st.sidebar.slider("Number of Data Points", 10, 500, 100)
chart_type = st.sidebar.selectbox("Chart Type", ["Line", "Scatter", "Histogram"])

# Generate random data
data = pd.DataFrame({
"x": np.arange(n_points),
"y": np.random.randn(n_points).cumsum()
})

# Show dataframe
st.write("### Randomly Generated Data", data.head())

# Visualization
st.write("### Visualization")
if chart_type == "Line":
st.line_chart(data.set_index("x"))
elif chart_type == "Scatter":
st.scatter_chart(data.set_index("x"))
elif chart_type == "Histogram":
fig, ax = plt.subplots()
ax.hist(data["y"], bins=20, color="skyblue", edgecolor="black")
st.pyplot(fig)



Running Locally


pip install streamlit pandas numpy matplotlib
streamlit run app.py




Visit:

Пожалуйста Авторизируйтесь или Зарегистрируйтесь для просмотра скрытого текста.



Deployment to the Cloud (Streamlit Cloud Example)

  1. Push your code to GitHub (repository with app.py and requirements.txt).

  • Example requirements.txt:

    streamlit
    pandas
    numpy
    matplotlib

  1. Go to

    Пожалуйста Авторизируйтесь или Зарегистрируйтесь для просмотра скрытого текста.

    and log in with GitHub.


  2. Click “New App”, select your repository and branch, and choose app.py as the entry file.


  3. Deploy — in a few seconds, your app will be live with a public URL like:


Пожалуйста Авторизируйтесь или Зарегистрируйтесь для просмотра скрытого текста.





Why Use These Tools?

  • Streamlit → quick, simple dashboards (ideal for students, prototypes).
  • Dash → structured, production-ready dashboards (enterprise use).
  • Bokeh → powerful interactive plots with flexibility.
Conclusion


Streamlit, Dash, and Bokeh expand the possibilities of data visualization beyond static plots. They enable computer science students and professionals to share insights interactively and even deploy them as web apps. Deploying to cloud platforms like Streamlit Cloud, Heroku, or AWS makes these tools accessible from anywhere, turning local experiments into shareable projects.



Источник:

Пожалуйста Авторизируйтесь или Зарегистрируйтесь для просмотра скрытого текста.

 
Вверх Снизу