Spaces:
Running
Running
feat: adjust html preview height
Browse files
app.py
CHANGED
|
@@ -512,17 +512,13 @@ def update_preview_from_html(html_content: str) -> str:
|
|
| 512 |
# Create iframe HTML - only escape quotes for srcdoc attribute
|
| 513 |
safe_html_content = html_content.replace('"', """)
|
| 514 |
preview_html = f"""
|
| 515 |
-
<div style='padding: 20px; background: #fff; border: 1px solid #eee; border-radius: 8px; display: block;'>
|
| 516 |
-
<
|
| 517 |
-
|
| 518 |
-
|
| 519 |
-
|
| 520 |
-
|
| 521 |
-
|
| 522 |
-
style="border:none; overflow:hidden;"
|
| 523 |
-
sandbox="allow-scripts allow-same-origin">
|
| 524 |
-
</iframe>
|
| 525 |
-
</div>
|
| 526 |
</div>
|
| 527 |
"""
|
| 528 |
return preview_html
|
|
@@ -644,7 +640,7 @@ with demo:
|
|
| 644 |
example_dropdown.change(
|
| 645 |
fn=load_example, inputs=[example_dropdown], outputs=[svg_file, object_name]
|
| 646 |
)
|
| 647 |
-
|
| 648 |
process_btn = gr.Button("π Decompose Structure", variant="primary")
|
| 649 |
groups_summary = gr.Textbox(
|
| 650 |
label="Decomposition Results",
|
|
|
|
| 512 |
# Create iframe HTML - only escape quotes for srcdoc attribute
|
| 513 |
safe_html_content = html_content.replace('"', """)
|
| 514 |
preview_html = f"""
|
| 515 |
+
<div style='padding: 20px; width:100%; height:520px; background: #fff; border: 1px solid #eee; border-radius: 8px; display: block;'>
|
| 516 |
+
<iframe srcdoc="{safe_html_content}"
|
| 517 |
+
width="100%"
|
| 518 |
+
height="100%"
|
| 519 |
+
style="border:none; border-radius:8px; overflow:hidden;"
|
| 520 |
+
sandbox="allow-scripts allow-same-origin">
|
| 521 |
+
</iframe>
|
|
|
|
|
|
|
|
|
|
|
|
|
| 522 |
</div>
|
| 523 |
"""
|
| 524 |
return preview_html
|
|
|
|
| 640 |
example_dropdown.change(
|
| 641 |
fn=load_example, inputs=[example_dropdown], outputs=[svg_file, object_name]
|
| 642 |
)
|
| 643 |
+
|
| 644 |
process_btn = gr.Button("π Decompose Structure", variant="primary")
|
| 645 |
groups_summary = gr.Textbox(
|
| 646 |
label="Decomposition Results",
|