Spaces:
Sleeping
Sleeping
Upload folder using huggingface_hub
Browse files- README.md +1 -1
- bar_plot_demo.py +5 -5
- line_plot_demo.py +9 -5
- requirements.txt +2 -2
- scatter_plot_demo.py +5 -6
README.md
CHANGED
|
@@ -5,7 +5,7 @@ emoji: 🔥
|
|
| 5 |
colorFrom: indigo
|
| 6 |
colorTo: indigo
|
| 7 |
sdk: gradio
|
| 8 |
-
sdk_version:
|
| 9 |
app_file: run.py
|
| 10 |
pinned: false
|
| 11 |
hf_oauth: true
|
|
|
|
| 5 |
colorFrom: indigo
|
| 6 |
colorTo: indigo
|
| 7 |
sdk: gradio
|
| 8 |
+
sdk_version: 6.0.0
|
| 9 |
app_file: run.py
|
| 10 |
pinned: false
|
| 11 |
hf_oauth: true
|
bar_plot_demo.py
CHANGED
|
@@ -15,14 +15,14 @@ with gr.Blocks() as bar_plots:
|
|
| 15 |
temp_sensor_data,
|
| 16 |
x="time",
|
| 17 |
y="temperature",
|
| 18 |
-
|
| 19 |
)
|
| 20 |
temp_by_time_location = gr.BarPlot(
|
| 21 |
temp_sensor_data,
|
| 22 |
x="time",
|
| 23 |
y="temperature",
|
| 24 |
color="location",
|
| 25 |
-
|
| 26 |
)
|
| 27 |
|
| 28 |
time_graphs = [temp_by_time, temp_by_time_location]
|
|
@@ -51,7 +51,7 @@ with gr.Blocks() as bar_plots:
|
|
| 51 |
food_rating_data,
|
| 52 |
x="cuisine",
|
| 53 |
y="price",
|
| 54 |
-
|
| 55 |
)
|
| 56 |
with gr.Column(scale=0):
|
| 57 |
gr.Button("Sort $ > $$$").click(lambda: gr.BarPlot(sort="y"), None, price_by_cuisine)
|
|
@@ -64,7 +64,7 @@ with gr.Blocks() as bar_plots:
|
|
| 64 |
x="rating",
|
| 65 |
y="price",
|
| 66 |
x_bin=1,
|
| 67 |
-
|
| 68 |
)
|
| 69 |
price_by_rating_color = gr.BarPlot(
|
| 70 |
food_rating_data,
|
|
@@ -73,7 +73,7 @@ with gr.Blocks() as bar_plots:
|
|
| 73 |
color="cuisine",
|
| 74 |
x_bin=1,
|
| 75 |
color_map={"Italian": "red", "Mexican": "green", "Chinese": "blue"},
|
| 76 |
-
|
| 77 |
)
|
| 78 |
|
| 79 |
if __name__ == "__main__":
|
|
|
|
| 15 |
temp_sensor_data,
|
| 16 |
x="time",
|
| 17 |
y="temperature",
|
| 18 |
+
buttons=["export"],
|
| 19 |
)
|
| 20 |
temp_by_time_location = gr.BarPlot(
|
| 21 |
temp_sensor_data,
|
| 22 |
x="time",
|
| 23 |
y="temperature",
|
| 24 |
color="location",
|
| 25 |
+
buttons=["export"],
|
| 26 |
)
|
| 27 |
|
| 28 |
time_graphs = [temp_by_time, temp_by_time_location]
|
|
|
|
| 51 |
food_rating_data,
|
| 52 |
x="cuisine",
|
| 53 |
y="price",
|
| 54 |
+
buttons=["export"],
|
| 55 |
)
|
| 56 |
with gr.Column(scale=0):
|
| 57 |
gr.Button("Sort $ > $$$").click(lambda: gr.BarPlot(sort="y"), None, price_by_cuisine)
|
|
|
|
| 64 |
x="rating",
|
| 65 |
y="price",
|
| 66 |
x_bin=1,
|
| 67 |
+
buttons=["export"],
|
| 68 |
)
|
| 69 |
price_by_rating_color = gr.BarPlot(
|
| 70 |
food_rating_data,
|
|
|
|
| 73 |
color="cuisine",
|
| 74 |
x_bin=1,
|
| 75 |
color_map={"Italian": "red", "Mexican": "green", "Chinese": "blue"},
|
| 76 |
+
buttons=["export"],
|
| 77 |
)
|
| 78 |
|
| 79 |
if __name__ == "__main__":
|
line_plot_demo.py
CHANGED
|
@@ -14,14 +14,14 @@ with gr.Blocks() as line_plots:
|
|
| 14 |
temp_sensor_data,
|
| 15 |
x="time",
|
| 16 |
y="temperature",
|
| 17 |
-
|
| 18 |
)
|
| 19 |
temp_by_time_location = gr.LinePlot(
|
| 20 |
temp_sensor_data,
|
| 21 |
x="time",
|
| 22 |
y="temperature",
|
| 23 |
color="location",
|
| 24 |
-
|
| 25 |
)
|
| 26 |
|
| 27 |
time_graphs = [temp_by_time, temp_by_time_location]
|
|
@@ -49,22 +49,26 @@ with gr.Blocks() as line_plots:
|
|
| 49 |
food_rating_data,
|
| 50 |
x="cuisine",
|
| 51 |
y="price",
|
| 52 |
-
|
| 53 |
)
|
| 54 |
with gr.Row():
|
| 55 |
price_by_rating = gr.LinePlot(
|
| 56 |
food_rating_data,
|
|
|
|
| 57 |
x="rating",
|
| 58 |
y="price",
|
| 59 |
-
|
|
|
|
| 60 |
)
|
| 61 |
price_by_rating_color = gr.LinePlot(
|
| 62 |
food_rating_data,
|
|
|
|
| 63 |
x="rating",
|
| 64 |
y="price",
|
|
|
|
| 65 |
color="cuisine",
|
| 66 |
color_map={"Italian": "red", "Mexican": "green", "Chinese": "blue"},
|
| 67 |
-
|
| 68 |
)
|
| 69 |
|
| 70 |
if __name__ == "__main__":
|
|
|
|
| 14 |
temp_sensor_data,
|
| 15 |
x="time",
|
| 16 |
y="temperature",
|
| 17 |
+
buttons=["export"],
|
| 18 |
)
|
| 19 |
temp_by_time_location = gr.LinePlot(
|
| 20 |
temp_sensor_data,
|
| 21 |
x="time",
|
| 22 |
y="temperature",
|
| 23 |
color="location",
|
| 24 |
+
buttons=["export"],
|
| 25 |
)
|
| 26 |
|
| 27 |
time_graphs = [temp_by_time, temp_by_time_location]
|
|
|
|
| 49 |
food_rating_data,
|
| 50 |
x="cuisine",
|
| 51 |
y="price",
|
| 52 |
+
buttons=["export"],
|
| 53 |
)
|
| 54 |
with gr.Row():
|
| 55 |
price_by_rating = gr.LinePlot(
|
| 56 |
food_rating_data,
|
| 57 |
+
title="Price by Rating (for Ratings >2)",
|
| 58 |
x="rating",
|
| 59 |
y="price",
|
| 60 |
+
x_lim=[2, None],
|
| 61 |
+
buttons=["export"],
|
| 62 |
)
|
| 63 |
price_by_rating_color = gr.LinePlot(
|
| 64 |
food_rating_data,
|
| 65 |
+
title="Price by Rating (for Ratings <4)",
|
| 66 |
x="rating",
|
| 67 |
y="price",
|
| 68 |
+
x_lim=[None, 4],
|
| 69 |
color="cuisine",
|
| 70 |
color_map={"Italian": "red", "Mexican": "green", "Chinese": "blue"},
|
| 71 |
+
buttons=["export"],
|
| 72 |
)
|
| 73 |
|
| 74 |
if __name__ == "__main__":
|
requirements.txt
CHANGED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
gradio-client @ git+https://github.com/gradio-app/gradio@
|
| 2 |
-
https://gradio-pypi-previews.s3.amazonaws.com/
|
| 3 |
vega_datasets
|
| 4 |
pandas
|
|
|
|
| 1 |
+
gradio-client @ git+https://github.com/gradio-app/gradio@d007e6cf617baba5c62e49ec2b7ce278aa863a79#subdirectory=client/python
|
| 2 |
+
https://gradio-pypi-previews.s3.amazonaws.com/d007e6cf617baba5c62e49ec2b7ce278aa863a79/gradio-6.0.0-py3-none-any.whl
|
| 3 |
vega_datasets
|
| 4 |
pandas
|
scatter_plot_demo.py
CHANGED
|
@@ -14,14 +14,14 @@ with gr.Blocks() as scatter_plots:
|
|
| 14 |
temp_sensor_data,
|
| 15 |
x="time",
|
| 16 |
y="temperature",
|
| 17 |
-
|
| 18 |
)
|
| 19 |
temp_by_time_location = gr.ScatterPlot(
|
| 20 |
temp_sensor_data,
|
| 21 |
x="time",
|
| 22 |
y="temperature",
|
| 23 |
color="location",
|
| 24 |
-
|
| 25 |
)
|
| 26 |
|
| 27 |
time_graphs = [temp_by_time, temp_by_time_location]
|
|
@@ -49,7 +49,7 @@ with gr.Blocks() as scatter_plots:
|
|
| 49 |
food_rating_data,
|
| 50 |
x="cuisine",
|
| 51 |
y="price",
|
| 52 |
-
|
| 53 |
)
|
| 54 |
with gr.Row():
|
| 55 |
price_by_rating = gr.ScatterPlot(
|
|
@@ -57,15 +57,14 @@ with gr.Blocks() as scatter_plots:
|
|
| 57 |
x="rating",
|
| 58 |
y="price",
|
| 59 |
color="wait",
|
| 60 |
-
|
| 61 |
-
show_export_button=True,
|
| 62 |
)
|
| 63 |
price_by_rating_color = gr.ScatterPlot(
|
| 64 |
food_rating_data,
|
| 65 |
x="rating",
|
| 66 |
y="price",
|
| 67 |
color="cuisine",
|
| 68 |
-
|
| 69 |
)
|
| 70 |
|
| 71 |
if __name__ == "__main__":
|
|
|
|
| 14 |
temp_sensor_data,
|
| 15 |
x="time",
|
| 16 |
y="temperature",
|
| 17 |
+
buttons=["export"],
|
| 18 |
)
|
| 19 |
temp_by_time_location = gr.ScatterPlot(
|
| 20 |
temp_sensor_data,
|
| 21 |
x="time",
|
| 22 |
y="temperature",
|
| 23 |
color="location",
|
| 24 |
+
buttons=["export"],
|
| 25 |
)
|
| 26 |
|
| 27 |
time_graphs = [temp_by_time, temp_by_time_location]
|
|
|
|
| 49 |
food_rating_data,
|
| 50 |
x="cuisine",
|
| 51 |
y="price",
|
| 52 |
+
buttons=["export"],
|
| 53 |
)
|
| 54 |
with gr.Row():
|
| 55 |
price_by_rating = gr.ScatterPlot(
|
|
|
|
| 57 |
x="rating",
|
| 58 |
y="price",
|
| 59 |
color="wait",
|
| 60 |
+
buttons=["actions", "export"],
|
|
|
|
| 61 |
)
|
| 62 |
price_by_rating_color = gr.ScatterPlot(
|
| 63 |
food_rating_data,
|
| 64 |
x="rating",
|
| 65 |
y="price",
|
| 66 |
color="cuisine",
|
| 67 |
+
buttons=["export"],
|
| 68 |
)
|
| 69 |
|
| 70 |
if __name__ == "__main__":
|