Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -215,36 +215,6 @@ if __name__ == "__main__":
|
|
215 |
gr.Image(value="./images/cm1.svg", label="Sample 1", show_label=True, interactive=False, height="auto", width="100%")
|
216 |
gr.Image(value="./images/cm2.svg", label="Sample 2", show_label=True, interactive=False, height="auto", width="100%")
|
217 |
|
218 |
-
with gr.TabItem("Process Flow"):
|
219 |
-
with gr.Row():
|
220 |
-
with gr.Column(scale=1):
|
221 |
-
json_input_pf = gr.Textbox(
|
222 |
-
value=PROCESS_FLOW_JSON,
|
223 |
-
placeholder="Paste JSON following the documented format",
|
224 |
-
label="JSON Input",
|
225 |
-
lines=20
|
226 |
-
)
|
227 |
-
submit_btn_pf = gr.Button("Generate Process Flow", variant="primary")
|
228 |
-
|
229 |
-
with gr.Column(scale=2):
|
230 |
-
output_pf = gr.Image(
|
231 |
-
label="Generated Diagram",
|
232 |
-
type="filepath",
|
233 |
-
show_download_button=True,
|
234 |
-
height=500
|
235 |
-
)
|
236 |
-
|
237 |
-
submit_btn_pf.click(
|
238 |
-
fn=generate_process_flow_diagram,
|
239 |
-
inputs=[json_input_pf, output_format_radio],
|
240 |
-
outputs=output_pf
|
241 |
-
)
|
242 |
-
|
243 |
-
gr.Markdown("## Examples")
|
244 |
-
with gr.Row(elem_classes=["example-images"]):
|
245 |
-
gr.Image(value="./images/pf1.svg", label="Sample 1", show_label=True, interactive=False, height="auto", width="100%")
|
246 |
-
gr.Image(value="./images/pf2.svg", label="Sample 2", show_label=True, interactive=False, height="auto", width="100%")
|
247 |
-
|
248 |
with gr.TabItem("Timeline"):
|
249 |
with gr.Row():
|
250 |
with gr.Column(scale=1):
|
@@ -275,36 +245,6 @@ if __name__ == "__main__":
|
|
275 |
gr.Image(value="./images/tl1.svg", label="Sample 1", show_label=True, interactive=False, height="auto", width="100%")
|
276 |
gr.Image(value="./images/tl2.svg", label="Sample 2", show_label=True, interactive=False, height="auto", width="100%")
|
277 |
|
278 |
-
with gr.TabItem("Network Graph"):
|
279 |
-
with gr.Row():
|
280 |
-
with gr.Column(scale=1):
|
281 |
-
json_input_ng = gr.Textbox(
|
282 |
-
value=NETWORK_GRAPH_JSON,
|
283 |
-
placeholder="Paste JSON following the documented format",
|
284 |
-
label="JSON Input",
|
285 |
-
lines=20
|
286 |
-
)
|
287 |
-
submit_btn_ng = gr.Button("Generate Network Graph", variant="primary")
|
288 |
-
|
289 |
-
with gr.Column(scale=2):
|
290 |
-
output_ng = gr.Image(
|
291 |
-
label="Generated Diagram",
|
292 |
-
type="filepath",
|
293 |
-
show_download_button=True,
|
294 |
-
height=500
|
295 |
-
)
|
296 |
-
|
297 |
-
submit_btn_ng.click(
|
298 |
-
fn=generate_network_graph,
|
299 |
-
inputs=[json_input_ng, output_format_radio],
|
300 |
-
outputs=output_ng
|
301 |
-
)
|
302 |
-
|
303 |
-
gr.Markdown("## Examples")
|
304 |
-
with gr.Row(elem_classes=["example-images"]):
|
305 |
-
gr.Image(value="./images/ng1.svg", label="Sample 1", show_label=True, interactive=False, height="auto", width="100%")
|
306 |
-
gr.Image(value="./images/ng2.svg", label="Sample 2", show_label=True, interactive=False, height="auto", width="100%")
|
307 |
-
|
308 |
with gr.TabItem("Binary Tree"):
|
309 |
with gr.Row():
|
310 |
with gr.Column(scale=1):
|
@@ -394,6 +334,66 @@ if __name__ == "__main__":
|
|
394 |
with gr.Row(elem_classes=["example-images"]):
|
395 |
gr.Image(value="./images/sc1.svg", label="Sample 1", show_label=True, interactive=False, height="auto", width="100%")
|
396 |
gr.Image(value="./images/sc2.svg", label="Sample 2", show_label=True, interactive=False, height="auto", width="100%")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
397 |
|
398 |
demo.launch(
|
399 |
mcp_server=True,
|
|
|
215 |
gr.Image(value="./images/cm1.svg", label="Sample 1", show_label=True, interactive=False, height="auto", width="100%")
|
216 |
gr.Image(value="./images/cm2.svg", label="Sample 2", show_label=True, interactive=False, height="auto", width="100%")
|
217 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
218 |
with gr.TabItem("Timeline"):
|
219 |
with gr.Row():
|
220 |
with gr.Column(scale=1):
|
|
|
245 |
gr.Image(value="./images/tl1.svg", label="Sample 1", show_label=True, interactive=False, height="auto", width="100%")
|
246 |
gr.Image(value="./images/tl2.svg", label="Sample 2", show_label=True, interactive=False, height="auto", width="100%")
|
247 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
248 |
with gr.TabItem("Binary Tree"):
|
249 |
with gr.Row():
|
250 |
with gr.Column(scale=1):
|
|
|
334 |
with gr.Row(elem_classes=["example-images"]):
|
335 |
gr.Image(value="./images/sc1.svg", label="Sample 1", show_label=True, interactive=False, height="auto", width="100%")
|
336 |
gr.Image(value="./images/sc2.svg", label="Sample 2", show_label=True, interactive=False, height="auto", width="100%")
|
337 |
+
|
338 |
+
with gr.TabItem("Process Flow"):
|
339 |
+
with gr.Row():
|
340 |
+
with gr.Column(scale=1):
|
341 |
+
json_input_pf = gr.Textbox(
|
342 |
+
value=PROCESS_FLOW_JSON,
|
343 |
+
placeholder="Paste JSON following the documented format",
|
344 |
+
label="JSON Input",
|
345 |
+
lines=20
|
346 |
+
)
|
347 |
+
submit_btn_pf = gr.Button("Generate Process Flow", variant="primary")
|
348 |
+
|
349 |
+
with gr.Column(scale=2):
|
350 |
+
output_pf = gr.Image(
|
351 |
+
label="Generated Diagram",
|
352 |
+
type="filepath",
|
353 |
+
show_download_button=True,
|
354 |
+
height=500
|
355 |
+
)
|
356 |
+
|
357 |
+
submit_btn_pf.click(
|
358 |
+
fn=generate_process_flow_diagram,
|
359 |
+
inputs=[json_input_pf, output_format_radio],
|
360 |
+
outputs=output_pf
|
361 |
+
)
|
362 |
+
|
363 |
+
gr.Markdown("## Examples")
|
364 |
+
with gr.Row(elem_classes=["example-images"]):
|
365 |
+
gr.Image(value="./images/pf1.svg", label="Sample 1", show_label=True, interactive=False, height="auto", width="100%")
|
366 |
+
gr.Image(value="./images/pf2.svg", label="Sample 2", show_label=True, interactive=False, height="auto", width="100%")
|
367 |
+
|
368 |
+
with gr.TabItem("Network Graph"):
|
369 |
+
with gr.Row():
|
370 |
+
with gr.Column(scale=1):
|
371 |
+
json_input_ng = gr.Textbox(
|
372 |
+
value=NETWORK_GRAPH_JSON,
|
373 |
+
placeholder="Paste JSON following the documented format",
|
374 |
+
label="JSON Input",
|
375 |
+
lines=20
|
376 |
+
)
|
377 |
+
submit_btn_ng = gr.Button("Generate Network Graph", variant="primary")
|
378 |
+
|
379 |
+
with gr.Column(scale=2):
|
380 |
+
output_ng = gr.Image(
|
381 |
+
label="Generated Diagram",
|
382 |
+
type="filepath",
|
383 |
+
show_download_button=True,
|
384 |
+
height=500
|
385 |
+
)
|
386 |
+
|
387 |
+
submit_btn_ng.click(
|
388 |
+
fn=generate_network_graph,
|
389 |
+
inputs=[json_input_ng, output_format_radio],
|
390 |
+
outputs=output_ng
|
391 |
+
)
|
392 |
+
|
393 |
+
gr.Markdown("## Examples")
|
394 |
+
with gr.Row(elem_classes=["example-images"]):
|
395 |
+
gr.Image(value="./images/ng1.svg", label="Sample 1", show_label=True, interactive=False, height="auto", width="100%")
|
396 |
+
gr.Image(value="./images/ng2.svg", label="Sample 2", show_label=True, interactive=False, height="auto", width="100%")
|
397 |
|
398 |
demo.launch(
|
399 |
mcp_server=True,
|