diff --git a/scss/_ntp.scss b/scss/_ntp.scss index abe38b9b55753f2c8aafd22a927f50d478c0bad2..aafa278a965d9f964ee762c29dfa923a32a545ea 100644 --- a/scss/_ntp.scss +++ b/scss/_ntp.scss @@ -2,11 +2,6 @@ margin-bottom: 10px; } -.js-plotly-plot .plotly .user-select-none { - width: 100% !important; - overflow: hidden; -} - .ntpBanner{ margin-top: 10px; display: block; diff --git a/ts/jl-ntp-graph.ts b/ts/jl-ntp-graph.ts index cee33a2c5b4b831a9ba8c9aa3a1f0244b70e86f9..1a6873e8b4b353e01b27b197be532d6265fa610e 100644 --- a/ts/jl-ntp-graph.ts +++ b/ts/jl-ntp-graph.ts @@ -60,5 +60,9 @@ function drawPlot(elementName:string, x:Date[], y:number[], title:string){ let layout = { title: title, }; - Plotly.newPlot(elementName, [score], layout); + let config = { + responsive: true + }; + + Plotly.newPlot(elementName, [score], layout, config); } \ No newline at end of file diff --git a/ts/ntpMenu.ts b/ts/ntpMenu.ts index 81707bf8aae5f5771320fde3ce4ef547ee4e80ef..dda99a938c821600ec8b24eb9c91815b29d82f0d 100644 --- a/ts/ntpMenu.ts +++ b/ts/ntpMenu.ts @@ -2,13 +2,16 @@ let ntpNav = document.querySelectorAll(".ntpBanner"); ntpNav.forEach((element) => { (<HTMLElement>element).onclick = function (){ - let contentID = element.getAttribute("data-index") + "-Content"; + let index = element.getAttribute("data-index"); + let contentID = index + "-Content"; let contentElement = <HTMLElement> 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}); } } }); \ No newline at end of file