Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -87,40 +87,41 @@ if __name__ == "__main__":
|
|
| 87 |
|
| 88 |
with gr.Tabs():
|
| 89 |
with gr.TabItem("Class Diagram"):
|
| 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 |
# with gr.TabItem("Entity Relationship"):
|
| 126 |
# with gr.Row():
|
|
|
|
| 87 |
|
| 88 |
with gr.Tabs():
|
| 89 |
with gr.TabItem("Class Diagram"):
|
| 90 |
+
with gr.Row():
|
| 91 |
+
with gr.Column(scale=1):
|
| 92 |
+
json_input_cd = gr.Textbox(
|
| 93 |
+
value=CLASS_DIAGRAM_JSON,
|
| 94 |
+
placeholder="Paste JSON following the documented format",
|
| 95 |
+
label="JSON Input",
|
| 96 |
+
lines=20
|
| 97 |
+
)
|
| 98 |
+
submit_btn_cd = gr.Button("Generate Class Diagram", variant="primary")
|
| 99 |
+
|
| 100 |
+
with gr.Column(scale=2):
|
| 101 |
+
output_cd = gr.Image(
|
| 102 |
+
label="Generated Diagram",
|
| 103 |
+
type="filepath",
|
| 104 |
+
show_download_button=True,
|
| 105 |
+
height=500
|
| 106 |
+
)
|
| 107 |
+
|
| 108 |
+
submit_btn_cd.click(
|
| 109 |
+
fn=generate_class_diagram,
|
| 110 |
+
inputs=[json_input_cd, output_format_radio],
|
| 111 |
+
outputs=output_cd
|
| 112 |
+
)
|
| 113 |
+
|
| 114 |
+
gr.Markdown("## Examples")
|
| 115 |
+
with gr.Row():
|
| 116 |
+
with gr.Column(scale=1):
|
| 117 |
+
gr.Image(value="./images/cd1.svg", label="Sample 1", show_label=True, interactive=False, height="auto")
|
| 118 |
+
gr.Image(value="./images/cd3.svg", label="Sample 3", show_label=True, interactive=False, height="auto")
|
| 119 |
+
gr.Image(value="./images/cd5.svg", label="Sample 5", show_label=True, interactive=False, height="auto")
|
| 120 |
+
|
| 121 |
+
with gr.Column(scale=1):
|
| 122 |
+
gr.Image(value="./images/cd2.svg", label="Sample 2", show_label=True, interactive=False, height="auto")
|
| 123 |
+
gr.Image(value="./images/cd4.svg", label="Sample 4", show_label=True, interactive=False, height="auto")
|
| 124 |
+
gr.Image(value="./images/cd6.svg", label="Sample 6", show_label=True, interactive=False, height="auto")
|
| 125 |
|
| 126 |
# with gr.TabItem("Entity Relationship"):
|
| 127 |
# with gr.Row():
|