let Plotly = require('plotly.js-dist')

let ntpNav = document.querySelectorAll(".ntpBanner");

ntpNav.forEach((element) => {
        element.onclick = function (){
        let index = element.getAttribute("data-index");
        let contentID = index + "-Content";
        let contentElement = document.getElementById(contentID);

        if(contentElement.classList.contains("visible")){
            contentElement.classList.remove("visible");
        } else {
            contentElement.classList.add("visible");
            Plotly.relayout(index + "-Delay", {autosize: true});
            Plotly.relayout(index + "-Score", {autosize: true});
        }
    }
});