<!DOCTYPE html>
<html lang="en-US">
<head>
    <meta charset="UTF-8">
    <title>{{ plot.page_title }}</title>
    {% for dep in plot.dependencies %}
        <script type="text/javascript" src="{{ dep.asset }}"></script>
    {% endfor %}
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        html, body, div.pyg2-plot-container {
            height: 100%;
            overflow: hidden;
        }
    </style>
</head>
<body>
<div id="{{ plot.plot_id }}" class="pyg2-plot-container"></div>
<script>
    const chart_{{ plot.plot_id }} = new G2.Chart({
        container: '{{ plot.plot_id }}',
        width: {{ plot.width }},
        height: {{ plot.height }},
        depth: {{ plot.depth }},
        autoFit: {{ "true" if plot.autoFit else "false" }},
        padding: {{ plot.padding }},
    {% if plot.kwargs %}
        {% for key, value in plot.kwargs.items() %}
            {{ key }}: {{ value }},
        {% endfor %}
    {% endif %}
    })
    {% if plot.plot_api_type == "spec" %}
        chart_{{ plot.plot_id }}.options({{ plot.js_options }})
    {% elif plot.plot_api_type == "api" %}
        {% for item in plot.render_data %}
            chart_{{ plot.plot_id }}.{{ item | join(".") }}
        {% endfor %}
    {% endif %}
    chart_{{ plot.plot_id }}.render()
</script>
</body>
</html>