File size: 5,473 Bytes
5b8c5f4
6ae4ab5
5b8c5f4
 
 
 
 
 
 
 
 
 
d63d60b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
---
title: HF-Streamlit
emoji: πŸ‘€
colorFrom: gray
colorTo: blue
sdk: streamlit
sdk_version: 1.44.0
app_file: app.py
pinned: false
---

Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference

# HF-Streamlit

HF-Streamlit is an interactive data visualization dashboard built with Python and Streamlit that demonstrates the power of modern web-based analytics.

The app generates dynamic time series data and presents it through customizable charts with multiple color themes, real-time filtering capabilities, and exportable datasets.

Users can explore data through an intuitive interface featuring adjustable parameters (data size, chart height, color schemes), filter by categories and value ranges, view key performance metrics, and download filtered results as CSV files.

Perfect for showcasing data science capabilities or as a starting template for building more complex analytical dashboards, this app combines clean UI design with powerful data manipulation features in just a few lines of Python code.

## πŸ“Š Features

- **Interactive Data Visualization**: Dynamic time series charts with customizable color themes
- **Real-time Data Filtering**: Filter datasets by categories and value ranges
- **Data Export**: Download filtered data as CSV files
- **Metrics Dashboard**: Display key performance indicators and statistics
- **Responsive Design**: Clean, modern UI with custom CSS styling
- **Multi-tab Interface**: Organized content across Chart, Data Explorer, and About tabs

## πŸš€ Quick Start

### Prerequisites

- Python 3.9 or higher
- pip package manager

### Local Installation

1. Clone the repository:
```bash
git clone <repository-url>
cd HF-Streamlit
```

2. Install dependencies:
```bash
pip install -r requirements.txt
```

3. Run the application:
```bash
streamlit run app.py
```

The app will be available at `http://localhost:8501`

## 🐳 Docker Deployment

### Build and Run with Docker

1. Build the Docker image:
```bash
docker build -t hf-streamlit .
```

2. Run the container:
```bash
docker run -p 7860:7860 hf-streamlit
```

The app will be available at `http://localhost:7860`

### Docker Hub (if applicable)

```bash
docker pull <your-dockerhub-username>/hf-streamlit
docker run -p 7860:7860 <your-dockerhub-username>/hf-streamlit
```

## πŸ› οΈ Dependencies

- **streamlit**: Web app framework for Python
- **pandas**: Data manipulation and analysis
- **numpy**: Numerical computing
- **plotly**: Interactive plotting library

## πŸ“± Application Structure

```
HF-Streamlit/
β”œβ”€β”€ app.py              # Main Streamlit application
β”œβ”€β”€ requirements.txt    # Python dependencies
β”œβ”€β”€ Dockerfile         # Docker configuration
β”œβ”€β”€ README.md          # Project documentation
└── HF-docker2/        # Additional Docker configurations
```

## 🎯 Usage

### Dashboard Features

1. **Chart Tab**:
   - Adjust data points (10-500) using the sidebar slider
   - Customize chart height (300-800px)
   - Select from 5 color themes (blues, reds, greens, purples, oranges)
   - View real-time metrics and KPIs

2. **Data Explorer Tab**:
   - Filter data by categories (A, B, C, D)
   - Set value range filters using sliders
   - View filtered datasets in tabular format
   - Download filtered data as CSV

3. **About Tab**:
   - Learn about the application features
   - Understand Streamlit capabilities

### Customization

The app includes several customizable parameters:

- **Data Size**: Control the number of data points generated
- **Chart Height**: Adjust visualization height
- **Color Themes**: Choose from predefined color palettes
- **Filtering Options**: Multiple category and range filters

## πŸ”§ Configuration

### Environment Variables

The application uses default Streamlit configuration. You can customize it by creating a `.streamlit/config.toml` file:

```toml
[server]
port = 8501
address = "0.0.0.0"

[theme]
primaryColor = "#1E88E5"
backgroundColor = "#FFFFFF"
secondaryBackgroundColor = "#F0F2F6"
```

## πŸš€ Deployment Options

### Streamlit Cloud
1. Push your code to GitHub
2. Connect your repository to Streamlit Cloud
3. Deploy with one click

### Heroku
1. Add a `Procfile`:
```
web: streamlit run app.py --server.port=$PORT --server.address=0.0.0.0
```

### AWS/GCP/Azure
Use the provided Dockerfile for container-based deployments.

## 🀝 Contributing

1. Fork the repository
2. Create a feature branch (`git checkout -b feature/amazing-feature`)
3. Commit your changes (`git commit -m 'Add amazing feature'`)
4. Push to the branch (`git push origin feature/amazing-feature`)
5. Open a Pull Request

## πŸ“„ License

This project is open source and available under the [MIT License](LICENSE).

## πŸ†˜ Support

If you encounter any issues or have questions:

1. Check the [Streamlit documentation](https://docs.streamlit.io/)
2. Open an issue in this repository
3. Refer to the troubleshooting section below

## πŸ” Troubleshooting

### Common Issues

**Port already in use:**
```bash
streamlit run app.py --server.port=8502
```

**Module not found:**
```bash
pip install -r requirements.txt
```

**Docker build fails:**
Ensure Docker is running and you have sufficient disk space.

## πŸ“ˆ Performance

The application is optimized with:
- `@st.cache_data` decorator for data generation
- Efficient data filtering operations
- Responsive chart rendering with Plotly

---

Made with ❀️ using [Streamlit](https://streamlit.io/)