MCPcopy Create free account
hub / github.com/ChartGalaxy/ChartGalaxy / convert_g_to_html

Function convert_g_to_html

code_generation_benchmark/utils/utils_parse.py:122–142  ·  view source on GitHub ↗
(g_str, gw, gh, html_path: str)

Source from the content-addressed store, hash-verified

120 return html
121
122def 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

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected