freddyaboulton HF Staff commited on
Commit
cc7785d
·
verified ·
1 Parent(s): 67a80c8

Upload folder using huggingface_hub

Browse files
bar_plot_demo.py CHANGED
@@ -15,12 +15,14 @@ with gr.Blocks() as bar_plots:
15
  temp_sensor_data,
16
  x="time",
17
  y="temperature",
 
18
  )
19
  temp_by_time_location = gr.BarPlot(
20
  temp_sensor_data,
21
  x="time",
22
  y="temperature",
23
  color="location",
 
24
  )
25
 
26
  time_graphs = [temp_by_time, temp_by_time_location]
@@ -49,6 +51,7 @@ with gr.Blocks() as bar_plots:
49
  food_rating_data,
50
  x="cuisine",
51
  y="price",
 
52
  )
53
  with gr.Column(scale=0):
54
  gr.Button("Sort $ > $$$").click(lambda: gr.BarPlot(sort="y"), None, price_by_cuisine)
@@ -61,6 +64,7 @@ with gr.Blocks() as bar_plots:
61
  x="rating",
62
  y="price",
63
  x_bin=1,
 
64
  )
65
  price_by_rating_color = gr.BarPlot(
66
  food_rating_data,
@@ -69,6 +73,7 @@ with gr.Blocks() as bar_plots:
69
  color="cuisine",
70
  x_bin=1,
71
  color_map={"Italian": "red", "Mexican": "green", "Chinese": "blue"},
 
72
  )
73
 
74
  if __name__ == "__main__":
 
15
  temp_sensor_data,
16
  x="time",
17
  y="temperature",
18
+ show_export_button=True,
19
  )
20
  temp_by_time_location = gr.BarPlot(
21
  temp_sensor_data,
22
  x="time",
23
  y="temperature",
24
  color="location",
25
+ show_export_button=True,
26
  )
27
 
28
  time_graphs = [temp_by_time, temp_by_time_location]
 
51
  food_rating_data,
52
  x="cuisine",
53
  y="price",
54
+ show_export_button=True,
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
+ show_export_button=True,
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
+ show_export_button=True,
77
  )
78
 
79
  if __name__ == "__main__":
line_plot_demo.py CHANGED
@@ -14,12 +14,14 @@ with gr.Blocks() as line_plots:
14
  temp_sensor_data,
15
  x="time",
16
  y="temperature",
 
17
  )
18
  temp_by_time_location = gr.LinePlot(
19
  temp_sensor_data,
20
  x="time",
21
  y="temperature",
22
  color="location",
 
23
  )
24
 
25
  time_graphs = [temp_by_time, temp_by_time_location]
@@ -47,12 +49,14 @@ with gr.Blocks() as line_plots:
47
  food_rating_data,
48
  x="cuisine",
49
  y="price",
 
50
  )
51
  with gr.Row():
52
  price_by_rating = gr.LinePlot(
53
  food_rating_data,
54
  x="rating",
55
  y="price",
 
56
  )
57
  price_by_rating_color = gr.LinePlot(
58
  food_rating_data,
@@ -60,6 +64,7 @@ with gr.Blocks() as line_plots:
60
  y="price",
61
  color="cuisine",
62
  color_map={"Italian": "red", "Mexican": "green", "Chinese": "blue"},
 
63
  )
64
 
65
  if __name__ == "__main__":
 
14
  temp_sensor_data,
15
  x="time",
16
  y="temperature",
17
+ show_export_button=True,
18
  )
19
  temp_by_time_location = gr.LinePlot(
20
  temp_sensor_data,
21
  x="time",
22
  y="temperature",
23
  color="location",
24
+ show_export_button=True,
25
  )
26
 
27
  time_graphs = [temp_by_time, temp_by_time_location]
 
49
  food_rating_data,
50
  x="cuisine",
51
  y="price",
52
+ show_export_button=True,
53
  )
54
  with gr.Row():
55
  price_by_rating = gr.LinePlot(
56
  food_rating_data,
57
  x="rating",
58
  y="price",
59
+ show_export_button=True,
60
  )
61
  price_by_rating_color = gr.LinePlot(
62
  food_rating_data,
 
64
  y="price",
65
  color="cuisine",
66
  color_map={"Italian": "red", "Mexican": "green", "Chinese": "blue"},
67
+ show_export_button=True,
68
  )
69
 
70
  if __name__ == "__main__":
requirements.txt CHANGED
@@ -1,4 +1,4 @@
1
- gradio-client @ git+https://github.com/gradio-app/gradio@327015b7dca90f17f174baee9f3c966a48fe4775#subdirectory=client/python
2
- https://gradio-pypi-previews.s3.amazonaws.com/327015b7dca90f17f174baee9f3c966a48fe4775/gradio-5.47.2-py3-none-any.whl
3
  vega_datasets
4
  pandas
 
1
+ gradio-client @ git+https://github.com/gradio-app/gradio@070463cf85f75f1a327a2c0daa6eea81467ad749#subdirectory=client/python
2
+ https://gradio-pypi-previews.s3.amazonaws.com/070463cf85f75f1a327a2c0daa6eea81467ad749/gradio-5.47.2-py3-none-any.whl
3
  vega_datasets
4
  pandas
scatter_plot_demo.py CHANGED
@@ -14,12 +14,14 @@ with gr.Blocks() as scatter_plots:
14
  temp_sensor_data,
15
  x="time",
16
  y="temperature",
 
17
  )
18
  temp_by_time_location = gr.ScatterPlot(
19
  temp_sensor_data,
20
  x="time",
21
  y="temperature",
22
  color="location",
 
23
  )
24
 
25
  time_graphs = [temp_by_time, temp_by_time_location]
@@ -47,6 +49,7 @@ with gr.Blocks() as scatter_plots:
47
  food_rating_data,
48
  x="cuisine",
49
  y="price",
 
50
  )
51
  with gr.Row():
52
  price_by_rating = gr.ScatterPlot(
@@ -55,13 +58,14 @@ with gr.Blocks() as scatter_plots:
55
  y="price",
56
  color="wait",
57
  show_actions_button=True,
 
58
  )
59
  price_by_rating_color = gr.ScatterPlot(
60
  food_rating_data,
61
  x="rating",
62
  y="price",
63
  color="cuisine",
64
- # color_map={"Italian": "red", "Mexican": "green", "Chinese": "blue"},
65
  )
66
 
67
  if __name__ == "__main__":
 
14
  temp_sensor_data,
15
  x="time",
16
  y="temperature",
17
+ show_export_button=True,
18
  )
19
  temp_by_time_location = gr.ScatterPlot(
20
  temp_sensor_data,
21
  x="time",
22
  y="temperature",
23
  color="location",
24
+ show_export_button=True,
25
  )
26
 
27
  time_graphs = [temp_by_time, temp_by_time_location]
 
49
  food_rating_data,
50
  x="cuisine",
51
  y="price",
52
+ show_export_button=True,
53
  )
54
  with gr.Row():
55
  price_by_rating = gr.ScatterPlot(
 
58
  y="price",
59
  color="wait",
60
  show_actions_button=True,
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
+ show_export_button=True,
69
  )
70
 
71
  if __name__ == "__main__":