[CodeFactor] Apply fixes to commit 4ea01f3

This commit is contained in:
codefactor-io 2023-12-10 15:50:07 +00:00
parent 4ea01f39b4
commit 2abe3da834
No known key found for this signature in database
GPG key ID: B66B2D63282C190F
2 changed files with 11 additions and 19 deletions

View file

@ -170,7 +170,8 @@ const scatterChartData = computed(() => ({
var localSpectrum; var localSpectrum;
//Define and generate a unique ID for canvas //Define and generate a unique ID for canvas
const localSpectrumID = ref(""); const localSpectrumID = ref("");
localSpectrumID.value = "gridwfid-" + (Math.random() + 1).toString(36).substring(7); localSpectrumID.value =
"gridwfid-" + (Math.random() + 1).toString(36).substring(7);
onMounted(() => { onMounted(() => {
// This code will be executed after the component is mounted to the DOM // This code will be executed after the component is mounted to the DOM
// You can access DOM elements or perform other initialization here // You can access DOM elements or perform other initialization here
@ -179,20 +180,15 @@ onMounted(() => {
// init waterfall // init waterfall
localSpectrum = initWaterfall(localSpectrumID.value); localSpectrum = initWaterfall(localSpectrumID.value);
nextTick(() => { nextTick(() => {
window.addEventListener( window.addEventListener(
"wf-data-avail", "wf-data-avail",
function (evt) { function (evt) {
localSpectrum.addData(evt.detail); localSpectrum.addData(evt.detail);
}, },
false, false,
); );
setColormap(settings.local.wf_theme.valueOf); setColormap(settings.local.wf_theme.valueOf);
}); });
}); });
</script> </script>

View file

@ -169,7 +169,7 @@ const scatterChartData = computed(() => ({
</script> </script>
<script lang="ts"> <script lang="ts">
import { initWaterfall,setColormap } from "../js/waterfallHandler.js"; import { initWaterfall, setColormap } from "../js/waterfallHandler.js";
var localSpectrum; var localSpectrum;
export default { export default {
mounted() { mounted() {
@ -186,11 +186,7 @@ export default {
}, },
false, false,
); );
setColormap(settings.local.wf_theme.valueOf); setColormap(settings.local.wf_theme.valueOf);
}, },
}; };
</script> </script>