<div id="{{uid}}" style="width: {{width}}; height: {{height}};" desmos macro="desmos"></div>
<script>
window.addEventListener("load", function on_load() {
    var elt = document.getElementById('{{uid}}');
    var options = {
        expressionsCollapsed: true,
        expressions: {{show_expressions}},
        lockViewport: {{lockViewport}},
        settingsMenu: false,
        border: false,
        // xAxisNumbers: {{xAxisNumbers}},
        // yAxisNumbers: {{yAxisNumbers}},
        showGrid: {{showGrid}},
    };
    var calculator = Desmos.GraphingCalculator(elt, options);
    if (
        {{math_bounds}} &&
        {{math_bounds}} !== null &&
        {{math_bounds}} !== undefined
    ) {
        calculator.setMathBounds({{math_bounds}});
    }
    for (cmd of {{commands}}) {
        calculator.setExpression(cmd);
    }
});
</script>