aalkaswan commited on
Commit
1babcbe
·
verified ·
1 Parent(s): 524f046

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +24 -11
app.py CHANGED
@@ -147,18 +147,31 @@ def random_sample(r: gr.Request):
147
  # Gradio Interface
148
  with gr.Blocks() as demo:
149
  with gr.Tabs(elem_classes="tab-buttons") as tabs:
 
 
 
 
 
 
 
 
 
 
 
 
150
  with gr.TabItem("3D Visualisation"):
151
- gr.Interface(
152
- plot_scatter_tab5,
153
- [
154
- gr.Radio(["Copyright", "Malware", "Unfair/dangerous", "All"], value="All", label="Category Selection"),
155
- gr.Radio(['H', 'A', 'W', 'R'], value="H", label="X-axis Label"),
156
- gr.Radio(['H', 'A', 'W', 'R'], value="R", label="Y-axis Label"),
157
- gr.Radio(['H', 'A', 'W', 'R'], value="A", label="Z-axis Label"),
158
- gr.Radio(['Organisation', 'Size'], value="Organisation", label="Color Label"),
159
- ],
160
- gr.Plot(label="plot", format="png",), allow_flagging="never",
161
- )
 
162
  with gr.TabItem("Benchmark Table"):
163
  gr.Markdown("""
164
  # Benchmark Results
 
147
  # Gradio Interface
148
  with gr.Blocks() as demo:
149
  with gr.Tabs(elem_classes="tab-buttons") as tabs:
150
+ # with gr.TabItem("3D Visualisation"):
151
+ # gr.Interface(
152
+ # plot_scatter_tab5,
153
+ # [
154
+ # gr.Radio(["Copyright", "Malware", "Unfair/dangerous", "All"], value="All", label="Category Selection"),
155
+ # gr.Radio(['H', 'A', 'W', 'R'], value="H", label="X-axis Label"),
156
+ # gr.Radio(['H', 'A', 'W', 'R'], value="R", label="Y-axis Label"),
157
+ # gr.Radio(['H', 'A', 'W', 'R'], value="A", label="Z-axis Label"),
158
+ # gr.Radio(['Organisation', 'Size'], value="Organisation", label="Color Label"),
159
+ # ],
160
+ # gr.Plot(label="plot", format="png",), allow_flagging="never",
161
+ # )
162
  with gr.TabItem("3D Visualisation"):
163
+ category = gr.Radio(["Copyright", "Malware", "Unfair/dangerous", "All"], value="All", label="Category Selection")
164
+ x_axis = gr.Radio(['H', 'A', 'W', 'R'], value="H", label="X-axis Label")
165
+ y_axis = gr.Radio(['H', 'A', 'W', 'R'], value="R", label="Y-axis Label")
166
+ z_axis = gr.Radio(['H', 'A', 'W', 'R'], value="A", label="Z-axis Label")
167
+ color_label = gr.Radio(['Organisation', 'Size'], value="Organisation", label="Color Label")
168
+ plot = gr.Plot()
169
+
170
+ # Set up callback for when any of the inputs change or have a button to update.
171
+ # Here I'll use a button:
172
+ plot_button = gr.Button("Plot 3D Scatter")
173
+ plot_button.click(fn=plot_scatter_tab5, inputs=[category, x_axis, y_axis, z_axis, color_label], outputs=plot)
174
+
175
  with gr.TabItem("Benchmark Table"):
176
  gr.Markdown("""
177
  # Benchmark Results