(g_str, gw, gh, html_path: str)
| 120 | return html |
| 121 | |
| 122 | def convert_g_to_html(g_str, gw, gh, html_path: str): |
| 123 | html = f"""<!DOCTYPE html> |
| 124 | <html lang="en"> |
| 125 | <head> |
| 126 | <meta charset="UTF-8" /> |
| 127 | <title>Infographic Chart</title> |
| 128 | </head> |
| 129 | <body> |
| 130 | <div id="chart-container"> |
| 131 | <svg width="{gw}" height="{gh}"> |
| 132 | <g transform="translate({gw / 2}, {gh / 2})"> |
| 133 | {g_str} |
| 134 | </g> |
| 135 | </svg> |
| 136 | </div> |
| 137 | </body> |
| 138 | </html> |
| 139 | """ |
| 140 | with open(html_path, 'w', encoding='utf-8') as f: |
| 141 | f.write(html) |
| 142 | return html |
| 143 |
nothing calls this directly
no outgoing calls
no test coverage detected