{% macro add_js(list) %}

{% set js_map = {
'd3': '/static/lib/js/d3.v7.js',
'd3Hexbin': '/static/lib/js/d3-hexbin.js',
'scatterplot': '/static/js/scatterPlot.js',
'cameraview': '/static/js/cameraPlot.js',
'criteriaPlot': '/static/js/criteriaPlot.js',
'plot': '/static/js/plot.js'
} %}


{% for js in list %}
{% if js in js_map %}
{# d3.v7.js loads 'd3' as a global variable, cannot be imported as a module #}
<script src="{{ js_map[js] }}" {% if js !='d3' %} type="module" {% endif %}></script>
{% endif %}
{% endfor %}


{% endmacro %}
