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

View file

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